Hi,
I'd like to check vzip/vuzp patch in big endian mode. But when I try to compile with -mbig-endian flag, I get
~/mainline/bin/bin/gcc -O3 -mfloat-abi=softfp -mfpu=neon neon-vtrnu8.c -mbig-endian
/home/irar/mainline/bin/lib/gcc/armv7l-unknown-linux-gnueabi/4.6.0/../../../libgcc_s.so.1: could not read symbols: File in wrong format collect2: ld returned 1 exit status
What am I missing?
Thanks, Ira
On Mon, 7 Feb 2011 17:18:40 +0200 Ira Rosen ira.rosen@linaro.org wrote:
Hi,
I'd like to check vzip/vuzp patch in big endian mode. But when I try to compile with -mbig-endian flag, I get
~/mainline/bin/bin/gcc -O3 -mfloat-abi=softfp -mfpu=neon neon-vtrnu8.c -mbig-endian
/home/irar/mainline/bin/lib/gcc/armv7l-unknown-linux-gnueabi/4.6.0/../../../libgcc_s.so.1: could not read symbols: File in wrong format collect2: ld returned 1 exit status
What am I missing?
Building for big-endian ARM is Really Hard (IMO) :-). You can't intermix little-endian and big-endian objects at all, so you either need an entirely-big-endian compiler, or to build one with little-endian/big-endian switchable multilibs.
I've attached a little patch which adds hardwired big-endian multilib configs for ARM EABI and ARM Linux -- though I'm pretty sure I only got one of those working, and I don't remember which. Using it outside CodeSourcery's build environment is probably also non-trivial.
Once it works you should be able to build binaries for either little-endian (default) or big-endian (by adding -mbig-endian). You'll need a big-endian Newlib/GLIBC/etc. as well... but maybe this is useful as a starting point.
Anyway, hope that helps a bit...
Julian
On 7 February 2011 18:24, Julian Brown julian@codesourcery.com wrote:
On Mon, 7 Feb 2011 17:18:40 +0200 Ira Rosen ira.rosen@linaro.org wrote:
Hi,
I'd like to check vzip/vuzp patch in big endian mode. But when I try to compile with -mbig-endian flag, I get
~/mainline/bin/bin/gcc -O3 -mfloat-abi=softfp -mfpu=neon neon-vtrnu8.c -mbig-endian
/home/irar/mainline/bin/lib/gcc/armv7l-unknown-linux-gnueabi/4.6.0/../../../libgcc_s.so.1: could not read symbols: File in wrong format collect2: ld returned 1 exit status
What am I missing?
Building for big-endian ARM is Really Hard (IMO) :-). You can't intermix little-endian and big-endian objects at all, so you either need an entirely-big-endian compiler, or to build one with little-endian/big-endian switchable multilibs.
I've attached a little patch which adds hardwired big-endian multilib configs for ARM EABI and ARM Linux -- though I'm pretty sure I only got one of those working, and I don't remember which. Using it outside CodeSourcery's build environment is probably also non-trivial.
Once it works you should be able to build binaries for either little-endian (default) or big-endian (by adding -mbig-endian). You'll need a big-endian Newlib/GLIBC/etc. as well... but maybe this is useful as a starting point.
Anyway, hope that helps a bit...
It certainly helps to understand that I don't want to try that fancy both-endians build ;) Is separate big-endian build Really Hard as well?
Thanks, Ira
Julian
On 08/02/11 07:33, Ira Rosen wrote:
It certainly helps to understand that I don't want to try that fancy both-endians build ;) Is separate big-endian build Really Hard as well?
Yes and no.
It's easy to configure for big endian: ..../configure --target=armbe-linux-gnueabi" .....
The hard part is that you'll probably find you need a big endian C library, and that means the usual circular compiler<->library dependencies.
Andrew
On Tue, 8 Feb 2011 09:33:21 +0200 Ira Rosen ira.rosen@linaro.org wrote:
On 7 February 2011 18:24, Julian Brown julian@codesourcery.com wrote:
Building for big-endian ARM is Really Hard (IMO) :-). You can't intermix little-endian and big-endian objects at all, so you either need an entirely-big-endian compiler, or to build one with little-endian/big-endian switchable multilibs.
It certainly helps to understand that I don't want to try that fancy both-endians build ;) Is separate big-endian build Really Hard as well?
IIRC I couldn't figure out the magic incantation needed to do it last time I tried. I don't think the "--with-endian=xxx" option is supported for ARM. Possibly the way to do it is to configure for the "armeb-foo-eabi-bar" rather than "arm-foo-eabi-bar" target triplet. Of course you'll still need a big-endian C library, etc...
OTOH a quick web-search seems to suggest that building a big-endian ARM cross-compiler might just not be possible with vanilla sources.
Julian
On Tue, 8 Feb 2011 11:22:32 +0000 Julian Brown julian@codesourcery.com wrote:
IIRC I couldn't figure out the magic incantation needed to do it last time I tried. I don't think the "--with-endian=xxx" option is supported for ARM. Possibly the way to do it is to configure for the "armeb-foo-eabi-bar" rather than "arm-foo-eabi-bar" target triplet. Of course you'll still need a big-endian C library, etc...
OTOH a quick web-search seems to suggest that building a big-endian ARM cross-compiler might just not be possible with vanilla sources.
A little more helpfully (:-)), I tried running crosstool-ng [1] to build a big-endian ARM cross-compiler, and it seems to work nicely (although I've not tested the resulting compiler beyond building "hello world" and seeing that it produced a big-endian executable). One caveat is that in-built configs for ARM only go up to GCC 4.4.5. I'm not sure how easy it is to add newer releases -- just pointing to a newer release tarball may or may not work.
(Note that one of the patches supplied with crosstool-ng provides the capability to compile a big-endian ARM toolchain: i.e., it looks like support for doing that *isn't* in vanilla sources after all, as I suspected.)
I guess you could use crosstool-ng to build a compiler & big-endian C library, then build a newer cross-compiler against the latter -- in theory at least.
I've attached the config I used to produce an (at least nominally) working build.
HTH,
Julian
On 8 February 2011 17:34, Julian Brown julian@codesourcery.com wrote:
On Tue, 8 Feb 2011 11:22:32 +0000 Julian Brown julian@codesourcery.com wrote:
IIRC I couldn't figure out the magic incantation needed to do it last time I tried. I don't think the "--with-endian=xxx" option is supported for ARM. Possibly the way to do it is to configure for the "armeb-foo-eabi-bar" rather than "arm-foo-eabi-bar" target triplet. Of course you'll still need a big-endian C library, etc...
OTOH a quick web-search seems to suggest that building a big-endian ARM cross-compiler might just not be possible with vanilla sources.
A little more helpfully (:-)), I tried running crosstool-ng [1] to build a big-endian ARM cross-compiler, and it seems to work nicely (although I've not tested the resulting compiler beyond building "hello world" and seeing that it produced a big-endian executable). One caveat is that in-built configs for ARM only go up to GCC 4.4.5. I'm not sure how easy it is to add newer releases -- just pointing to a newer release tarball may or may not work.
(Note that one of the patches supplied with crosstool-ng provides the capability to compile a big-endian ARM toolchain: i.e., it looks like support for doing that *isn't* in vanilla sources after all, as I suspected.)
I guess you could use crosstool-ng to build a compiler & big-endian C library, then build a newer cross-compiler against the latter -- in theory at least.
I've attached the config I used to produce an (at least nominally) working build.
Thanks a lot! I'll give it a try.
Thanks, Ira
HTH,
Julian
linaro-toolchain@lists.linaro.org