Discussion:
gcc-linaro-6.1-2016.07...Big Endian and Little Endian aarch64 Options
s***@comcast.net
2016-08-21 22:07:00 UTC
Permalink
Hi,

I was able to get linaro-6.1-2016.07 compiled for both aarch64 and armhf. I also have some prebuilt 5.2 and 5.3 binaries, plus a few other 4.8 and 4.9 compilers from quite some time back. I've used these for building a Linux 3.10 kernel, and the newer linaro-6.1 fails during kernel compile. The issue seems to be the assembler does not recognize option "-EL" (all of the ARM systems I'm building for are little endian, I've not seen a big endian system).

I am wondering if support for options "-EB" and "-EL" are part of the configure options? There is the generic "help" listing the "--enable-FEATURE=ARG", but I do not see a comprehensive list of features this might deal with. I'm hoping that big/little endian for armhf and aarch64 can be enabled with this. Otherwise I'm hoping to find more information on what I might need to do or change for compatibility with the "-EL" option.

For reference, I have similar templates for 32-bit and 64-bit configuration (different triplet and build root). Here's one:
export SRC='/home/build/linaro/gcc-linaro-snapshot-6.1-2016.07'export BUILD='/home/build/linaro/32bit'export TRIPLET=arm-linux-gnueabihfexport CLONE=/usr/local/sysroot/${TRIPLET}export VENDOR_ID=gcc-linaro-6.1-2016.07export LINUX_ARCH=armhf cd $BUILD${SRC}/configure --prefix=/usr/local/${TRIPLET}/${VENDOR_ID} --target=${TRIPLET} \ --with-build-sysroot=${CLONE} \ --enable-languages=c \ --with-sysroot=/

Thanks!
Jim Wilson
2016-08-22 04:48:24 UTC
Permalink
Post by s***@comcast.net
also have some prebuilt 5.2 and 5.3 binaries, plus a few other 4.8 and 4.9
compilers from quite some time back. I've used these for building a Linux
3.10 kernel, and the newer linaro-6.1 fails during kernel compile. The issue
seems to be the assembler does not recognize option "-EL" (all of the ARM
systems I'm building for are little endian, I've not seen a big endian
system).
Embedded toolchains are frequently multilibbed for big/little endian,
but linux toolchains are not. There is no convention for having both
big and little endian glibc installs on a system, and no convention
for having both big and little endian system call entry points in the
kernel. So for a linux toolchain, you have to choose whether it is
big or little at configure time with the target triplet, and you can't
change it after configure time. arm is little endian by default, and
armeb is big-endian. Similarly, aarch64 is little endian and
aarch64_be is big-endian.

If you are getting assembler errors for -EL and/or -EB, then you
probably aren't using an arm/aarch64 assembler. You are probably
accidentally using an x86 assembler instead. Try adding a -v option
to the gcc command to check what assembler is being used, and try
adding a -Wa,v option to get verbose info from the assembler which
will tell you what it was configured for.

You mentioned earlier that you didn't bother building binutils, this
might be why gcc is failing after the install. Binutils is pretty
easy to configure and build compared to gcc, and bugs in binutils are
rare compared to gcc, so there is no reason to skip the binutils build
when doing a toolchain build. This is likely to cause more problems
than it avoids. Just be sure to use the same configure options for
binutils that you use for gcc, and configure/build/install binutils
before you configure/build/install gcc.

Jim

Loading...