[Rtai] RE: cross compiling rtai for x86 on an x86_64 host

Graeme Foot GraemeF at touchcut.com
Fri Sep 2 09:48:56 CEST 2011


Hi,
 
I also asked a colleague to look into the problem for me.  What he found is a couple of problems.
 
1) the base/math/Makefile.kbuild file has an EXTRA_FLAGS parameter which has an entry "-I/usr/include".  We have changed this to "-I=/usr/include".  With this change the cross compilation works.
 
2) the base/math/ source files #include "math.h" rather than #include <math.h>, which is probably why the include above was added.  We have not changed these as the first change was enough for us at the moment.
 
Cheers,
GraemeF.

________________________________

From: rtai-bounces at rtai.org on behalf of Graeme Foot
Sent: Thu 1/09/2011 4:59 p.m.
To: rtai at rtai.org
Subject: [Rtai] cross compiling rtai for x86 on an x86_64 host



Hi,

 

I'm trying to cross compile an x86 rtai system on an x86_64 host under buildroot.  The rtai build seems to be failing due to looking for headers in the hosts default paths rather than the cross compile directories.  eg: using the following commands:

 

make -j2 -C /home/graemef/workspace/svn/linuxBuild/rootfs/plato/build/rtai-3.8.1 oldconfig ARCH=x86 CROSS_COMPILE=/home/graemef/workspace/bin/i686-kinetic-linux-gnu/bin/i686-kinetic-linux-gnu-

make

 

 

I get:

 

  CC [M]  /home/graemef/workspace/svn/linuxBuild/rootfs/plato/build/rtai-3.8.1/base/math/e_acos.o

In file included from /usr/include/features.h:378,

                 from /usr/include/math.h:28,

                 from /home/graemef/workspace/svn/linuxBuild/rootfs/plato/build/rtai-3.8.1/base/math/e_acos.c:41:

/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory

 

 

I would like to set the sysroot to:

/home/graemef/workspace/bin/i686-kinetic-linux-gnu/i686-kinetic-linux-gnu/sys-root/

 

but I can't see any support in the rtai make files to set the sysroot.

 

I tried overriding the CC variable to:

CC="gcc --sysroot=/home/graemef/workspace/bin/i686-kinetic-linux-gnu/i686-kinetic-linux-gnu/sys-root/"

 

but this fails with:

 

/home/graemef/workspace/svn/linuxBuild/rootfs/plato/../../../../bin/i686-kinetic-linux-gnu/bin/i686-kinetic-linux-gnu-ranlib .libs/liblxrt.a

creating liblxrt.la

(cd .libs && rm -f liblxrt.la && ln -s ../liblxrt.la liblxrt.la)

 

make: unrecognized option '--sysroot=/home/graemef/workspace/bin/i686-kinetic-linux-gnu/i686-kinetic-linux-gnu/sys-root/'

 

 

Does anyone have any pointers as to how I can set the sysroot correctly or other things I can try?

 

 

Thanks,

GraemeF.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.rtai.org/pipermail/rtai/attachments/20110902/e361c96d/attachment.html>


More information about the Rtai mailing list