Bug 9016 - arceb-buildroot-linux-uclibc ld uses incorrect default format
Summary: arceb-buildroot-linux-uclibc ld uses incorrect default format
Status: RESOLVED WORKSFORME
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-17 14:58 UTC by Uwe Hermann
Modified: 2016-07-28 20:21 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.