* [Xenomai-core] [PATCH]Build xenomai on Blackfin in FDPIC format
@ 2006-11-14 3:32 Li Yi (Adam)
2006-11-14 10:01 ` Gilles Chanteperdrix
2006-11-14 15:29 ` Philippe Gerum
0 siblings, 2 replies; 3+ messages in thread
From: Li Yi (Adam) @ 2006-11-14 3:32 UTC (permalink / raw)
To: xenomai-core
[-- Attachment #1.1: Type: text/plain, Size: 1386 bytes --]
Hi Philippe,
Since bfin-gcc release 2006-R1, bfin-gcc begins to support "FDPIC" format
besides "BFLT".
"FDPIC" supports shared library. Bellow patch makes it possible to build
xenomai-2.2.5 in FDPIC
format. In docs.blackfin.uclinux.org/doku.php?id=adeos there is step by step
guide.
Although it is still possible to build xenomai as BFLT in this way:
configure --host=bfin CC=bfin-uclinux-gcc LDFLAGS=-Wl,-elf2flt
--disable-shared
There will be error:
bfin-uclinux-gcc -Wl,-elf2flt -o cyclictest
-Wl,@/home/adam/workspace/xenomai/xenomai_src/xenomai-2.2.5/src/skins/posix/posix.wrappers
cyclictest-cyclictest.o ../../skins/posix/.libs/libpthread_rt.a -lpthread
-lrt
/home/adam/workspace/toolchain/1110/bfin-uclinux/bin/../lib/gcc/bfin-uclinux/4.1.1/../../../../bfin-uclinux/lib/libpthread.a(
specific.o): In function `_pthread_key_delete':
(.text+0x24e): undefined reference to `___wrap_pthread_mutex_lock'
/home/adam/workspace/toolchain/1110/bfin-uclinux/bin/../lib/gcc/bfin-uclinux/4.1.1/../../../../bfin-uclinux/lib/libpthread.a(
specific.o): In function `_pthread_key_delete':
And this can be fixed like:
bfin-uclinux-gcc -Wl,-elf2flt -o cyclictest
-Wl,@/home/adam/workspace/xenomai/xenomai_src/xenomai-2.2.5/src/skins/posix/posix.wrappers
cyclictest-cyclictest.o -lpthread -lrt
../../skins/posix/.libs/libpthread_rt.a
But using "FDPIC" format is suggested.
Thanks,
-Yi
[-- Attachment #1.2: Type: text/html, Size: 1584 bytes --]
[-- Attachment #2: xenomai_2.2.5_bfin.patch --]
[-- Type: text/x-patch, Size: 2069 bytes --]
diff -Nur xenomai-2.2.5.orig/configure xenomai-2.2.5/configure
--- xenomai-2.2.5.orig/configure 2006-11-05 23:31:46.000000000 +0800
+++ xenomai-2.2.5/configure 2006-11-14 11:15:47.000000000 +0800
@@ -21163,9 +21163,6 @@
;;
blackfin)
XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe"
- # uClinux wants flat format executables; assume that our
- # source format is ELF.
- XENO_USER_LDFLAGS="-Wl,-elf2flt"
;;
arm)
XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe"
diff -Nur xenomai-2.2.5.orig/configure.in xenomai-2.2.5/configure.in
--- xenomai-2.2.5.orig/configure.in 2006-09-24 22:50:10.000000000 +0800
+++ xenomai-2.2.5/configure.in 2006-11-14 11:15:20.000000000 +0800
@@ -536,9 +536,6 @@
;;
blackfin)
XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe"
- # uClinux wants flat format executables; assume that our
- # source format is ELF.
- XENO_USER_LDFLAGS="-Wl,-elf2flt"
;;
arm)
XENO_USER_CFLAGS="$XENO_USER_CFLAGS -Wall -pipe"
diff -Nur xenomai-2.2.5.orig/README.INSTALL xenomai-2.2.5/README.INSTALL
--- xenomai-2.2.5.orig/README.INSTALL 2006-07-18 21:19:17.000000000 +0800
+++ xenomai-2.2.5/README.INSTALL 2006-11-14 11:13:06.000000000 +0800
@@ -270,12 +270,9 @@
$ make ARCH=bfinnommu CROSS_COMPILE=bfin-uclinux- xconfig/gconfig/menuconfig # select the kernel and Xenomai options
$ make ARCH=bfinnommu CROSS_COMPILE=bfin-uclinux- bzImage modules # then install as needed
$ mkdir $build_root && cd $build_root
-$ $xenomai_root/configure --build=i686-pc-linux-gnu --host=bfinnommu-unknown-linux-gnu CC=bfin-uclinux-gcc CXX=bfin-uclinux-gcc AR=bfin-uclinux-ar LD=bfin-uclinux-ld --disable-shared
+$ $xenomai_root/configure --host=bfin CC=bfin-uclinux-gcc CFLAGS=-mfdpic
$ make install
-CAUTION: note the --disabled-shared flag configuring out the shared
-library support, which is unavailable for this architecture.
-
You may also want to have a look at this hands-on description about
configuring and building a Xenomai system for the Blackfin
architecture: http://docs.blackfin.uclinux.org/doku.php?id=adeos
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Xenomai-core] [PATCH]Build xenomai on Blackfin in FDPIC format
2006-11-14 3:32 [Xenomai-core] [PATCH]Build xenomai on Blackfin in FDPIC format Li Yi (Adam)
@ 2006-11-14 10:01 ` Gilles Chanteperdrix
2006-11-14 15:29 ` Philippe Gerum
1 sibling, 0 replies; 3+ messages in thread
From: Gilles Chanteperdrix @ 2006-11-14 10:01 UTC (permalink / raw)
To: Li Yi (Adam); +Cc: xenomai-core
Li Yi (Adam) wrote:
> Hi Philippe,
>
> Since bfin-gcc release 2006-R1, bfin-gcc begins to support "FDPIC"
> format besides "BFLT".
> "FDPIC" supports shared library. Bellow patch makes it possible to build
> xenomai-2.2.5 in FDPIC
> format. In docs.blackfin.uclinux.org/doku.php?id=adeos
> <http://docs.blackfin.uclinux.org/doku.php?id=adeos> there is step by
> step guide.
>
> Although it is still possible to build xenomai as BFLT in this way:
>
> configure --host=bfin CC=bfin-uclinux-gcc LDFLAGS=-Wl,-elf2flt
> --disable-shared
>
> There will be error:
>
> bfin-uclinux-gcc -Wl,-elf2flt -o cyclictest
> -Wl,@/home/adam/workspace/xenomai/xenomai_src/xenomai-
> 2.2.5/src/skins/posix/posix.wrappers cyclictest-cyclictest.o
> ../../skins/posix/.libs/libpthread_rt.a -lpthread -lrt
> /home/adam/workspace/toolchain/1110/bfin-uclinux/bin/../lib/gcc/bfin-uclinux/4.1.1/../../../../bfin-uclinux/lib/libpthread.a(
> specific.o): In function `_pthread_key_delete':
> (.text+0x24e): undefined reference to `___wrap_pthread_mutex_lock'
> /home/adam/workspace/toolchain/1110/bfin-uclinux/bin/../lib/gcc/bfin-uclinux/4.1.1/../../../../bfin-uclinux/lib/libpthread.a(
> specific.o): In function `_pthread_key_delete':
>
> And this can be fixed like:
>
> bfin-uclinux-gcc -Wl,-elf2flt -o cyclictest
> -Wl,@/home/adam/workspace/xenomai/xenomai_src/xenomai-2.2.5/src/skins/posix/posix.wrappers
> cyclictest-cyclictest.o -lpthread -lrt
> ../../skins/posix/.libs/libpthread_rt.a
This fix is incorrect. The correct way of linking is to do it in two steps:
bfin-uclinux-ld -r -o cyclictest.part
@/home/adam/workspace/xenomai/xenomai_src/xenomai-2.2.5/src/skins/posix/posix.wrappers
cyclictest-cyclictest.o ../../skins/posix/.libs/libpthread_rt.a
bfin-uclinux-gcc -Wl,-elf2flt -o cyclictest cyclictest.part -lpthread -lrt
--
Gilles Chanteperdrix
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Xenomai-core] [PATCH]Build xenomai on Blackfin in FDPIC format
2006-11-14 3:32 [Xenomai-core] [PATCH]Build xenomai on Blackfin in FDPIC format Li Yi (Adam)
2006-11-14 10:01 ` Gilles Chanteperdrix
@ 2006-11-14 15:29 ` Philippe Gerum
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Gerum @ 2006-11-14 15:29 UTC (permalink / raw)
To: Li Yi (Adam); +Cc: xenomai-core
On Tue, 2006-11-14 at 11:32 +0800, Li Yi (Adam) wrote:
> Hi Philippe,
>
> Since bfin-gcc release 2006-R1, bfin-gcc begins to support "FDPIC"
> format besides "BFLT".
> "FDPIC" supports shared library. Bellow patch makes it possible to
> build xenomai-2.2.5 in FDPIC
> format. In docs.blackfin.uclinux.org/doku.php?id=adeos there is step
> by step guide.
>
> Although it is still possible to build xenomai as BFLT in this way:
>
> configure --host=bfin CC=bfin-uclinux-gcc LDFLAGS=-Wl,-elf2flt
> --disable-shared
>
> There will be error:
>
> bfin-uclinux-gcc -Wl,-elf2flt -o cyclictest
> -Wl,@/home/adam/workspace/xenomai/xenomai_src/xenomai-
> 2.2.5/src/skins/posix/posix.wrappers
> cyclictest-cyclictest.o ../../skins/posix/.libs/libpthread_rt.a
> -lpthread -lrt
> /home/adam/workspace/toolchain/1110/bfin-uclinux/bin/../lib/gcc/bfin-uclinux/4.1.1/../../../../bfin-uclinux/lib/libpthread.a( specific.o): In function `_pthread_key_delete':
> (.text+0x24e): undefined reference to `___wrap_pthread_mutex_lock'
> /home/adam/workspace/toolchain/1110/bfin-uclinux/bin/../lib/gcc/bfin-uclinux/4.1.1/../../../../bfin-uclinux/lib/libpthread.a( specific.o): In function `_pthread_key_delete':
>
> And this can be fixed like:
>
> bfin-uclinux-gcc -Wl,-elf2flt -o cyclictest
> -Wl,@/home/adam/workspace/xenomai/xenomai_src/xenomai-2.2.5/src/skins/posix/posix.wrappers cyclictest-cyclictest.o -lpthread -lrt ../../skins/posix/.libs/libpthread_rt.a
>
As Gilles pointed out, we probably need a two steps link process here;
fiddling with the object ordering won't solve the library
inter-dependencies properly.
> But using "FDPIC" format is suggested.
>
We'll move to FDPIC. No need to stick with a limitation on shared
objects, which additionally requires a two step building process for
working around chicken-and-eggs linking issues.
> Thanks,
>
> -Yi
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
--
Philippe.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-11-14 15:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-14 3:32 [Xenomai-core] [PATCH]Build xenomai on Blackfin in FDPIC format Li Yi (Adam)
2006-11-14 10:01 ` Gilles Chanteperdrix
2006-11-14 15:29 ` Philippe Gerum
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.