* [Xenomai-core] [PATCH] blackfin: build xenomai in FLAT format
@ 2009-02-24 8:18 yi li
2009-02-24 16:30 ` Philippe Gerum
0 siblings, 1 reply; 10+ messages in thread
From: yi li @ 2009-02-24 8:18 UTC (permalink / raw)
To: Xenomai-core
This patch fixes xenomai-2.4.x branch build scripts, to build xenomai
as FLAT on Blackfin.
1. "-mfdpic" option is by default set by bfin-linux-uclibc-gcc. It is
not required and it can cause error for bfin-uclinux-gcc.
2. libpthread_rt.la should not depend on "lpthread".
-Yi
diff -Nurp --exclude=.svn xenomai-2.4.x-clean/configure xenomai-2.4.x/configure
--- xenomai-2.4.x-clean/configure 2008-12-04 19:21:40.000000000 +0800
+++ xenomai-2.4.x/configure 2009-02-23 17:12:14.000000000 +0800
@@ -22569,10 +22569,10 @@ case $XENO_TARGET_ARCH in
;;
blackfin)
# Produce libraries in FDPIC format.
- XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe -mfdpic"
- XENO_USER_LDFLAGS="$XENO_USER_CFLAGS -mfdpic"
- XENO_USER_APP_CFLAGS="$XENO_USER_APP_CFLAGS -mfdpic"
- XENO_USER_APP_LDFLAGS="$XENO_USER_APP_LDFLAGS -mfdpic"
+ XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe"
+ XENO_USER_LDFLAGS="$XENO_USER_CFLAGS"
+ XENO_USER_APP_CFLAGS="$XENO_USER_APP_CFLAGS"
+ XENO_USER_APP_LDFLAGS="$XENO_USER_APP_LDFLAGS"
;;
arm)
XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe
-march=armv$CONFIG_XENO_ARM_ARCH"
diff -Nurp --exclude=.svn xenomai-2.4.x-clean/configure.in
xenomai-2.4.x/configure.in
--- xenomai-2.4.x-clean/configure.in 2008-12-04 19:21:40.000000000 +0800
+++ xenomai-2.4.x/configure.in 2009-02-23 17:12:14.000000000 +0800
@@ -648,10 +648,10 @@ case $XENO_TARGET_ARCH in
;;
blackfin)
# Produce libraries in FDPIC format.
- XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe -mfdpic"
- XENO_USER_LDFLAGS="$XENO_USER_CFLAGS -mfdpic"
- XENO_USER_APP_CFLAGS="$XENO_USER_APP_CFLAGS -mfdpic"
- XENO_USER_APP_LDFLAGS="$XENO_USER_APP_LDFLAGS -mfdpic"
+ XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe"
+ XENO_USER_LDFLAGS="$XENO_USER_CFLAGS"
+ XENO_USER_APP_CFLAGS="$XENO_USER_APP_CFLAGS"
+ XENO_USER_APP_LDFLAGS="$XENO_USER_APP_LDFLAGS"
;;
arm)
XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe
-march=armv$CONFIG_XENO_ARM_ARCH"
diff -Nurp --exclude=.svn
xenomai-2.4.x-clean/src/skins/posix/Makefile.am
xenomai-2.4.x/src/skins/posix/Makefile.am
--- xenomai-2.4.x-clean/src/skins/posix/Makefile.am 2008-03-10
06:33:59.000000000 +0800
+++ xenomai-2.4.x/src/skins/posix/Makefile.am 2009-02-23
17:12:14.000000000 +0800
@@ -2,7 +2,7 @@ includedir = $(prefix)/include/posix
lib_LTLIBRARIES = libpthread_rt.la
-libpthread_rt_la_LDFLAGS = -version-info 1:0:0 -lpthread
+libpthread_rt_la_LDFLAGS = -version-info 1:0:0
libpthread_rt_la_SOURCES = \
init.c \
diff -Nurp --exclude=.svn
xenomai-2.4.x-clean/src/skins/posix/Makefile.in
xenomai-2.4.x/src/skins/posix/Makefile.in
--- xenomai-2.4.x-clean/src/skins/posix/Makefile.in 2008-06-02
05:32:28.000000000 +0800
+++ xenomai-2.4.x/src/skins/posix/Makefile.in 2009-02-23
17:12:14.000000000 +0800
@@ -239,7 +239,7 @@ target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
lib_LTLIBRARIES = libpthread_rt.la
-libpthread_rt_la_LDFLAGS = -version-info 1:0:0 -lpthread
+libpthread_rt_la_LDFLAGS = -version-info 1:0:0
libpthread_rt_la_SOURCES = \
init.c \
thread.c \
diff -Nurp --exclude=.svn
xenomai-2.4.x-clean/src/testsuite/clocktest/Makefile.am
xenomai-2.4.x/src/testsuite/clocktest/Makefile.am
--- xenomai-2.4.x-clean/src/testsuite/clocktest/Makefile.am 2008-03-01
04:41:56.000000000 +0800
+++ xenomai-2.4.x/src/testsuite/clocktest/Makefile.am 2009-02-23
17:12:14.000000000 +0800
@@ -9,7 +9,7 @@ clocktest_CPPFLAGS = -I$(top_srcdir)/inc
clocktest_LDFLAGS = $(XENO_POSIX_WRAPPERS) $(XENO_USER_LDFLAGS)
clocktest_LDADD = \
- ../../skins/posix/libpthread_rt.la -lpthread -lrt
+ -lpthread -lrt ../../skins/posix/libpthread_rt.la
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(testdir)
diff -Nurp --exclude=.svn
xenomai-2.4.x-clean/src/testsuite/clocktest/Makefile.in
xenomai-2.4.x/src/testsuite/clocktest/Makefile.in
--- xenomai-2.4.x-clean/src/testsuite/clocktest/Makefile.in 2008-06-02
05:32:28.000000000 +0800
+++ xenomai-2.4.x/src/testsuite/clocktest/Makefile.in 2009-02-23
17:12:14.000000000 +0800
@@ -232,7 +232,7 @@ clocktest_SOURCES = clocktest.c
clocktest_CPPFLAGS = -I$(top_srcdir)/include/posix
$(XENO_USER_CFLAGS) -I$(top_srcdir)/include
clocktest_LDFLAGS = $(XENO_POSIX_WRAPPERS) $(XENO_USER_LDFLAGS)
clocktest_LDADD = \
- ../../skins/posix/libpthread_rt.la -lpthread -lrt
+ -lpthread -lrt ../../skins/posix/libpthread_rt.la
EXTRA_DIST = runinfo.in
all: all-am
diff -Nurp --exclude=.svn
xenomai-2.4.x-clean/src/testsuite/cyclic/Makefile.am
xenomai-2.4.x/src/testsuite/cyclic/Makefile.am
--- xenomai-2.4.x-clean/src/testsuite/cyclic/Makefile.am 2008-03-01
04:41:56.000000000 +0800
+++ xenomai-2.4.x/src/testsuite/cyclic/Makefile.am 2009-02-23
17:12:14.000000000 +0800
@@ -9,7 +9,7 @@ cyclictest_CPPFLAGS = -I$(top_srcdir)/in
cyclictest_LDFLAGS = $(XENO_POSIX_WRAPPERS) $(XENO_USER_LDFLAGS)
cyclictest_LDADD = \
- ../../skins/posix/libpthread_rt.la -lpthread -lrt
+ -lpthread -lrt ../../skins/posix/libpthread_rt.la
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(testdir)
diff -Nurp --exclude=.svn
xenomai-2.4.x-clean/src/testsuite/cyclic/Makefile.in
xenomai-2.4.x/src/testsuite/cyclic/Makefile.in
--- xenomai-2.4.x-clean/src/testsuite/cyclic/Makefile.in 2008-06-02
05:32:28.000000000 +0800
+++ xenomai-2.4.x/src/testsuite/cyclic/Makefile.in 2009-02-23
17:12:14.000000000 +0800
@@ -232,7 +232,7 @@ cyclictest_SOURCES = cyclictest.c
cyclictest_CPPFLAGS = -I$(top_srcdir)/include/posix
$(XENO_USER_CFLAGS) -DIPIPE_TRACE=1 -I$(top_srcdir)/include
cyclictest_LDFLAGS = $(XENO_POSIX_WRAPPERS) $(XENO_USER_LDFLAGS)
cyclictest_LDADD = \
- ../../skins/posix/libpthread_rt.la -lpthread -lrt
+ -lpthread -lrt ../../skins/posix/libpthread_rt.la
EXTRA_DIST = runinfo.in
all: all-am
diff -Nurp --exclude=.svn
xenomai-2.4.x-clean/src/testsuite/irqbench/Makefile.am
xenomai-2.4.x/src/testsuite/irqbench/Makefile.am
--- xenomai-2.4.x-clean/src/testsuite/irqbench/Makefile.am 2008-03-01
04:41:56.000000000 +0800
+++ xenomai-2.4.x/src/testsuite/irqbench/Makefile.am 2009-02-23
17:12:14.000000000 +0800
@@ -19,7 +19,7 @@ irqloop_LDFLAGS = \
$(XENO_USER_LDFLAGS)
irqloop_LDADD = \
- ../../skins/posix/libpthread_rt.la -lpthread -lrt
+ -lpthread -lrt ../../skins/posix/libpthread_rt.la
irqbench_SOURCES = irqbench.c
diff -Nurp --exclude=.svn
xenomai-2.4.x-clean/src/testsuite/irqbench/Makefile.in
xenomai-2.4.x/src/testsuite/irqbench/Makefile.in
--- xenomai-2.4.x-clean/src/testsuite/irqbench/Makefile.in 2008-06-02
05:32:28.000000000 +0800
+++ xenomai-2.4.x/src/testsuite/irqbench/Makefile.in 2009-02-23
17:12:14.000000000 +0800
@@ -247,7 +247,7 @@ irqloop_LDFLAGS = \
$(XENO_USER_LDFLAGS)
irqloop_LDADD = \
- ../../skins/posix/libpthread_rt.la -lpthread -lrt
+ -lpthread -lrt ../../skins/posix/libpthread_rt.la
irqbench_SOURCES = irqbench.c
irqbench_CPPFLAGS = \
diff -Nurp --exclude=.svn
xenomai-2.4.x-clean/src/testsuite/switchtest/Makefile.am
xenomai-2.4.x/src/testsuite/switchtest/Makefile.am
--- xenomai-2.4.x-clean/src/testsuite/switchtest/Makefile.am 2008-03-01
04:41:56.000000000 +0800
+++ xenomai-2.4.x/src/testsuite/switchtest/Makefile.am 2009-02-23
17:12:14.000000000 +0800
@@ -9,7 +9,7 @@ switchtest_CPPFLAGS = -I$(top_srcdir)/in
switchtest_LDFLAGS = $(XENO_POSIX_WRAPPERS) $(XENO_USER_LDFLAGS)
switchtest_LDADD = \
- ../../skins/posix/libpthread_rt.la -lpthread -lrt
+ -lpthread -lrt ../../skins/posix/libpthread_rt.la
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(testdir)
diff -Nurp --exclude=.svn
xenomai-2.4.x-clean/src/testsuite/switchtest/Makefile.in
xenomai-2.4.x/src/testsuite/switchtest/Makefile.in
--- xenomai-2.4.x-clean/src/testsuite/switchtest/Makefile.in 2008-06-02
05:32:28.000000000 +0800
+++ xenomai-2.4.x/src/testsuite/switchtest/Makefile.in 2009-02-23
17:12:14.000000000 +0800
@@ -232,7 +232,7 @@ switchtest_SOURCES = switchtest.c
switchtest_CPPFLAGS = -I$(top_srcdir)/include/posix
$(XENO_USER_CFLAGS) -g -I$(top_srcdir)/include
switchtest_LDFLAGS = $(XENO_POSIX_WRAPPERS) $(XENO_USER_LDFLAGS)
switchtest_LDADD = \
- ../../skins/posix/libpthread_rt.la -lpthread -lrt
+ -lpthread -lrt ../../skins/posix/libpthread_rt.la
EXTRA_DIST = runinfo.in
all: all-am
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] [PATCH] blackfin: build xenomai in FLAT format
2009-02-24 8:18 [Xenomai-core] [PATCH] blackfin: build xenomai in FLAT format yi li
@ 2009-02-24 16:30 ` Philippe Gerum
2009-02-25 4:22 ` yi li
0 siblings, 1 reply; 10+ messages in thread
From: Philippe Gerum @ 2009-02-24 16:30 UTC (permalink / raw)
To: yi li; +Cc: Xenomai-core
yi li wrote:
> This patch fixes xenomai-2.4.x branch build scripts, to build xenomai
> as FLAT on Blackfin.
>
> 1. "-mfdpic" option is by default set by bfin-linux-uclibc-gcc. It is
> not required and it can cause error for bfin-uclinux-gcc.
Ack.
> 2. libpthread_rt.la should not depend on "lpthread".
>
Nak. In flat mode, turning the link dependencies order upside down will not buy
us anything. Two-phase link is the only way to prevent circular/invalid
dependencies with a static only format when symbol wrapping is involved.
> -Yi
>
> diff -Nurp --exclude=.svn xenomai-2.4.x-clean/configure xenomai-2.4.x/configure
> --- xenomai-2.4.x-clean/configure 2008-12-04 19:21:40.000000000 +0800
> +++ xenomai-2.4.x/configure 2009-02-23 17:12:14.000000000 +0800
> @@ -22569,10 +22569,10 @@ case $XENO_TARGET_ARCH in
> ;;
> blackfin)
> # Produce libraries in FDPIC format.
> - XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe -mfdpic"
> - XENO_USER_LDFLAGS="$XENO_USER_CFLAGS -mfdpic"
> - XENO_USER_APP_CFLAGS="$XENO_USER_APP_CFLAGS -mfdpic"
> - XENO_USER_APP_LDFLAGS="$XENO_USER_APP_LDFLAGS -mfdpic"
> + XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe"
> + XENO_USER_LDFLAGS="$XENO_USER_CFLAGS"
> + XENO_USER_APP_CFLAGS="$XENO_USER_APP_CFLAGS"
> + XENO_USER_APP_LDFLAGS="$XENO_USER_APP_LDFLAGS"
> ;;
> arm)
> XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe
> -march=armv$CONFIG_XENO_ARM_ARCH"
> diff -Nurp --exclude=.svn xenomai-2.4.x-clean/configure.in
> xenomai-2.4.x/configure.in
> --- xenomai-2.4.x-clean/configure.in 2008-12-04 19:21:40.000000000 +0800
> +++ xenomai-2.4.x/configure.in 2009-02-23 17:12:14.000000000 +0800
> @@ -648,10 +648,10 @@ case $XENO_TARGET_ARCH in
> ;;
> blackfin)
> # Produce libraries in FDPIC format.
> - XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe -mfdpic"
> - XENO_USER_LDFLAGS="$XENO_USER_CFLAGS -mfdpic"
> - XENO_USER_APP_CFLAGS="$XENO_USER_APP_CFLAGS -mfdpic"
> - XENO_USER_APP_LDFLAGS="$XENO_USER_APP_LDFLAGS -mfdpic"
> + XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe"
> + XENO_USER_LDFLAGS="$XENO_USER_CFLAGS"
> + XENO_USER_APP_CFLAGS="$XENO_USER_APP_CFLAGS"
> + XENO_USER_APP_LDFLAGS="$XENO_USER_APP_LDFLAGS"
> ;;
> arm)
> XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe
> -march=armv$CONFIG_XENO_ARM_ARCH"
> diff -Nurp --exclude=.svn
> xenomai-2.4.x-clean/src/skins/posix/Makefile.am
> xenomai-2.4.x/src/skins/posix/Makefile.am
> --- xenomai-2.4.x-clean/src/skins/posix/Makefile.am 2008-03-10
> 06:33:59.000000000 +0800
> +++ xenomai-2.4.x/src/skins/posix/Makefile.am 2009-02-23
> 17:12:14.000000000 +0800
> @@ -2,7 +2,7 @@ includedir = $(prefix)/include/posix
>
> lib_LTLIBRARIES = libpthread_rt.la
>
> -libpthread_rt_la_LDFLAGS = -version-info 1:0:0 -lpthread
> +libpthread_rt_la_LDFLAGS = -version-info 1:0:0
>
> libpthread_rt_la_SOURCES = \
> init.c \
> diff -Nurp --exclude=.svn
> xenomai-2.4.x-clean/src/skins/posix/Makefile.in
> xenomai-2.4.x/src/skins/posix/Makefile.in
> --- xenomai-2.4.x-clean/src/skins/posix/Makefile.in 2008-06-02
> 05:32:28.000000000 +0800
> +++ xenomai-2.4.x/src/skins/posix/Makefile.in 2009-02-23
> 17:12:14.000000000 +0800
> @@ -239,7 +239,7 @@ target_vendor = @target_vendor@
> top_builddir = @top_builddir@
> top_srcdir = @top_srcdir@
> lib_LTLIBRARIES = libpthread_rt.la
> -libpthread_rt_la_LDFLAGS = -version-info 1:0:0 -lpthread
> +libpthread_rt_la_LDFLAGS = -version-info 1:0:0
> libpthread_rt_la_SOURCES = \
> init.c \
> thread.c \
> diff -Nurp --exclude=.svn
> xenomai-2.4.x-clean/src/testsuite/clocktest/Makefile.am
> xenomai-2.4.x/src/testsuite/clocktest/Makefile.am
> --- xenomai-2.4.x-clean/src/testsuite/clocktest/Makefile.am 2008-03-01
> 04:41:56.000000000 +0800
> +++ xenomai-2.4.x/src/testsuite/clocktest/Makefile.am 2009-02-23
> 17:12:14.000000000 +0800
> @@ -9,7 +9,7 @@ clocktest_CPPFLAGS = -I$(top_srcdir)/inc
> clocktest_LDFLAGS = $(XENO_POSIX_WRAPPERS) $(XENO_USER_LDFLAGS)
>
> clocktest_LDADD = \
> - ../../skins/posix/libpthread_rt.la -lpthread -lrt
> + -lpthread -lrt ../../skins/posix/libpthread_rt.la
>
> install-data-local:
> $(mkinstalldirs) $(DESTDIR)$(testdir)
> diff -Nurp --exclude=.svn
> xenomai-2.4.x-clean/src/testsuite/clocktest/Makefile.in
> xenomai-2.4.x/src/testsuite/clocktest/Makefile.in
> --- xenomai-2.4.x-clean/src/testsuite/clocktest/Makefile.in 2008-06-02
> 05:32:28.000000000 +0800
> +++ xenomai-2.4.x/src/testsuite/clocktest/Makefile.in 2009-02-23
> 17:12:14.000000000 +0800
> @@ -232,7 +232,7 @@ clocktest_SOURCES = clocktest.c
> clocktest_CPPFLAGS = -I$(top_srcdir)/include/posix
> $(XENO_USER_CFLAGS) -I$(top_srcdir)/include
> clocktest_LDFLAGS = $(XENO_POSIX_WRAPPERS) $(XENO_USER_LDFLAGS)
> clocktest_LDADD = \
> - ../../skins/posix/libpthread_rt.la -lpthread -lrt
> + -lpthread -lrt ../../skins/posix/libpthread_rt.la
>
> EXTRA_DIST = runinfo.in
> all: all-am
> diff -Nurp --exclude=.svn
> xenomai-2.4.x-clean/src/testsuite/cyclic/Makefile.am
> xenomai-2.4.x/src/testsuite/cyclic/Makefile.am
> --- xenomai-2.4.x-clean/src/testsuite/cyclic/Makefile.am 2008-03-01
> 04:41:56.000000000 +0800
> +++ xenomai-2.4.x/src/testsuite/cyclic/Makefile.am 2009-02-23
> 17:12:14.000000000 +0800
> @@ -9,7 +9,7 @@ cyclictest_CPPFLAGS = -I$(top_srcdir)/in
> cyclictest_LDFLAGS = $(XENO_POSIX_WRAPPERS) $(XENO_USER_LDFLAGS)
>
> cyclictest_LDADD = \
> - ../../skins/posix/libpthread_rt.la -lpthread -lrt
> + -lpthread -lrt ../../skins/posix/libpthread_rt.la
>
> install-data-local:
> $(mkinstalldirs) $(DESTDIR)$(testdir)
> diff -Nurp --exclude=.svn
> xenomai-2.4.x-clean/src/testsuite/cyclic/Makefile.in
> xenomai-2.4.x/src/testsuite/cyclic/Makefile.in
> --- xenomai-2.4.x-clean/src/testsuite/cyclic/Makefile.in 2008-06-02
> 05:32:28.000000000 +0800
> +++ xenomai-2.4.x/src/testsuite/cyclic/Makefile.in 2009-02-23
> 17:12:14.000000000 +0800
> @@ -232,7 +232,7 @@ cyclictest_SOURCES = cyclictest.c
> cyclictest_CPPFLAGS = -I$(top_srcdir)/include/posix
> $(XENO_USER_CFLAGS) -DIPIPE_TRACE=1 -I$(top_srcdir)/include
> cyclictest_LDFLAGS = $(XENO_POSIX_WRAPPERS) $(XENO_USER_LDFLAGS)
> cyclictest_LDADD = \
> - ../../skins/posix/libpthread_rt.la -lpthread -lrt
> + -lpthread -lrt ../../skins/posix/libpthread_rt.la
>
> EXTRA_DIST = runinfo.in
> all: all-am
> diff -Nurp --exclude=.svn
> xenomai-2.4.x-clean/src/testsuite/irqbench/Makefile.am
> xenomai-2.4.x/src/testsuite/irqbench/Makefile.am
> --- xenomai-2.4.x-clean/src/testsuite/irqbench/Makefile.am 2008-03-01
> 04:41:56.000000000 +0800
> +++ xenomai-2.4.x/src/testsuite/irqbench/Makefile.am 2009-02-23
> 17:12:14.000000000 +0800
> @@ -19,7 +19,7 @@ irqloop_LDFLAGS = \
> $(XENO_USER_LDFLAGS)
>
> irqloop_LDADD = \
> - ../../skins/posix/libpthread_rt.la -lpthread -lrt
> + -lpthread -lrt ../../skins/posix/libpthread_rt.la
>
>
> irqbench_SOURCES = irqbench.c
> diff -Nurp --exclude=.svn
> xenomai-2.4.x-clean/src/testsuite/irqbench/Makefile.in
> xenomai-2.4.x/src/testsuite/irqbench/Makefile.in
> --- xenomai-2.4.x-clean/src/testsuite/irqbench/Makefile.in 2008-06-02
> 05:32:28.000000000 +0800
> +++ xenomai-2.4.x/src/testsuite/irqbench/Makefile.in 2009-02-23
> 17:12:14.000000000 +0800
> @@ -247,7 +247,7 @@ irqloop_LDFLAGS = \
> $(XENO_USER_LDFLAGS)
>
> irqloop_LDADD = \
> - ../../skins/posix/libpthread_rt.la -lpthread -lrt
> + -lpthread -lrt ../../skins/posix/libpthread_rt.la
>
> irqbench_SOURCES = irqbench.c
> irqbench_CPPFLAGS = \
> diff -Nurp --exclude=.svn
> xenomai-2.4.x-clean/src/testsuite/switchtest/Makefile.am
> xenomai-2.4.x/src/testsuite/switchtest/Makefile.am
> --- xenomai-2.4.x-clean/src/testsuite/switchtest/Makefile.am 2008-03-01
> 04:41:56.000000000 +0800
> +++ xenomai-2.4.x/src/testsuite/switchtest/Makefile.am 2009-02-23
> 17:12:14.000000000 +0800
> @@ -9,7 +9,7 @@ switchtest_CPPFLAGS = -I$(top_srcdir)/in
> switchtest_LDFLAGS = $(XENO_POSIX_WRAPPERS) $(XENO_USER_LDFLAGS)
>
> switchtest_LDADD = \
> - ../../skins/posix/libpthread_rt.la -lpthread -lrt
> + -lpthread -lrt ../../skins/posix/libpthread_rt.la
>
> install-data-local:
> $(mkinstalldirs) $(DESTDIR)$(testdir)
> diff -Nurp --exclude=.svn
> xenomai-2.4.x-clean/src/testsuite/switchtest/Makefile.in
> xenomai-2.4.x/src/testsuite/switchtest/Makefile.in
> --- xenomai-2.4.x-clean/src/testsuite/switchtest/Makefile.in 2008-06-02
> 05:32:28.000000000 +0800
> +++ xenomai-2.4.x/src/testsuite/switchtest/Makefile.in 2009-02-23
> 17:12:14.000000000 +0800
> @@ -232,7 +232,7 @@ switchtest_SOURCES = switchtest.c
> switchtest_CPPFLAGS = -I$(top_srcdir)/include/posix
> $(XENO_USER_CFLAGS) -g -I$(top_srcdir)/include
> switchtest_LDFLAGS = $(XENO_POSIX_WRAPPERS) $(XENO_USER_LDFLAGS)
> switchtest_LDADD = \
> - ../../skins/posix/libpthread_rt.la -lpthread -lrt
> + -lpthread -lrt ../../skins/posix/libpthread_rt.la
>
> EXTRA_DIST = runinfo.in
> all: all-am
>
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
>
--
Philippe.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] [PATCH] blackfin: build xenomai in FLAT format
2009-02-24 16:30 ` Philippe Gerum
@ 2009-02-25 4:22 ` yi li
2009-02-25 10:23 ` Gilles Chanteperdrix
0 siblings, 1 reply; 10+ messages in thread
From: yi li @ 2009-02-25 4:22 UTC (permalink / raw)
To: rpm; +Cc: Xenomai-core
On Wed, Feb 25, 2009 at 12:30 AM, Philippe Gerum <rpm@xenomai.org> wrote:
>
>> 2. libpthread_rt.la should not depend on "lpthread".
>>
>
> Nak. In flat mode, turning the link dependencies order upside down will not buy
> us anything. Two-phase link is the only way to prevent circular/invalid
> dependencies with a static only format when symbol wrapping is involved.
>
Agree. But "libpthread_rt_la_LDFLAGS" should not include "-lpthread",
otherwise libtool will think libpthread_rt.a depends on libpthread.
I don't think there is such a dependency, isn't it?
-Yi
--- xenomai-2.4.x-clean/src/skins/posix/Makefile.in 2008-06-02
05:32:28.000000000 +0800
+++ xenomai-2.4.x/src/skins/posix/Makefile.in 2009-02-23
17:12:14.000000000 +0800
@@ -239,7 +239,7 @@ target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
lib_LTLIBRARIES = libpthread_rt.la
-libpthread_rt_la_LDFLAGS = -version-info 1:0:0 -lpthread
+libpthread_rt_la_LDFLAGS = -version-info 1:0:0
libpthread_rt_la_SOURCES = \
init.c \
thread.c \
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] [PATCH] blackfin: build xenomai in FLAT format
2009-02-25 4:22 ` yi li
@ 2009-02-25 10:23 ` Gilles Chanteperdrix
2009-02-26 6:21 ` yi li
0 siblings, 1 reply; 10+ messages in thread
From: Gilles Chanteperdrix @ 2009-02-25 10:23 UTC (permalink / raw)
To: yi li; +Cc: Xenomai-core
yi li wrote:
> On Wed, Feb 25, 2009 at 12:30 AM, Philippe Gerum <rpm@xenomai.org> wrote:
>>> 2. libpthread_rt.la should not depend on "lpthread".
>>>
>> Nak. In flat mode, turning the link dependencies order upside down will not buy
>> us anything. Two-phase link is the only way to prevent circular/invalid
>> dependencies with a static only format when symbol wrapping is involved.
>>
>
> Agree. But "libpthread_rt_la_LDFLAGS" should not include "-lpthread",
> otherwise libtool will think libpthread_rt.a depends on libpthread.
> I don't think there is such a dependency, isn't it?
Look at libpthread_rt code.
--
Gilles.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] [PATCH] blackfin: build xenomai in FLAT format
2009-02-25 10:23 ` Gilles Chanteperdrix
@ 2009-02-26 6:21 ` yi li
2009-02-26 10:20 ` Gilles Chanteperdrix
0 siblings, 1 reply; 10+ messages in thread
From: yi li @ 2009-02-26 6:21 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: Xenomai-core
On Wed, Feb 25, 2009 at 6:23 PM, Gilles Chanteperdrix
<gilles.chanteperdrix@xenomai.org> wrote:
> yi li wrote:
>> On Wed, Feb 25, 2009 at 12:30 AM, Philippe Gerum <rpm@xenomai.org> wrote:
>>>> 2. libpthread_rt.la should not depend on "lpthread".
>>>>
>>> Nak. In flat mode, turning the link dependencies order upside down will not buy
>>> us anything. Two-phase link is the only way to prevent circular/invalid
>>> dependencies with a static only format when symbol wrapping is involved.
>>>
>>
>> Agree. But "libpthread_rt_la_LDFLAGS" should not include "-lpthread",
>> otherwise libtool will think libpthread_rt.a depends on libpthread.
>> I don't think there is such a dependency, isn't it?
>
> Look at libpthread_rt code.
>
Here is the problem:
/bin/bash ../../../libtool --tag=CC --mode=link bfin-uclinux-gcc
-pipe -Wall -g -O2 -mcpu=bf527-0.1
-Wl,@/home/adam/new_workspace/local_svn/kernel/adeos/uclinux-dist/user/xenomai/xenomai-2.4.x/src/skins/posix/posix.wrappers
-D_GNU_SOURCE -D_REENTRANT -Wall -pipe -Wl,-elf2flt -mcpu=bf527-0.1
-o cyclictest cyclictest-cyclictest.o -lpthread -lrt
../../skins/posix/libpthread_rt.la
mkdir .libs
bfin-uclinux-gcc -pipe -Wall -g -O2 -mcpu=bf527-0.1
-Wl,@/home/adam/new_workspace/local_svn/kernel/adeos/uclinux-dist/user/xenomai/xenomai-2.4.x/src/skins/posix/posix.wrappers
-D_GNU_SOURCE -D_REENTRANT -Wall -pipe -Wl,-elf2flt -mcpu=bf527-0.1 -o
cyclictest cyclictest-cyclictest.o -lrt
../../skins/posix/.libs/libpthread_rt.a -lpthread
/home/adam/workspace/toolchain/4.1-1220/bfin-uclinux/bin/../bfin-uclinux/runtime/usr/lib/libpthread.a(manager.o):
In function `__pthread_manager':
libpthread/linuxthreads.old/manager.c:173: undefined reference to
`___wrap_select'
/home/adam/workspace/toolchain/4.1-1220/bfin-uclinux/bin/../bfin-uclinux/runtime/usr/lib/libpthread.a(mutex.o):
In function `__pthread_once_fork_child':
libpthread/linuxthreads.old/mutex.c:357: undefined reference to
`___wrap_pthread_cond_init'
/home/adam/workspace/toolchain/4.1-1220/bfin-uclinux/bin/../bfin-uclinux/runtime/usr/lib/libpthread.a(mutex.o):
In function `__pthread_once':
libpthread/linuxthreads.old/mutex.c:308: undefined reference to
`___wrap_pthread_cond_wait'
libpthread/linuxthreads.old/mutex.c:325: undefined reference to
`___wrap_pthread_cond_broadcast'
/home/adam/workspace/toolchain/4.1-1220/bfin-uclinux/bin/../bfin-uclinux/runtime/usr/lib/libpthread.a(mutex.o):
In function `pthread_once_cancelhandler':
libpthread/linuxthreads.old/mutex.c:281: undefined reference to
`___wrap_pthread_cond_broadcast'
collect2: ld returned 1 exit status
In my opinion, "-lpthread" does not need to be set in
"libpthread_rt_la_LDFLAGS". The application (e.g, cyclictest) decides
which libraries to link with.
-Yi
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] [PATCH] blackfin: build xenomai in FLAT format
2009-02-26 6:21 ` yi li
@ 2009-02-26 10:20 ` Gilles Chanteperdrix
2009-02-26 10:56 ` yi li
0 siblings, 1 reply; 10+ messages in thread
From: Gilles Chanteperdrix @ 2009-02-26 10:20 UTC (permalink / raw)
To: yi li; +Cc: Xenomai-core
yi li wrote:
> On Wed, Feb 25, 2009 at 6:23 PM, Gilles Chanteperdrix
> <gilles.chanteperdrix@xenomai.org> wrote:
>> yi li wrote:
>>> On Wed, Feb 25, 2009 at 12:30 AM, Philippe Gerum <rpm@xenomai.org> wrote:
>>>>> 2. libpthread_rt.la should not depend on "lpthread".
>>>>>
>>>> Nak. In flat mode, turning the link dependencies order upside down will not buy
>>>> us anything. Two-phase link is the only way to prevent circular/invalid
>>>> dependencies with a static only format when symbol wrapping is involved.
>>>>
>>> Agree. But "libpthread_rt_la_LDFLAGS" should not include "-lpthread",
>>> otherwise libtool will think libpthread_rt.a depends on libpthread.
>>> I don't think there is such a dependency, isn't it?
>> Look at libpthread_rt code.
>>
>
> Here is the problem:
>
> /bin/bash ../../../libtool --tag=CC --mode=link bfin-uclinux-gcc
> -pipe -Wall -g -O2 -mcpu=bf527-0.1
> -Wl,@/home/adam/new_workspace/local_svn/kernel/adeos/uclinux-dist/user/xenomai/xenomai-2.4.x/src/skins/posix/posix.wrappers
> -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -Wl,-elf2flt -mcpu=bf527-0.1
> -o cyclictest cyclictest-cyclictest.o -lpthread -lrt
> ../../skins/posix/libpthread_rt.la
> mkdir .libs
> bfin-uclinux-gcc -pipe -Wall -g -O2 -mcpu=bf527-0.1
> -Wl,@/home/adam/new_workspace/local_svn/kernel/adeos/uclinux-dist/user/xenomai/xenomai-2.4.x/src/skins/posix/posix.wrappers
> -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -Wl,-elf2flt -mcpu=bf527-0.1 -o
> cyclictest cyclictest-cyclictest.o -lrt
> ../../skins/posix/.libs/libpthread_rt.a -lpthread
> /home/adam/workspace/toolchain/4.1-1220/bfin-uclinux/bin/../bfin-uclinux/runtime/usr/lib/libpthread.a(manager.o):
> In function `__pthread_manager':
> libpthread/linuxthreads.old/manager.c:173: undefined reference to
> `___wrap_select'
> /home/adam/workspace/toolchain/4.1-1220/bfin-uclinux/bin/../bfin-uclinux/runtime/usr/lib/libpthread.a(mutex.o):
> In function `__pthread_once_fork_child':
> libpthread/linuxthreads.old/mutex.c:357: undefined reference to
> `___wrap_pthread_cond_init'
> /home/adam/workspace/toolchain/4.1-1220/bfin-uclinux/bin/../bfin-uclinux/runtime/usr/lib/libpthread.a(mutex.o):
> In function `__pthread_once':
> libpthread/linuxthreads.old/mutex.c:308: undefined reference to
> `___wrap_pthread_cond_wait'
> libpthread/linuxthreads.old/mutex.c:325: undefined reference to
> `___wrap_pthread_cond_broadcast'
> /home/adam/workspace/toolchain/4.1-1220/bfin-uclinux/bin/../bfin-uclinux/runtime/usr/lib/libpthread.a(mutex.o):
> In function `pthread_once_cancelhandler':
> libpthread/linuxthreads.old/mutex.c:281: undefined reference to
> `___wrap_pthread_cond_broadcast'
> collect2: ld returned 1 exit status
>
> In my opinion, "-lpthread" does not need to be set in
> "libpthread_rt_la_LDFLAGS". The application (e.g, cyclictest) decides
> which libraries to link with.
-lpthread does need to be set in libpthread_rt_la_LDFLAGS, if you look
at libpthread_rt code (which you apparently do not want to dot), you
will see that it uses libpthread functions.
The issue you have has already been discussed on this list, and we
already know the correct workaround. The correct workaround is not to
link with -lpthread first. Linking with -lpthread first leads to broken
binaries, whose libpthread functions call libpthread_rt functions. The
correct workaround is to link your binary in two stages, or to forget
about FLAT and use FDPIC.
--
Gilles.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] [PATCH] blackfin: build xenomai in FLAT format
2009-02-26 10:20 ` Gilles Chanteperdrix
@ 2009-02-26 10:56 ` yi li
2009-02-26 11:01 ` Gilles Chanteperdrix
2009-02-26 11:12 ` Philippe Gerum
0 siblings, 2 replies; 10+ messages in thread
From: yi li @ 2009-02-26 10:56 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: Xenomai-core
On Thu, Feb 26, 2009 at 6:20 PM, Gilles Chanteperdrix
<gilles.chanteperdrix@xenomai.org> wrote:
>
> -lpthread does need to be set in libpthread_rt_la_LDFLAGS, if you look
> at libpthread_rt code (which you apparently do not want to dot), you
> will see that it uses libpthread functions.
Thanks for the detailed explanation. And I did read libpthread_rt code ;).
However, my point is _not_ putting "-lpthread" before or after
"libpthread_rt.a". My point is, is it reasonable to put "-lpthread" in
the LDFLAGS of libpthread_rt.a?
>
> The issue you have has already been discussed on this list, and we
> already know the correct workaround. The correct workaround is not to
> link with -lpthread first. Linking with -lpthread first leads to broken
> binaries, whose libpthread functions call libpthread_rt functions. The
> correct workaround is to link your binary in two stages, or to forget
> about FLAT and use FDPIC.
In my option, a better workaround is to group the achieves, with
"--start-group", "--end-group":
bfin-uclinux-gcc -pipe -Wall -g -O2 -mcpu=bf527-0.1
-Wl,@/home/adam/new_workspace/local_svn/kernel/adeos/uclinux-dist/user/xenomai/xenomai-2.4.x/src/skins/posix/posix.wrappers
-D_GNU_SOURCE -D_REENTRANT -Wall -pipe -Wl,-elf2flt -mcpu=bf527-0.1 -o
cyclictest cyclictest-cyclictest.o -lrt -Wl,--start-group
../../skins/posix/.libs/libpthread_rt.a -lpthread -Wl,--end-group
-Yi
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] [PATCH] blackfin: build xenomai in FLAT format
2009-02-26 10:56 ` yi li
@ 2009-02-26 11:01 ` Gilles Chanteperdrix
2009-02-26 11:12 ` Philippe Gerum
1 sibling, 0 replies; 10+ messages in thread
From: Gilles Chanteperdrix @ 2009-02-26 11:01 UTC (permalink / raw)
To: yi li; +Cc: Xenomai-core
yi li wrote:
> On Thu, Feb 26, 2009 at 6:20 PM, Gilles Chanteperdrix
> <gilles.chanteperdrix@xenomai.org> wrote:
>> -lpthread does need to be set in libpthread_rt_la_LDFLAGS, if you look
>> at libpthread_rt code (which you apparently do not want to dot), you
>> will see that it uses libpthread functions.
>
> Thanks for the detailed explanation. And I did read libpthread_rt code ;).
> However, my point is _not_ putting "-lpthread" before or after
> "libpthread_rt.a". My point is, is it reasonable to put "-lpthread" in
> the LDFLAGS of libpthread_rt.a?
For the third time, libpthread_rt.a uses libpthread, so it is not only
reasonable, but mandatory to put -lpthread in the LDFLAGS of
libpthread_rt.a.
>
>> The issue you have has already been discussed on this list, and we
>> already know the correct workaround. The correct workaround is not to
>> link with -lpthread first. Linking with -lpthread first leads to broken
>> binaries, whose libpthread functions call libpthread_rt functions. The
>> correct workaround is to link your binary in two stages, or to forget
>> about FLAT and use FDPIC.
>
> In my option, a better workaround is to group the achieves, with
> "--start-group", "--end-group":
>
> bfin-uclinux-gcc -pipe -Wall -g -O2 -mcpu=bf527-0.1
> -Wl,@/home/adam/new_workspace/local_svn/kernel/adeos/uclinux-dist/user/xenomai/xenomai-2.4.x/src/skins/posix/posix.wrappers
> -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -Wl,-elf2flt -mcpu=bf527-0.1 -o
> cyclictest cyclictest-cyclictest.o -lrt -Wl,--start-group
> ../../skins/posix/.libs/libpthread_rt.a -lpthread -Wl,--end-group
No, for the third time, it does not work, when libpthread starts to use
libpthread_rt symbols, things are going wrong.
--
Gilles.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] [PATCH] blackfin: build xenomai in FLAT format
2009-02-26 10:56 ` yi li
2009-02-26 11:01 ` Gilles Chanteperdrix
@ 2009-02-26 11:12 ` Philippe Gerum
2009-02-27 10:02 ` yi li
1 sibling, 1 reply; 10+ messages in thread
From: Philippe Gerum @ 2009-02-26 11:12 UTC (permalink / raw)
To: yi li; +Cc: Xenomai-core
yi li wrote:
> On Thu, Feb 26, 2009 at 6:20 PM, Gilles Chanteperdrix
> <gilles.chanteperdrix@xenomai.org> wrote:
>> -lpthread does need to be set in libpthread_rt_la_LDFLAGS, if you look
>> at libpthread_rt code (which you apparently do not want to dot), you
>> will see that it uses libpthread functions.
>
> Thanks for the detailed explanation. And I did read libpthread_rt code ;).
> However, my point is _not_ putting "-lpthread" before or after
> "libpthread_rt.a". My point is, is it reasonable to put "-lpthread" in
> the LDFLAGS of libpthread_rt.a?
>
>> The issue you have has already been discussed on this list, and we
>> already know the correct workaround. The correct workaround is not to
>> link with -lpthread first. Linking with -lpthread first leads to broken
>> binaries, whose libpthread functions call libpthread_rt functions. The
>> correct workaround is to link your binary in two stages, or to forget
>> about FLAT and use FDPIC.
>
> In my option, a better workaround is to group the achieves, with
> "--start-group", "--end-group":
>
> bfin-uclinux-gcc -pipe -Wall -g -O2 -mcpu=bf527-0.1
> -Wl,@/home/adam/new_workspace/local_svn/kernel/adeos/uclinux-dist/user/xenomai/xenomai-2.4.x/src/skins/posix/posix.wrappers
> -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -Wl,-elf2flt -mcpu=bf527-0.1 -o
> cyclictest cyclictest-cyclictest.o -lrt -Wl,--start-group
> ../../skins/posix/.libs/libpthread_rt.a -lpthread -Wl,--end-group
>
Yi, the point is about our use of the --wrap linker directive for linking POSIX
apps. If we go for the start/end group scheme, then we will end up having
libpthread wrongly use our wrapped libpthread calls from libpthread_rt, which is
going to break the application badly. This is the other way around: our wrappers
may want to use libpthread.
We just cannot let the linker pick whatever symbol it sees fit to resolve the
references, it is not a dependency order issue that start/end group would indeed
solve. When using a static link format, we have to make sure to resolve the
references the applications makes to libpthread_rt first, then, and only after
that, finalize the link with libpthread, because both the application and
libpthread_rt have dependencies on libpthread.
This is why we are talking about "two-phase" link for static mode. In fact,
fixing the issue your reported would require to implement two-phase link
conditionally in our Makefiles producing POSIX binaries, to be used when FLAT
format is wanted. This is doable, but requires a bit more work than just
reordering or removing dependencies on libpthread.
> -Yi
>
--
Philippe.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Xenomai-core] [PATCH] blackfin: build xenomai in FLAT format
2009-02-26 11:12 ` Philippe Gerum
@ 2009-02-27 10:02 ` yi li
0 siblings, 0 replies; 10+ messages in thread
From: yi li @ 2009-02-27 10:02 UTC (permalink / raw)
To: rpm; +Cc: Xenomai-core
Thanks. This makes sense to me.
-Yi
On Thu, Feb 26, 2009 at 7:12 PM, Philippe Gerum <rpm@xenomai.org> wrote:
> This is why we are talking about "two-phase" link for static mode. In fact,
> fixing the issue your reported would require to implement two-phase link
> conditionally in our Makefiles producing POSIX binaries, to be used when FLAT
> format is wanted. This is doable, but requires a bit more work than just
> reordering or removing dependencies on libpthread.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-02-27 10:02 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-24 8:18 [Xenomai-core] [PATCH] blackfin: build xenomai in FLAT format yi li
2009-02-24 16:30 ` Philippe Gerum
2009-02-25 4:22 ` yi li
2009-02-25 10:23 ` Gilles Chanteperdrix
2009-02-26 6:21 ` yi li
2009-02-26 10:20 ` Gilles Chanteperdrix
2009-02-26 10:56 ` yi li
2009-02-26 11:01 ` Gilles Chanteperdrix
2009-02-26 11:12 ` Philippe Gerum
2009-02-27 10:02 ` yi li
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.