Skip to contentSkip to conversation

Using xeno-config in cross compiling

Xenomai-help jeff angielski 3 participants 7 messages Apr 18, 2009 – Apr 21, 2009

lore
Share & tools
lore
#0 lore raw

I am unable to cross compile to any POSIX skin applications, including the example, because the xeno-config is return that POSIX is not supported. However, when I run xeno-config on the target itself, it returns the necessary posix-cflags and posix-ldflags.

Running it on my powerpc target:
-bash-3.2# /usr/xenomai/bin/xeno-config --posix-cflags --posix-ldflags
-I/usr/xenomai/include -I/usr/xenomai/include/posix -D_GNU_SOURCE -D_REENTRANT -D__XENO__
-Wl,@/usr/xenomai/lib/posix.wrappers -L/usr/xenomai/lib -lpthread_rt -lpthread -lrt

Running it on my i686 build host:

[email protected]:~$ /srv/nfs/srp-xen/usr/xenomai/bin/xeno-config
--posix-cflags --posix-ldflags
-I/usr/xenomai/include -I/usr/xenomai/include/posix -D_GNU_SOURCE
-D_REENTRANT -D__XENO__
POSIX support is not available

What is the proper way to cross compiler a POSIX skin application in a cross compiler development setup?

Gory details:
xen: xenomai-2.4.7
kernel: linux 2.6.28.5
arch: powerpc (MPC8544)
cc: ppc_85xxDP (from ELDK)

Signature · 3 lines
Jeff Angielski
The PTR Group
www.theptrgroup.com
#1 lore raw
Quoted 20 lines · jeff angielski

I am unable to cross compile to any POSIX skin applications, including the example, because the xeno-config is return that POSIX is not supported. However, when I run xeno-config on the target itself, it returns the necessary posix-cflags and posix-ldflags.

Running it on my powerpc target:
-bash-3.2# /usr/xenomai/bin/xeno-config --posix-cflags --posix-ldflags

(quoted diff) +0 -4
-I/usr/xenomai/include -I/usr/xenomai/include/posix -D_GNU_SOURCE
-D_REENTRANT -D__XENO__
-Wl,@/usr/xenomai/lib/posix.wrappers -L/usr/xenomai/lib -lpthread_rt
-lpthread -lrt

Running it on my i686 build host:

[email protected]:~$ /srv/nfs/srp-xen/usr/xenomai/bin/xeno-config
--posix-cflags --posix-ldflags
(quoted diff) +0 -2
-I/usr/xenomai/include -I/usr/xenomai/include/posix -D_GNU_SOURCE
-D_REENTRANT -D__XENO__

POSIX support is not available

Quoted 3 lines

What is the proper way to cross compiler a POSIX skin application in a cross compiler development setup?

The way you did it is probably ok; but you may want to tell xeno-config where to find the staging directory via the DESTDIR variable, so it can locate all the host files it needs locally (e.g. posix.wrappers).

i.e.

DESTDIR=/srv/nfs/srp-xen /srv/nfs/srp-xen/usr/xenomai/bin/xeno-config --posix-cflags ...

Quoted 9 lines

Gory details:
xen: xenomai-2.4.7
kernel: linux 2.6.28.5
arch: powerpc (MPC8544)
cc: ppc_85xxDP (from ELDK)

Signature · 1 line
Philippe.
#2 lore raw
Quoted 6 lines · Philippe Gerum
Quoted 4 lines · jeff angielski

What is the proper way to cross compiler a POSIX skin application in a cross compiler development setup?

Quoted 8 lines

The way you did it is probably ok; but you may want to tell xeno-config where to find the staging directory via the DESTDIR variable, so it can locate all the host files it needs locally (e.g. posix.wrappers).

i.e.

DESTDIR=/srv/nfs/srp-xen /srv/nfs/srp-xen/usr/xenomai/bin/xeno-config --posix-cflags ...

This compiles but won't run as-is on the target because it complains it's missing the pthread_rt library.

# ./readirq-posix
./readirq-posix: error while loading shared libraries:
libpthread_rt.so.1: cannot open shared object file: No such file or
directory
# ldd ./readirq-posix
        linux-vdso32.so.1 =>  (0x00100000)
        libpthread_rt.so.1 => not found
        libpthread.so.0 => /lib/libpthread.so.0 (0x0ff98000)
        librt.so.1 => /lib/librt.so.1 (0x0ff40000)
        libc.so.6 => /lib/libc.so.6 (0x0fda1000)
        /lib/ld.so.1 (0x48000000)

I used LD_LIBRARY_PATH to get it to work but it seems like I must be missing a step somewhere in the process.

# LD_LIBRARY_PATH=/usr/xenomai/lib ./readirq-posix

Do other people cross compiling for POSIX skins have to do this?

TIA,
Jeff

Signature · 3 lines
Jeff Angielski
The PTR Group
www.theptrgroup.com
#3 lore raw
Quoted 31 lines · jeff angielski
Quoted 4 lines · Philippe Gerum
Quoted 3 lines · jeff angielski

What is the proper way to cross compiler a POSIX skin application in a cross compiler development setup?

Quoted 8 lines

The way you did it is probably ok; but you may want to tell xeno-config where to find the staging directory via the DESTDIR variable, so it can locate all the host files it needs locally (e.g. posix.wrappers).

i.e.

DESTDIR=/srv/nfs/srp-xen /srv/nfs/srp-xen/usr/xenomai/bin/xeno-config --posix-cflags ...

This compiles but won't run as-is on the target because it complains it's missing the pthread_rt library.

# ./readirq-posix
./readirq-posix: error while loading shared libraries:
libpthread_rt.so.1: cannot open shared object file: No such file or
directory
# ldd ./readirq-posix
        linux-vdso32.so.1 =>  (0x00100000)
        libpthread_rt.so.1 => not found
        libpthread.so.0 => /lib/libpthread.so.0 (0x0ff98000)
        librt.so.1 => /lib/librt.so.1 (0x0ff40000)
        libc.so.6 => /lib/libc.so.6 (0x0fda1000)
        /lib/ld.so.1 (0x48000000)
Quoted 7 lines

I used LD_LIBRARY_PATH to get it to work but it seems like I must be missing a step somewhere in the process.

# LD_LIBRARY_PATH=/usr/xenomai/lib ./readirq-posix

Do other people cross compiling for POSIX skins have to do this?

You get this issue when trying to use custom shared libraries, it is not related to Xenomai at all. There are several solutions to solve this issue, and a lot of documentation on internet.

Signature · 1 line
					    Gilles.
#4 lore raw
In reply to jeff angielski
Quoted 33 lines · jeff angielski
Quoted 6 lines · Philippe Gerum
Quoted 4 lines · jeff angielski

What is the proper way to cross compiler a POSIX skin application in a cross compiler development setup?

Quoted 8 lines

The way you did it is probably ok; but you may want to tell xeno-config where to find the staging directory via the DESTDIR variable, so it can locate all the host files it needs locally (e.g. posix.wrappers).

i.e.

DESTDIR=/srv/nfs/srp-xen /srv/nfs/srp-xen/usr/xenomai/bin/xeno-config --posix-cflags ...

This compiles but won't run as-is on the target because it complains it's missing the pthread_rt library.

# ./readirq-posix
./readirq-posix: error while loading shared libraries:
libpthread_rt.so.1: cannot open shared object file: No such file or
directory
# ldd ./readirq-posix
        linux-vdso32.so.1 =>  (0x00100000)
        libpthread_rt.so.1 => not found
        libpthread.so.0 => /lib/libpthread.so.0 (0x0ff98000)
        librt.so.1 => /lib/librt.so.1 (0x0ff40000)
        libc.so.6 => /lib/libc.so.6 (0x0fda1000)
        /lib/ld.so.1 (0x48000000)
Quoted 8 lines

I used LD_LIBRARY_PATH to get it to work but it seems like I must be missing a step somewhere in the process.

# LD_LIBRARY_PATH=/usr/xenomai/lib ./readirq-posix

Do other people cross compiling for POSIX skins have to do this?

You need to set up your dynamic linker config properly on the target; see ldconfig related files, and particularly ld.so.conf (or ld.so.conf.d with newer ld.so versions).

Quoted 3 lines

TIA,
Jeff

Signature · 1 line
Philippe.
#5 lore raw
Quoted 40 lines · Philippe Gerum
Quoted 39 lines · jeff angielski
Quoted 6 lines · Philippe Gerum
Quoted 4 lines · jeff angielski

What is the proper way to cross compiler a POSIX skin application in a cross compiler development setup?

Quoted 8 lines

The way you did it is probably ok; but you may want to tell xeno-config where to find the staging directory via the DESTDIR variable, so it can locate all the host files it needs locally (e.g. posix.wrappers).

i.e.

DESTDIR=/srv/nfs/srp-xen /srv/nfs/srp-xen/usr/xenomai/bin/xeno-config --posix-cflags ...

This compiles but won't run as-is on the target because it complains it's missing the pthread_rt library.

# ./readirq-posix
./readirq-posix: error while loading shared libraries:
libpthread_rt.so.1: cannot open shared object file: No such file or
directory
# ldd ./readirq-posix
        linux-vdso32.so.1 =>  (0x00100000)
        libpthread_rt.so.1 => not found
        libpthread.so.0 => /lib/libpthread.so.0 (0x0ff98000)
        librt.so.1 => /lib/librt.so.1 (0x0ff40000)
        libc.so.6 => /lib/libc.so.6 (0x0fda1000)
        /lib/ld.so.1 (0x48000000)

I used LD_LIBRARY_PATH to get it to work but it seems like I must be missing a step somewhere in the process.

# LD_LIBRARY_PATH=/usr/xenomai/lib ./readirq-posix

Quoted 6 lines
Quoted 2 lines

Do other people cross compiling for POSIX skins have to do this?

You need to set up your dynamic linker config properly on the target; see ldconfig related files, and particularly ld.so.conf (or ld.so.conf.d with newer ld.so versions).

Sounds reasonable. However, I do not have to play with the dynamic libraries when I run the cyclictest application which also uses the POSIX skins.

The difference, of course, is that my application uses the examples/posix Makefile [xeno-config] while cyclictest uses the automake generated Makefile in the src/testsuite/cyclic.

Perhaps even with using DESTDIR before make there is still something not being setup correctly.

Signature · 3 lines
Jeff Angielski
The PTR Group
www.theptrgroup.com
#6 lore raw
Quoted 48 lines · jeff angielski
Quoted 34 lines · Philippe Gerum
Quoted 33 lines · jeff angielski
Quoted 4 lines · Philippe Gerum
Quoted 3 lines · jeff angielski

What is the proper way to cross compiler a POSIX skin application in a cross compiler development setup?

Quoted 8 lines

The way you did it is probably ok; but you may want to tell xeno-config where to find the staging directory via the DESTDIR variable, so it can locate all the host files it needs locally (e.g. posix.wrappers).

i.e.

DESTDIR=/srv/nfs/srp-xen /srv/nfs/srp-xen/usr/xenomai/bin/xeno-config --posix-cflags ...

This compiles but won't run as-is on the target because it complains it's missing the pthread_rt library.

# ./readirq-posix
./readirq-posix: error while loading shared libraries:
libpthread_rt.so.1: cannot open shared object file: No such file or
directory
# ldd ./readirq-posix
        linux-vdso32.so.1 =>  (0x00100000)
        libpthread_rt.so.1 => not found
        libpthread.so.0 => /lib/libpthread.so.0 (0x0ff98000)
        librt.so.1 => /lib/librt.so.1 (0x0ff40000)
        libc.so.6 => /lib/libc.so.6 (0x0fda1000)
        /lib/ld.so.1 (0x48000000)

I used LD_LIBRARY_PATH to get it to work but it seems like I must be missing a step somewhere in the process.

Quoted 8 lines
Quoted 5 lines

# LD_LIBRARY_PATH=/usr/xenomai/lib ./readirq-posix

Do other people cross compiling for POSIX skins have to do this?

You need to set up your dynamic linker config properly on the target; see ldconfig related files, and particularly ld.so.conf (or ld.so.conf.d with newer ld.so versions).

Sounds reasonable. However, I do not have to play with the dynamic libraries when I run the cyclictest application which also uses the POSIX skins.

Quoted 7 lines

The difference, of course, is that my application uses the examples/posix Makefile [xeno-config] while cyclictest uses the automake generated Makefile in the src/testsuite/cyclic.

Perhaps even with using DESTDIR before make there is still something not being setup correctly.

See:
http://www.linux.org/docs/ldp/howto/Program-Library-HOWTO/shared-libraries.html

Signature · 1 line
                                                 Gilles.