[Linuxppc-users] Little endian linker options

Lynn Boger boger at us.ibm.com
Thu Nov 8 07:07:13 AEDT 2018


Hi,

There should be a compiler called powerpc64le-linux-gnu-gcc to use for
buliding little endian. You probably need a different AT rpm to get the
right cross compilers.

Lynn Boger
Dept. O14A
LoP GCC team GO enablement
T/L 553-7588  External 507-253-7588
boger at us.ibm.com




From:	Ben Hood <ben at relops.com>
To:	linuxppc-users at lists.ozlabs.org
Date:	11/07/2018 01:38 PM
Subject:	[Linuxppc-users] Little endian linker options
Sent by:	"Linuxppc-users" <linuxppc-users-bounces
            +boger=us.ibm.com at lists.ozlabs.org>



Hi list,

I’m trying to cross compile a bunch of stuff on CentOS7 x86_64 for ppc64le.
The resultant binaries appear to be in big endian ppc64 format instead of
little.

So to break things down, I’ve tried to create a little endian binary for a
hello world app:

$ /opt/at12.0/bin/powerpc64-linux-gnu-gcc -mcpu=powerpc64le
-Wl,-m,elf64lppc,-EL hello.c
/opt/at12.0/bin/powerpc64-linux-gnu-ld: /opt/at12.0/lib/gcc/powerpc64-linux-gnu/8.2.1/../../../../powerpc64-linux-gnu/lib/../lib64/libgcc_s.so.1:
 error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status

However, I specify -EB instead of -EL, the compilation succeeds and readelf
tells me the output is ppc64 big endian:

$ /opt/at12.0/bin/powerpc64-linux-gnu-gcc -mcpu=powerpc64le
-Wl,-m,elf64lppc,-EB hello.c

Does anybody know how to get the toolchain to generate in little endian
format?

Many thanks in advance,

Ben
_______________________________________________
Linuxppc-users mailing list
Linuxppc-users at lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-users




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-users/attachments/20181107/ec62d13f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-users/attachments/20181107/ec62d13f/attachment.gif>


More information about the Linuxppc-users mailing list