Skip to contentSkip to conversation

build xenomai userspace app, illegal instruction

Xenomai-help Koenig, Florian 3 participants 14 messages May 13, 2011 – May 17, 2011 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,
i have a powerpc 405GP without FPU and want to build a xenomai application. I installed and setup eldk-4.2 for ppc_4xx, to have a cross toolchain on my x86 computer. After that, i patched the linux-2.6.36 kernel with

scripts/prepare-kernel.sh --linux=/usr/src/linux-2.6.36/ --adeos=ksrc/arch/powerpc/patches/adeos-ipipe-2.6.36-powerpc-2.12-03.patch

Then i configured and build the kernel. I tested the kernel on the cpu, and it runs well.
Now i switched into the xenomai directory and to build the user-space support, i called:

./configure --host=ppc-linux CFLAGS="-msoft-float" LDFLAGS="-msoft-float" ;make;make install

This builds without any errors. Now i simply try to build the hello_world example from http://www.cs.ru.nl/lab/xenomai/exercises/ex01/Exercise-1.html
with:

powerpc-linux-gcc -msoft-float -L/usr/xenomai/lib -lnative -lxenomai -lpthread_rt -lrtdk -I/usr/xenomai/include -o test test.c

The build of the test app is without any errors, but when i run it on the 405GP cpu (which has no FPU) it returns: ILLEGAL INSTRUCTION. If i look at /proc/xenomai/faults there are only zero´s.

I know i need soft-float for this cpu, but i think a got everything correctly setup/build, or?

After reading and doing, i found in the xenomai directory a file called scripts/defconfig.frag, where the last line is:

CONFIG_XENO_HW_FPU=y

Now i dont know, what the file defconfig.frag is for, and why is there hardware fpu set to yes?

Thanks for help

florian

----------------------------------------------------------------------------------------------------------------------------
Omicron NanoTechnology GmbH
Limburger Str. 75
65232 Taunusstein, GERMANY
Registration: HRB Nr.: 16116, Amtsgericht Wiesbaden, VAT no. DE111361420
Geschäftsführer / Managing Director: Norbert Nold www.omicron.de

#1 lore raw
Quoted 8 lines · Florian

Hi,
i have a powerpc 405GP without FPU and want to build a xenomai application. I installed and setup eldk-4.2 for ppc_4xx, to have a cross toolchain on my x86 computer. After that, i patched the linux-2.6.36 kernel with

scripts/prepare-kernel.sh --linux=/usr/src/linux-2.6.36/ --adeos=ksrc/arch/powerpc/patches/adeos-ipipe-2.6.36-powerpc-2.12-03.patch

Quoted 7 lines

Then i configured and build the kernel. I tested the kernel on the cpu, and it runs well.
Now i switched into the xenomai directory and to build the user-space support, i called:

./configure --host=ppc-linux CFLAGS="-msoft-float" LDFLAGS="-msoft-float" ;make;make install

Please just use:

 $ ./configure --host=powerpc-linux --prefix=/usr/xenomai-2.5

The toolchain knows that it has to use -msoft-float. Next you need to build and *install* the user-space libs, tools, etc.:

  $ make
  $ export DESTDIR=/opt/eldk-4.2/ppc_4xx
  $ make install
Quoted 6 lines

This builds without any errors. Now i simply try to build the hello_world example from http://www.cs.ru.nl/lab/xenomai/exercises/ex01/Exercise-1.html
with:

powerpc-linux-gcc -msoft-float -L/usr/xenomai/lib -lnative -lxenomai -lpthread_rt -lrtdk -I/usr/xenomai/include -o test test.c

Then you should be able to compile that program with

  $ ${CROSS_COMPILE}gcc -o test test.c
`$DESTDIR//usr/xenomai-2.5/bin/xeno-config --skin native --cflags
--ldflags` -lrtdk

Can't tell if that example is OK, though. The one coming with the Xenomai tree in "examples" are known to work.

Quoted 6 lines

The build of the test app is without any errors, but when i run it on the 405GP cpu (which has no FPU) it returns: ILLEGAL INSTRUCTION. If i look at /proc/xenomai/faults there are only zero´s.

I know i need soft-float for this cpu, but i think a got everything correctly setup/build, or?

See above.

Quoted 7 lines

After reading and doing, i found in the xenomai directory a file called scripts/defconfig.frag, where the last line is:

CONFIG_XENO_HW_FPU=y

Now i dont know, what the file defconfig.frag is for, and why is there hardware fpu set to yes?

I think you can switch that option off.

Wolfgang.

#2 lore raw

Hi,

i installed eldk into /opt/eldk-4.2, then i installed (make install) xenomai user-space into /opt/eldk-4.2/ppc_4xx .

Now when i try to build the xenomai examples with

$ make XENO=/opt/eldk-4.2/usr/xenomai-2.5.6/bin

It uses /lib/modules/2.6.32-5-686 from the local kernel, so i used

$ make XENO=/opt/eldk-4.2/usr/xenomai-2.5.6/bin KSRC=/usr/src/linux-2.6.36

But then it returns:
make[1]: Entering directory `/usr/src/xenomai-2.5.6/examples/native' powerpc-linux-gcc -I/usr/xenomai-2.5.6/include -D_GNU_SOURCE -D_REENTRANT
-Wall -pipe -D__XENO__ -L/usr/xenomai-2.5.6/lib -lxenomai -lpthread
-lnative -Xlinker -rpath -Xlinker /usr/xenomai-2.5.6/lib trivial-periodic.c -o trivial-periodic
trivial-periodic.c: In function 'main':
trivial-periodic.c:72: warning: control reaches end of non-void function

When i now use trivial-periodic on the 405GP cpu, it also returns: illegal instruction

When i try to build the hello_world app with your command it returns:

powerpc-linux-gcc -o test test.c 'XENO=/opt/eldk-4.2/ppc_4xx/usr/xenomai-2.5.6/bin/xeno-config --skin native --cflags --ldflags' -lrtdk
powerpc-linux-gcc:
XENO=/opt/eldk-4.2/ppc_4xx/usr/xenomai-2.5.6/bin/xeno-config --skin native --cflags --ldflags: No such file or directory

Why is xenomai using local /lib/modules/2.6.32-5-686 directory ? what do i wrong with xenomai userspace part ?

Thanks for help
Florian

Quoted 6 lines

This builds without any errors. Now i simply try to build the hello_world example from http://www.cs.ru.nl/lab/xenomai/exercises/ex01/Exercise-1.html
with:

powerpc-linux-gcc -msoft-float -L/usr/xenomai/lib -lnative -lxenomai -lpthread_rt -lrtdk -I/usr/xenomai/include -o test test.c

Then you should be able to compile that program with

  $ ${CROSS_COMPILE}gcc -o test test.c
`$DESTDIR//usr/xenomai-2.5/bin/xeno-config --skin native --cflags
--ldflags` -lrtdk

Can't tell if that example is OK, though. The one coming with the Xenomai tree in "examples" are known to work.

Quoted 5 lines

The build of the test app is without any errors, but when i run it on the 405GP cpu (which has no FPU) it returns: ILLEGAL INSTRUCTION. If i look at /proc/xenomai/faults there are only zero´s.

I know i need soft-float for this cpu, but i think a got everything

correctly

Quoted 1 line

setup/build, or?

See above.

Quoted 7 lines

After reading and doing, i found in the xenomai directory a file called scripts/defconfig.frag, where the last line is:

CONFIG_XENO_HW_FPU=y

Now i dont know, what the file defconfig.frag is for, and why is there hardware fpu set to yes?

I think you can switch that option off.

Wolfgang.

----------------------------------------------------------------------------------------------------------------------------
Omicron NanoTechnology GmbH
Limburger Str. 75
65232 Taunusstein, GERMANY
Registration: HRB Nr.: 16116, Amtsgericht Wiesbaden, VAT no. DE111361420
Geschäftsführer / Managing Director: Norbert Nold www.omicron.de

#3 lore raw
Quoted 5 lines · Florian

Hi,

i installed eldk into /opt/eldk-4.2, then i installed (make install) xenomai user-space into /opt/eldk-4.2/ppc_4xx .

Quoted 7 lines

Now when i try to build the xenomai examples with

$ make XENO=/opt/eldk-4.2/usr/xenomai-2.5.6/bin

It uses /lib/modules/2.6.32-5-686 from the local kernel, so i used

$ make XENO=/opt/eldk-4.2/usr/xenomai-2.5.6/bin KSRC=/usr/src/linux-2.6.36

For building kernel space modules you need to specifiy KSRC as well, but not for user space apps.

Quoted 8 lines

But then it returns:
make[1]: Entering directory `/usr/src/xenomai-2.5.6/examples/native' powerpc-linux-gcc -I/usr/xenomai-2.5.6/include -D_GNU_SOURCE -D_REENTRANT

(quoted diff) +0 -3
-Wall -pipe -D__XENO__   -L/usr/xenomai-2.5.6/lib -lxenomai -lpthread
-lnative -Xlinker -rpath -Xlinker /usr/xenomai-2.5.6/lib  trivial-periodic.c
-o trivial-periodic

trivial-periodic.c: In function 'main':
trivial-periodic.c:72: warning: control reaches end of non-void function

I think you didn't specify DESTDIR? Or did you install xenomai-2.5.6 into /usr ? Normally you do:

  cd xenomai-2.5.6
  ./configure --host=powerpc-linux --prefix=/usr/xenomai
  make
  export DESTDIR=/opt/eldk/ppc_4xx
  make install

You also need the DESTDIR for building your apps.

Quoted 12 lines

When i now use trivial-periodic on the 405GP cpu, it also returns: illegal instruction

When i try to build the hello_world app with your command it returns:

powerpc-linux-gcc -o test test.c 'XENO=/opt/eldk-4.2/ppc_4xx/usr/xenomai-2.5.6/bin/xeno-config --skin native --cflags --ldflags' -lrtdk
powerpc-linux-gcc:
XENO=/opt/eldk-4.2/ppc_4xx/usr/xenomai-2.5.6/bin/xeno-config --skin native --cflags --ldflags: No such file or directory

Quoted 2 lines

Why is xenomai using local /lib/modules/2.6.32-5-686 directory ? what do i wrong with xenomai userspace part ?

See above? Hope it helps.

Wolfgang.

#4 lore raw
Quoted 49 lines · Wolfgang Grandegger
Quoted 5 lines · Florian

Hi,

i installed eldk into /opt/eldk-4.2, then i installed (make install) xenomai user-space into /opt/eldk-4.2/ppc_4xx .

Quoted 7 lines

Now when i try to build the xenomai examples with

$ make XENO=/opt/eldk-4.2/usr/xenomai-2.5.6/bin

It uses /lib/modules/2.6.32-5-686 from the local kernel, so i used

$ make XENO=/opt/eldk-4.2/usr/xenomai-2.5.6/bin KSRC=/usr/src/linux-2.6.36

For building kernel space modules you need to specifiy KSRC as well, but not for user space apps.

Quoted 8 lines

But then it returns:
make[1]: Entering directory `/usr/src/xenomai-2.5.6/examples/native' powerpc-linux-gcc -I/usr/xenomai-2.5.6/include -D_GNU_SOURCE -D_REENTRANT

(quoted diff) +0 -3
-Wall -pipe -D__XENO__   -L/usr/xenomai-2.5.6/lib -lxenomai -lpthread
-lnative -Xlinker -rpath -Xlinker /usr/xenomai-2.5.6/lib  trivial-periodic.c
-o trivial-periodic

trivial-periodic.c: In function 'main':
trivial-periodic.c:72: warning: control reaches end of non-void function

I think you didn't specify DESTDIR? Or did you install xenomai-2.5.6 into /usr ? Normally you do:

  cd xenomai-2.5.6
  ./configure --host=powerpc-linux --prefix=/usr/xenomai
  make
  export DESTDIR=/opt/eldk/ppc_4xx
  make install

You also need the DESTDIR for building your apps.

Quoted 12 lines

When i now use trivial-periodic on the 405GP cpu, it also returns: illegal instruction

When i try to build the hello_world app with your command it returns:

powerpc-linux-gcc -o test test.c 'XENO=/opt/eldk-4.2/ppc_4xx/usr/xenomai-2.5.6/bin/xeno-config --skin native --cflags --ldflags' -lrtdk
powerpc-linux-gcc:
XENO=/opt/eldk-4.2/ppc_4xx/usr/xenomai-2.5.6/bin/xeno-config --skin native --cflags --ldflags: No such file or directory

Quoted 4 lines
Quoted 2 lines

Why is xenomai using local /lib/modules/2.6.32-5-686 directory ? what do i wrong with xenomai userspace part ?

See above? Hope it helps.

Just to be sure. The installed Xenomai programs from the test suite like "latency" or "cyclictest" do work fine, right?

Wolfgang.

#5 lore raw

Hi,
i started from new and have done the following:

i deleted /opt/eldk-4.2 and installed it new with:

$ ./install -d /opt/eldk-4.2 ppc_4xx

Then i setup env-vars and goto /usr/src/xenomai-2.5.6:

$ export ARCH=powerpc
$ export DESTDIR=/opt/eldk-4.2/ppc_4xx
$ export PATH=$PATH:/opt/eldk-4.2/usr/bin:/opt/eldk-4.2/bin

Then i configured xenomai userspace with:

$ ./configure --host=powerpc-linux      (without --prefix=)
$ make
$ make install

Then i goto /usr/src/xenomai/examples and run:

$ make XENO=/opt/eldk-4.2/ppc_4xx/usr/xenomai/bin

And then it returns, where it searches for includes in -I/lib/modules/2.6.32-5-686/build/include/xenomai/posix Which is my local x86 kernel, not the powerpc kernel?

make XENO=/opt/eldk-4.2/ppc_4xx/usr/xenomai/
--xeno-cflags is deprecated, use --skin=name --cflags instead --xeno-ldflags is deprecated, use --skin=name --ldflags instead
make[1]: Entering directory `/usr/src/xenomai-2.5.6/examples/rtdm/driver-api' powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE
-D_REENTRANT -Wall -pipe -D__XENO__ -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib
-lxenomai -lpthread -lnative -lrtdm -Xlinker -rpath -Xlinker
/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib tut01-skeleton-app.c -o
tut01-skeleton-app
tut01-skeleton-app.c:54: warning: second argument of 'main' should be 'char **'
--xeno-cflags is deprecated, use --skin=name --cflags instead --xeno-ldflags is deprecated, use --skin=name --ldflags instead powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE
-D_REENTRANT -Wall -pipe -D__XENO__ -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib
-lxenomai -lpthread -lnative -lrtdm -Xlinker -rpath -Xlinker
/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib tut02-skeleton-app.c -o
tut02-skeleton-app
make -C /lib/modules/2.6.32-5-686/build SUBDIRS=/usr/src/xenomai-2.5.6/examples/rtdm/driver-api modules
make: Entering an unknown directory
make: *** /lib/modules/2.6.32-5-686/build: Datei oder Verzeichnis nicht gefunden. Schluss.
make: Leaving an unknown directory
make[1]: *** [all] Fehler 2
make[1]: Leaving directory `/usr/src/xenomai-2.5.6/examples/rtdm/driver-api' --xeno-cflags is deprecated, use --skin=name --cflags instead --xeno-ldflags is deprecated, use --skin=name --ldflags instead
make[1]: Entering directory `/usr/src/xenomai-2.5.6/examples/rtdm/profiles/serial' powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE
-D_REENTRANT -Wall -pipe -D__XENO__ -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib
-lxenomai -lpthread -lnative -lrtdm -Xlinker -rpath -Xlinker
/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib cross-link.c -o cross-link
make[1]: Leaving directory `/usr/src/xenomai-2.5.6/examples/rtdm/profiles/serial' --posix-cflags is deprecated, use --skin=posix --cflags instead --posix-ldflags is deprecated, use --skin=posix --ldflags instead make[1]: Entering directory `/usr/src/xenomai-2.5.6/examples/rtdm/profiles/can' powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include/posix -Wl,@/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib/posix.wrappers -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt -lrtdm -Xlinker -rpath -Xlinker /opt/eldk-4.2/ppc_4xx/usr/xenomai/lib
rtcan_rtt.c -o rtcan_rtt
make[1]: Leaving directory `/usr/src/xenomai-2.5.6/examples/rtdm/profiles/can' --posix-cflags is deprecated, use --skin=posix --cflags instead --posix-ldflags is deprecated, use --skin=posix --ldflags instead make[1]: Entering directory `/usr/src/xenomai-2.5.6/examples/rtdm/profiles/ipc' powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include/posix -Wl,@/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib/posix.wrappers -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt -lrtdm -lrtdk -Xlinker -rpath -Xlinker /opt/eldk-4.2/ppc_4xx/usr/xenomai/lib
xddp-echo.c -o xddp-echo
--posix-cflags is deprecated, use --skin=posix --cflags instead --posix-ldflags is deprecated, use --skin=posix --ldflags instead powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include/posix -Wl,@/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib/posix.wrappers -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt -lrtdm -lrtdk -Xlinker -rpath -Xlinker /opt/eldk-4.2/ppc_4xx/usr/xenomai/lib
xddp-label.c -o xddp-label
xddp-label.c: In function 'realtime_thread1':
xddp-label.c:99: warning: unused variable 'len'
xddp-label.c: In function 'realtime_thread2':
xddp-label.c:161: warning: unused variable 'buf'
--posix-cflags is deprecated, use --skin=posix --cflags instead --posix-ldflags is deprecated, use --skin=posix --ldflags instead powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include/posix -Wl,@/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib/posix.wrappers -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt -lrtdm -lrtdk -Xlinker -rpath -Xlinker /opt/eldk-4.2/ppc_4xx/usr/xenomai/lib
xddp-stream.c -o xddp-stream
--posix-cflags is deprecated, use --skin=posix --cflags instead --posix-ldflags is deprecated, use --skin=posix --ldflags instead powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include/posix -Wl,@/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib/posix.wrappers -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt -lrtdm -lrtdk -Xlinker -rpath -Xlinker /opt/eldk-4.2/ppc_4xx/usr/xenomai/lib
iddp-sendrecv.c -o iddp-sendrecv
iddp-sendrecv.c: In function 'client':
iddp-sendrecv.c:103: warning: unused variable 'buf' --posix-cflags is deprecated, use --skin=posix --cflags instead --posix-ldflags is deprecated, use --skin=posix --ldflags instead powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include/posix -Wl,@/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib/posix.wrappers -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt -lrtdm -lrtdk -Xlinker -rpath -Xlinker /opt/eldk-4.2/ppc_4xx/usr/xenomai/lib
iddp-label.c -o iddp-label
iddp-label.c: In function 'client':
iddp-label.c:124: warning: unused variable 'buf'
--posix-cflags is deprecated, use --skin=posix --cflags instead --posix-ldflags is deprecated, use --skin=posix --ldflags instead powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include/posix -Wl,@/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib/posix.wrappers -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt -lrtdm -lrtdk -Xlinker -rpath -Xlinker /opt/eldk-4.2/ppc_4xx/usr/xenomai/lib
bufp-readwrite.c -o bufp-readwrite
bufp-readwrite.c: In function 'client':
bufp-readwrite.c:97: warning: unused variable 'buf' --posix-cflags is deprecated, use --skin=posix --cflags instead --posix-ldflags is deprecated, use --skin=posix --ldflags instead powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include/posix -Wl,@/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib/posix.wrappers -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt -lrtdm -lrtdk -Xlinker -rpath -Xlinker /opt/eldk-4.2/ppc_4xx/usr/xenomai/lib
bufp-label.c -o bufp-label
bufp-label.c: In function 'client':
bufp-label.c:119: warning: unused variable 'buf'
make[1]: Leaving directory `/usr/src/xenomai-2.5.6/examples/rtdm/profiles/ipc'
--xeno-cflags is deprecated, use --skin=name --cflags instead --xeno-ldflags is deprecated, use --skin=name --ldflags instead
make[1]: Entering directory `/usr/src/xenomai-2.5.6/examples/native' powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE
-D_REENTRANT -Wall -pipe -D__XENO__ -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib
-lxenomai -lpthread -lnative -Xlinker -rpath -Xlinker
/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib trivial-periodic.c -o
trivial-periodic
trivial-periodic.c: In function 'main':
trivial-periodic.c:72: warning: control reaches end of non-void function --xeno-cflags is deprecated, use --skin=name --cflags instead --xeno-ldflags is deprecated, use --skin=name --ldflags instead powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE
-D_REENTRANT -Wall -pipe -D__XENO__ -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib
-lxenomai -lpthread -lnative -Xlinker -rpath -Xlinker
/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib sigdebug.c -o sigdebug
--xeno-cflags is deprecated, use --skin=name --cflags instead --xeno-ldflags is deprecated, use --skin=name --ldflags instead powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ rtprint.c -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib -lxenomai -lpthread -lnative -Xlinker -rpath -Xlinker /opt/eldk-4.2/ppc_4xx/usr/xenomai/lib -lrtdk -o rtprint
make[1]: Leaving directory `/usr/src/xenomai-2.5.6/examples/native' --xeno-cflags is deprecated, use --skin=name --cflags instead --xeno-ldflags is deprecated, use --skin=name --ldflags instead
make[1]: Entering directory `/usr/src/xenomai-2.5.6/examples/common' powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE
-D_REENTRANT -Wall -pipe -D__XENO__ -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib
-lxenomai -lpthread -O -Xlinker -rpath -Xlinker
/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib hw_direct_io.c -o hw_direct_io
In file included from hw_direct_io.c:23:
/opt/eldk-4.2/ppc_4xx/usr/xenomai/include/posix/pthread.h:469: warning:
'struct sched_param_ex' declared inside parameter list /opt/eldk-4.2/ppc_4xx/usr/xenomai/include/posix/pthread.h:469: warning: its scope is only this definition or declaration, which is probably not what you want /opt/eldk-4.2/ppc_4xx/usr/xenomai/include/posix/pthread.h:473: warning:
'struct sched_param_ex' declared inside parameter list
make[1]: Leaving directory `/usr/src/xenomai-2.5.6/examples/common'
sed: kann /lib/modules/2.6.32-5-686/build/Makefile nicht lesen: Datei oder Verzeichnis nicht gefunden --posix-cflags is deprecated, use --skin=posix --cflags instead
make: *** /lib/modules/2.6.32-5-686/build: Datei oder Verzeichnis nicht gefunden. Schluss.
--posix-ldflags is deprecated, use --skin=posix --ldflags instead make[1]: Entering directory `/usr/src/xenomai-2.5.6/examples/posix' powerpc-linux-gcc -DCONSUMER -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include/posix -I/lib/modules/2.6.32-5-686/build/include/xenomai -I/lib/modules/2.6.32-5-686/build/include/xenomai/compat -I/lib/modules/2.6.32-5-686/build/include/xenomai/posix -Wl,@/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib/posix.wrappers -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt
-Xlinker -rpath -Xlinker /opt/eldk-4.2/ppc_4xx/usr/xenomai/lib satch.c -o
satch
--posix-cflags is deprecated, use --skin=posix --cflags instead
make: *** /lib/modules/2.6.32-5-686/build: Datei oder Verzeichnis nicht gefunden. Schluss.
powerpc-linux-gcc -DCONSUMER -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__ -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include/posix -I/lib/modules/2.6.32-5-686/build/include/xenomai -I/lib/modules/2.6.32-5-686/build/include/xenomai/compat
-I/lib/modules/2.6.32-5-686/build/include/xenomai/posix -c -o satch.o
satch.c
make[1]: Leaving directory `/usr/src/xenomai-2.5.6/examples/posix'

After copying trivial-periodic to 405GP cpu, it returns illegal instruction.

Is /opt/eldk-4.2 meant to be the rootfs of the 405GP cpu ? I use a initramfs, which is placed in /usr/src/initramfs, so i only copy the xenomai lib/ folder from /opt/eldk-4.2/ppc_4xx/lib into my initramfs/lib folder.

Florian

-----Ursprüngliche Nachricht-----
Von: Wolfgang Grandegger [mailto:[email protected]
Gesendet: Montag, 16. Mai 2011 13:17
An: Koenig, Florian
Cc: [email protected]
Betreff: Re: [Xenomai-help] build xenomai userspace app, illegal instruction

Quoted 4 lines · Wolfgang Grandegger
Quoted 3 lines · Florian

Hi,

i installed eldk into /opt/eldk-4.2, then i installed (make install)

xenomai

Quoted 10 lines
Quoted 9 lines

user-space into /opt/eldk-4.2/ppc_4xx .

Now when i try to build the xenomai examples with

$ make XENO=/opt/eldk-4.2/usr/xenomai-2.5.6/bin

It uses /lib/modules/2.6.32-5-686 from the local kernel, so i used

$ make XENO=/opt/eldk-4.2/usr/xenomai-2.5.6/bin KSRC=/usr/src/linux-2.6.36
Quoted 8 lines

For building kernel space modules you need to specifiy KSRC as well, but not for user space apps.

Review

Quoted 5 lines

But then it returns:
make[1]: Entering directory `/usr/src/xenomai-2.5.6/examples/native' powerpc-linux-gcc -I/usr/xenomai-2.5.6/include -D_GNU_SOURCE -D_REENTRANT

(quoted diff) +0 -2
-Wall -pipe -D__XENO__   -L/usr/xenomai-2.5.6/lib -lxenomai -lpthread
-lnative -Xlinker -rpath -Xlinker /usr/xenomai-2.5.6/lib

trivial-periodic.c

Quoted 7 lines
Quoted 3 lines

-o trivial-periodic
trivial-periodic.c: In function 'main':
trivial-periodic.c:72: warning: control reaches end of non-void function

I think you didn't specify DESTDIR? Or did you install xenomai-2.5.6 into /usr ? Normally you do:

Quoted 15 lines
  cd xenomai-2.5.6
  ./configure --host=powerpc-linux --prefix=/usr/xenomai
  make
  export DESTDIR=/opt/eldk/ppc_4xx
  make install

You also need the DESTDIR for building your apps.

Quoted 7 lines

When i now use trivial-periodic on the 405GP cpu, it also returns: illegal instruction

When i try to build the hello_world app with your command it returns:

powerpc-linux-gcc -o test test.c 'XENO=/opt/eldk-4.2/ppc_4xx/usr/xenomai-2.5.6/bin/xeno-config --skin

native

Quoted 9 lines
Quoted 7 lines

--cflags --ldflags' -lrtdk
powerpc-linux-gcc:
XENO=/opt/eldk-4.2/ppc_4xx/usr/xenomai-2.5.6/bin/xeno-config --skin native --cflags --ldflags: No such file or directory

Why is xenomai using local /lib/modules/2.6.32-5-686 directory ? what do i wrong with xenomai userspace part ?

See above? Hope it helps.

Just to be sure. The installed Xenomai programs from the test suite like "latency" or "cyclictest" do work fine, right?

Wolfgang.

----------------------------------------------------------------------------------------------------------------------------
Omicron NanoTechnology GmbH
Limburger Str. 75
65232 Taunusstein, GERMANY
Registration: HRB Nr.: 16116, Amtsgericht Wiesbaden, VAT no. DE111361420
Geschäftsführer / Managing Director: Norbert Nold www.omicron.de

#6 lore raw

Hello,

Quoted 6 lines · Florian

Hi,
i started from new and have done the following:

i deleted /opt/eldk-4.2 and installed it new with:

$ ./install -d /opt/eldk-4.2 ppc_4xx

BTW: also be aware of ELDK_FIXOWER and ELDK_MAKEDEV.b

Quoted 10 lines

Then i setup env-vars and goto /usr/src/xenomai-2.5.6:

$ export ARCH=powerpc
$ export DESTDIR=/opt/eldk-4.2/ppc_4xx
$ export PATH=$PATH:/opt/eldk-4.2/usr/bin:/opt/eldk-4.2/bin

Then i configured xenomai userspace with:

$ ./configure --host=powerpc-linux      (without --prefix=)
$ make
$ make install
Quoted 6 lines

Then i goto /usr/src/xenomai/examples and run:

$ make XENO=/opt/eldk-4.2/ppc_4xx/usr/xenomai/bin

And then it returns, where it searches for includes in -I/lib/modules/2.6.32-5-686/build/include/xenomai/posix Which is my local x86 kernel, not the powerpc kernel?

The kernel is used just for build Xenomai kernel modules. For cross-compilation you must provide "KSRC=<path-to-your-kernel>. But it's *not* used for building user-space apps.

Quoted 11 lines

make XENO=/opt/eldk-4.2/ppc_4xx/usr/xenomai/
--xeno-cflags is deprecated, use --skin=name --cflags instead --xeno-ldflags is deprecated, use --skin=name --ldflags instead
make[1]: Entering directory `/usr/src/xenomai-2.5.6/examples/rtdm/driver-api' powerpc-linux-gcc -I/opt/eldk-4.2/ppc_4xx/usr/xenomai/include -D_GNU_SOURCE

(quoted diff) +0 -2
-D_REENTRANT -Wall -pipe -D__XENO__   -L/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib
-lxenomai -lpthread  -lnative -lrtdm -Xlinker -rpath -Xlinker

/opt/eldk-4.2/ppc_4xx/usr/xenomai/lib tut01-skeleton-app.c -o
tut01-skeleton-app
tut01-skeleton-app.c:54: warning: second argument of 'main' should be 'char **'

Looks good now. The path is pointing to the Xenomai installation dir:
/opt/eldk-4.2/ppc_4xx/usr/xenomai/

Quoted 1 line

After copying trivial-periodic to 405GP cpu, it returns illegal instruction.

Hm, in a previous mail I asked if the installed Xenomai programs from the test suite like "latency" or "cyclictest" do work. Is that the case? If not, it's most likely not a build problem.

Quoted 3 lines

Is /opt/eldk-4.2 meant to be the rootfs of the 405GP cpu ? I use a initramfs, which is placed in /usr/src/initramfs, so i only copy the xenomai lib/ folder from /opt/eldk-4.2/ppc_4xx/lib into my initramfs/lib folder.

It's up to you to define the rootfs and install the Xenomai programs into:

  $ export DESTDIR=/usr/src/initramfs
  $ cd xenomai-2.5.6
  $ make install

That's likely to much data. The following should work as well:

  $ make install-exec

Wolfgang.

#7 lore raw

Hi,

Quoted 1 line

After copying trivial-periodic to 405GP cpu, it returns illegal

instruction.

Hm, in a previous mail I asked if the installed Xenomai programs from the test suite like "latency" or "cyclictest" do work. Is that the case? If not, it's most likely not a build problem.

The latency and cyclictest also return illegal instruction. What could it else be, misconfigured kernel?

florian

----------------------------------------------------------------------------------------------------------------------------
Omicron NanoTechnology GmbH
Limburger Str. 75
65232 Taunusstein, GERMANY
Registration: HRB Nr.: 16116, Amtsgericht Wiesbaden, VAT no. DE111361420
Geschaftsfuhrer / Managing Director: Norbert Nold www.omicron.de

#8 lore raw
Quoted 11 lines · Florian

Hi,

Quoted 1 line

After copying trivial-periodic to 405GP cpu, it returns illegal

instruction.

Hm, in a previous mail I asked if the installed Xenomai programs from the test suite like "latency" or "cyclictest" do work. Is that the case? If not, it's most likely not a build problem.

The latency and cyclictest also return illegal instruction. What could it else be, misconfigured kernel?

Do you have CONFIG_XENO_HW_FPU disabled? If not, please disable and retry. Illegal instructions are maybe due to hard-float instructions in the binary. I will check on our Walnut board when time permits... hopefully today.

Wolfgang.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw
Quoted 6 lines · Florian

Hi,

Do you have CONFIG_XENO_HW_FPU disabled? If not, please disable and retry. Illegal instructions are maybe due to hard-float instructions in the binary. I will check on our Walnut board when time permits... hopefully today.

Nobody will understand that the above paragraph was written by myself without proper quoting!

Quoted 2 lines

I set CONFIG_XENO_HW_FPU to
# CONFIG_XENO_HW_FPU is not set

Well, that should not be done manually and it could not be set via "menuconfig", I just realized. It's not the problem anyway, I believe.

Quoted 3 lines

I rebuild the xenomai userspace stuff (make clean;./configure --host=powerpc-linux;make;make install), but the same (illegal instruction), when i run it on powerpc cpu.

I just tried latency on my Walnut board and it works fine:

-bash-3.2# cat /proc/cpuinfo
processor : 0
cpu : 405GP
clock : 200.000000MHz
revision : 1.69 (pvr 4011 0145)
bogomips : 400.00
timebase : 200000000
platform : Walnut
model : ibm,walnut
Memory : 32 MB

-bash-3.2# cd /home/wolf/bin/
-bash-3.2# ./latency
== Sampling period: 100 us
== Test mode: periodic user-mode task
== All results in microseconds
warming up...

RTT|  00:00:01  (periodic user-mode task, 100 us period, priority 99)
RTH|----lat min|----lat avg|----lat max|-overrun|---msw|---lat best|--lat worst
RTD|     10.840|     11.570|     35.235|       0|     0|     10.840|     35.235
RTD|      9.710|     10.675|     37.205|       0|     0|      9.710|     37.205
RTD|      9.710|     10.465|     35.995|       0|     0|      9.710|     37.205
RTD|      9.710|     10.475|     43.635|       0|     0|      9.710|     43.635
RTD|      9.710|     13.885|     45.525|       0|     0|      9.710|     45.525
RTD|      9.710|     11.605|     37.505|       0|     0|      9.710|     45.525

^C---|-----------|-----------|-----------|--------|------|-------------------------
RTS| 9.710| 11.445| 45.525| 0| 0| 00:00:07/00:00:07

And also the example trivial-periodic works:

-bash-3.2# export LD_LIBRARY_PATH=/home/wolf/lib
-bash-3.2# ./trivial-periodic
Time since last turn: 1000.009340 ms
Time since last turn: 1000.008920 ms
Time since last turn: 1000.001100 ms
Time since last turn: 999.989450 ms

Quoted 4 lines

All other "normal" apps are running, only when i link to xenomai userspace libs i get illegal instructions. On linux side i dont need CONFIG_MATH_EMULATION enabled, because i want to use soft-float, that is correct, or?

I'm really puzzled what you are doing. It makes sense that you show us your build commands step by step.

Wolfgang.

#11 lore raw
Quoted 8 lines · Wolfgang Grandegger
Quoted 6 lines · Florian

Hi,

Do you have CONFIG_XENO_HW_FPU disabled? If not, please disable and retry. Illegal instructions are maybe due to hard-float instructions in the binary. I will check on our Walnut board when time permits... hopefully today.

Quoted 8 lines

Nobody will understand that the above paragraph was written by myself without proper quoting!

Quoted 2 lines

I set CONFIG_XENO_HW_FPU to
# CONFIG_XENO_HW_FPU is not set

Well, that should not be done manually and it could not be set via "menuconfig", I just realized. It's not the problem anyway, I believe.

You can set CONFIG_XENO_HW_FPU, it is located in the "Real-time system"/"nucleus"/"Machine" menu.

Signature · 1 line
                                                                Gilles.
#12 lore raw
Quoted 12 lines · Gilles Chanteperdrix
Quoted 11 lines · Wolfgang Grandegger
Quoted 6 lines · Florian

Hi,

Do you have CONFIG_XENO_HW_FPU disabled? If not, please disable and retry. Illegal instructions are maybe due to hard-float instructions in the binary. I will check on our Walnut board when time permits... hopefully today.

Nobody will understand that the above paragraph was written by myself without proper quoting!

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I set CONFIG_XENO_HW_FPU to
# CONFIG_XENO_HW_FPU is not set

Well, that should not be done manually and it could not be set via "menuconfig", I just realized. It's not the problem anyway, I believe.

You can set CONFIG_XENO_HW_FPU, it is located in the "Real-time system"/"nucleus"/"Machine" menu.

Ah, right. Didn't look really carefully.

Wolfgang.

#13 lore raw
In reply to Gilles Chanteperdrix

Hi,
in linux-2.6.36 menuconfig is in Real-time syste/nucleus/machine only "Enable unlocked context switch" to choose, no hw-fpu ?

Quoted 5 lines

You can set CONFIG_XENO_HW_FPU, it is located in the "Real-time system"/"nucleus"/"Machine" menu.

--
Gilles.

florian

----------------------------------------------------------------------------------------------------------------------------
Omicron NanoTechnology GmbH
Limburger Str. 75
65232 Taunusstein, GERMANY
Registration: HRB Nr.: 16116, Amtsgericht Wiesbaden, VAT no. DE111361420
Geschäftsführer / Managing Director: Norbert Nold www.omicron.de

#14 lore raw
Quoted 7 lines · Florian

Hi,
in linux-2.6.36 menuconfig is in Real-time syste/nucleus/machine only "Enable unlocked context switch" to choose, no hw-fpu ?

Quoted 2 lines

You can set CONFIG_XENO_HW_FPU, it is located in the "Real-time system"/"nucleus"/"Machine" menu.

I had a closer look:

Symbol: XENO_HW_FPU [=n]
Type : boolean
Prompt: Enable FPU support

     Defined at arch/powerpc/xenomai/Kconfig:24
     Depends on: XENO_OPT_NUCLEUS [=y] && PPC_FPU [=n]
     Location:
       -> Real-time sub-system
         -> Nucleus (XENO_OPT_NUCLEUS [=y])
           -> Machine

It depends on PPC_FPU and therefore the option is not selectable for a system without FPU. I'm really surprised that it is on for your 405GP board. Maybe your BSP is broken.

Wolfgang.