[Linuxppc-users] Little endian linker options

Ben Hood ben at relops.com
Thu Nov 8 10:15:30 AEDT 2018


Hi Lynn and Segher,

Many thanks for the heads up about the little endian variant.

By installing

$ yum install advance-toolchain-at12.0-cross-ppc64le

on CentOS I was able to use

CC="/opt/at12.0/bin/powerpc64le-linux-gnu-gcc”

In a bunch of places to create little endian ppc64 binaries.

Thanks for such a quick response, much appreciated.

Ben

> On 7 Nov 2018, at 20:07, Lynn Boger <boger at us.ibm.com> wrote:
> 
> 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
> 
> 
> <graycol.gif>Ben Hood ---11/07/2018 01:38:02 PM---Hi list, I’m trying to cross compile a bunch of stuff on CentOS7 x86_64 for ppc64le. The resultant b
> 
> 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 <https://lists.ozlabs.org/listinfo/linuxppc-users>
> 
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-users/attachments/20181107/6f0590ef/attachment-0001.html>


More information about the Linuxppc-users mailing list