Page 1 of 1

Cross compiling for ARMv5

PostPosted: Thu Dec 15, 2011 9:46 am
by Jonas_K
Hi,

I'm trying to cross compile linux 3.1.5 with grsecurity patch for ARMv5 with codesourcery toolchain arm-none-linux-gnueabi version 2011.03 (i.e gcc 4.5.2). I have an issue regarding plugin support for gcc. I just read in the appendix on the grsecurity wiki that: "Note: full support for this feature requires gcc with plugin support so make sure your compiler is at least gcc 4.5.0 (cross compilation is not supported)".

So... cross compilation is not supported regardless of the gcc version of the cross compiler? Have I understood that correctly?

Can somebody please shed some light on this issue please?

Thanks!
//Jonas

Re: Cross compiling for ARMv5

PostPosted: Thu Dec 15, 2011 5:43 pm
by PaX Team
Jonas_K wrote:So... cross compilation is not supported regardless of the gcc version of the cross compiler? Have I understood that correctly?
it used to be true that cross-compilation with plugins wasn't supported but the very latest grsec should work fine with it. make sure you set CC/HOSTCC properly (i.e., the plugins will be compiled with HOSTCC using the plugin headers of CC). if you run into problems, let us know here ;).

Re: Cross compiling for ARMv5

PostPosted: Fri Dec 16, 2011 6:34 am
by Jonas_K
Thanks for the fast reply!

I tried to compile the plugins with your instructions but without any success. I think it is a codesourcery issue more than a grsecurity issue though.

I modified linux-3.1.5/scripts/gcc-plugin.sh to not redirect the compiler output to /dev/null to be able to see what happens. I get the following output from the gcc-plugin.sh script:

Code: Select all
In file included from /opt/codesourcery/arm-2011.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.2/plugin/include/tm.h:23:0,
                 from <stdin>:3:
/opt/codesourcery/arm-2011.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.2/plugin/include/config/arm/arm.h:39:34: fatal error: config/vxworks-dummy.h: No such file or directory
compilation terminated.
make[2]: Entering directory `/home/proj/linux/linux-3.1.5'
scripts/kconfig/conf --silentoldconfig Kconfig
make[2]: Leaving directory `/home/proj//linux/linux-3.1.5'
In file included from /opt/codesourcery/arm-2011.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.2/plugin/include/tm.h:23:0,
                 from <stdin>:3:
/opt/codesourcery/arm-2011.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.2/plugin/include/config/arm/arm.h:39:34: fatal error: config/vxworks-dummy.h: No such file or directory


There is no such file as vxworks_dummy.h in the codesourcery toolchain.

I'm on a tight schedule, so I'm going to go with the DISABLE_PAX_PLUGINS alternative for now. :-?

//Jonas

Re: Cross compiling for ARMv5

PostPosted: Fri Dec 16, 2011 8:09 am
by PaX Team
Jonas_K wrote:
Code: Select all
In file included from /opt/codesourcery/arm-2011.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.2/plugin/include/tm.h:23:0,
                 from <stdin>:3:
/opt/codesourcery/arm-2011.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.2/plugin/include/config/arm/arm.h:39:34: fatal error: config/vxworks-dummy.h: No such file or directory
compilation terminated.
make[2]: Entering directory `/home/proj/linux/linux-3.1.5'
scripts/kconfig/conf --silentoldconfig Kconfig
make[2]: Leaving directory `/home/proj//linux/linux-3.1.5'
In file included from /opt/codesourcery/arm-2011.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.2/plugin/include/tm.h:23:0,
                 from <stdin>:3:
/opt/codesourcery/arm-2011.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.2/plugin/include/config/arm/arm.h:39:34: fatal error: config/vxworks-dummy.h: No such file or directory


There is no such file as vxworks_dummy.h in the codesourcery toolchain.
ah yes, i forgot about this one. it's a problem with gcc itself, that file doesn't get installed even if it's referenced/needed by other plugin related headers. i just copied it over from the HOSTCC plugin directory myself.