All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@domain.hid>
To: "Koenig, Florian" <F.Koenig@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] build xenomai userspace app, illegal instruction
Date: Fri, 13 May 2011 15:15:20 +0200	[thread overview]
Message-ID: <4DCD2EE8.2010904@domain.hid> (raw)
In-Reply-To: <89B30389DB4AE240AC1227F3FDBB7CCF029B910A@ontex.i.omicron.de>

On 05/13/2011 02:46 PM, Koenig, Florian wrote:
> 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

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

> 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.

> 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.

> 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.


  reply	other threads:[~2011-05-13 13:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-13 12:46 [Xenomai-help] build xenomai userspace app, illegal instruction Koenig, Florian
2011-05-13 13:15 ` Wolfgang Grandegger [this message]
2011-05-16 10:23   ` Koenig, Florian
2011-05-16 10:56     ` Wolfgang Grandegger
2011-05-16 11:17       ` Wolfgang Grandegger
2011-05-16 13:27         ` Koenig, Florian
2011-05-16 14:45           ` Wolfgang Grandegger
2011-05-17  7:03             ` Koenig, Florian
2011-05-17  7:14               ` Wolfgang Grandegger
     [not found]                 ` <89B30389DB4AE240AC1227F3FDBB7CCF029B9111@domain.hid>
2011-05-17  9:27                   ` Wolfgang Grandegger
2011-05-17 11:11                     ` Gilles Chanteperdrix
2011-05-17 11:22                       ` Wolfgang Grandegger
2011-05-17 13:21                       ` Koenig, Florian
2011-05-17 14:06                         ` Wolfgang Grandegger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DCD2EE8.2010904@domain.hid \
    --to=wg@domain.hid \
    --cc=F.Koenig@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.