Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 669828 - sys-devel/clang-7.0.0 has wrong linker emulation for aarch64_be
Summary: sys-devel/clang-7.0.0 has wrong linker emulation for aarch64_be
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
URL: https://github.com/llvm-mirror/clang/...
Whiteboard:
Keywords:
Depends on:
Blocks: 674068
  Show dependency tree
 
Reported: 2018-10-27 22:18 UTC by Steev Klimaszewski (RETIRED)
Modified: 2019-05-11 09:29 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steev Klimaszewski (RETIRED) gentoo-dev 2018-10-27 22:18:01 UTC
Attempting to compile anything with clang for aarch64_be will result in the wrong emulation passed to the linker.


aarch64be ~ # /usr/lib/llvm/6/bin/clang -v helloworld.c -o helloworld
clang version 6.0.1 (tags/RELEASE_601/final)
Target: aarch64_be-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/6/bin
Selected GCC installation: /usr/lib/gcc/aarch64_be-unknown-linux-gnu/8.2.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
"/usr/lib/llvm/6/bin/clang-6.0" -cc1 -triple aarch64_be-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name helloworld.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu generic -target-feature +neon -target-abi aapcs -fallow-half-arguments-and-returns -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /usr/lib/llvm/6/bin/../../../../lib/clang/6.0.1 -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm/6/bin/../../../../lib/clang/6.0.1/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir /root -ferror-limit 19 -fmessage-length 235 -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/helloworld-5c77b8.o -x c helloworld.c
clang -cc1 version 6.0.1 based upon LLVM 6.0.1 default target aarch64_be-unknown-linux-gnu
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/llvm/6/bin/../../../../lib/clang/6.0.1/include
/usr/include
End of search list.
"/usr/lib/gcc/aarch64_be-unknown-linux-gnu/8.2.0/../../../../aarch64_be-unknown-linux-gnu/bin/ld" --eh-frame-hdr -m aarch64_be_linux -dynamic-linker /lib/ld-linux-aarch64_be.so.1 -o helloworld /usr/lib/gcc/aarch64_be-unknown-linux-gnu/8.2.0/../../../../lib64/crt1.o /usr/lib/gcc/aarch64_be-unknown-linux-gnu/8.2.0/../../../../lib64/crti.o /usr/lib/gcc/aarch64_be-unknown-linux-gnu/8.2.0/crtbegin.o -L/usr/lib/gcc/aarch64_be-unknown-linux-gnu/8.2.0 -L/usr/lib/gcc/aarch64_be-unknown-linux-gnu/8.2.0/../../../../lib64 -L/usr/lib/llvm/6/bin/../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/aarch64_be-unknown-linux-gnu/8.2.0/../../../../aarch64_be-unknown-linux-gnu/lib -L/usr/lib/gcc/aarch64_be-unknown-linux-gnu/8.2.0/../../.. -L/lib -L/usr/lib /tmp/helloworld-5c77b8.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/aarch64_be-unknown-linux-gnu/8.2.0/crtend.o /usr/lib/gcc/aarch64_be-unknown-linux-gnu/8.2.0/../../../../lib64/crtn.o
/usr/lib/gcc/aarch64_be-unknown-linux-gnu/8.2.0/../../../../aarch64_be-unknown-linux-gnu/bin/ld: unrecognised emulation mode: aarch64_be_linux
Supported emulations: aarch64linuxb aarch64elfb aarch64elf aarch64elf32 aarch64elf32b armelfb armelf aarch64linux aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)

Note: the text above shows 6.0, but 7.0 has the same result, I just don't believe that we should bother patching 6.0 as 7.0 should be going stable in 2-3 months.


Upstream has the fix as 
https://github.com/llvm-mirror/clang/commit/3c3905b5f7a1b5b6eecd091d9f4da495564d5819

I've tested the fix on 6.0.0 (not really necessary to apply to 6.0 imo) and I haven't tested 7.0 but since it has the case triple in the 7.0.0 that is extracted, the patch applies to it.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-21 21:46:31 UTC
Could you please confirm the fix in 7.0.1?