Bug 9016

Summary: arceb-buildroot-linux-uclibc ld uses incorrect default format
Product: buildroot Reporter: Uwe Hermann <uwe>
Component: OtherAssignee: unassigned
Status: RESOLVED WORKSFORME    
Severity: normal CC: buildroot
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description Uwe Hermann 2016-06-17 14:58:40 UTC
With the arceb-buildroot-linux-uclibc toolchain you can get issues like this when compiling certain files/libs:

~/buildroot-arceb-buildroot-linux-uclibc/output/host/usr/arceb-buildroot-linux-uclibc/bin/ld: ERROR: Endian Match failed. Attempting to link blah.a(foo.o) with binary baz.o of opposite endian-ness


The reason seems to be that "ld" uses the incorrect default output format. Adding "-BE" would probably fix it, but IMHO it's a bug already that the default is not set to BE (but please correct me if I'm wrong).

 
ARC, little endian, correct default:
~/buildroot-arc-buildroot-linux-uclibc/output/host/usr/arc-buildroot-linux-uclibc/bin/ld --print-output-format
elf32-littlearc
 
ARC, big endian, WRONG default (should be "elf32-bigarc"):
~/buildroot-arceb-buildroot-linux-uclibc/output/host/usr/arceb-buildroot-linux-uclibc/bin/ld --print-output-format
elf32-littlearc
 
 
For comparison, here's another LE/BE toolchain example where this is handled correctly:
 
AARCH64, little endian, correct default:
~/buildroot-aarch64-buildroot-linux-gnu/output/host/usr/aarch64-buildroot-linux-gnu/bin/ld --print-output-format
elf64-littleaarch64
 
AARCH64, big endian, correct default:
~/buildroot-aarch64_be-buildroot-linux-gnu/output/host/usr/aarch64_be-buildroot-linux-gnu/bin/ld --print-output-format
elf64-bigaarch64
Comment 1 Vlad Zakharov 2016-07-28 19:14:35 UTC
Hi, 

I built toolchain in buildroot, tried to run your examples and got the following results:
--------------------->8-------------------
.../arceb-buildroot-linux-uclibc/bin/ld --print-output-format
elf32-bigarc
--------------------->8-------------------

Please provide more about conditions under which the failure occurred, e.g. what toochain version and git revision were used.
That would help us to catch and fix the issue.

Thanks,
Vlad.