[LLVMbugs] [Bug 11824] New: Cross compilation on linux close to impossible
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat Jan 21 16:01:22 PST 2012
http://llvm.org/bugs/show_bug.cgi?id=11824
Bug #: 11824
Summary: Cross compilation on linux close to impossible
Product: clang
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: lu_zero at gentoo.org
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Created attachment 7921
--> http://llvm.org/bugs/attachment.cgi?id=7921
Half complete poc
The current clang doesn't seem to use the host triple properly when it tries to
get the crt stubs.
I started to fix them so chost-clang test.c can work as supposed.
I'm currently lost with some path generation
armv7a-unknown-linux-gnueabi-clang -v test.c
--sysroot=/usr/armv7a-unknown-linux-gnueabi/
/usr/armv7a-unknown-linux-gnueabi/
clang version 3.0 (tags/RELEASE_30/final)
Target: armv7a-unknown-linux-gnueabi
Thread model: posix
/usr/armv7a-unknown-linux-gnueabi/
/usr/armv7a-unknown-linux-gnueabi//usr/lib/crt1.o
/usr/armv7a-unknown-linux-gnueabi/
/usr/armv7a-unknown-linux-gnueabi//usr/lib/crti.o
/usr/armv7a-unknown-linux-gnueabi/
/usr/armv7a-unknown-linux-gnueabi//usr/lib/crtbegin.o
"/usr/bin/clang" -cc1 -triple armv7-unknown-linux-gnueabi -S -disable-free
-disable-llvm-verifier -main-file-name test.c -mrelocation-model static
-mdisable-fp-elim -mconstructor-aliases -target-abi aapcs-linux -target-cpu
cortex-a8 -mfloat-abi soft -target-feature +soft-float-abi
-target-linker-version 2.21.1 -momit-leaf-frame-pointer -v -resource-dir
/usr/bin/../lib/clang/3.0 -isysroot /usr/armv7a-unknown-linux-gnueabi/
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/armv7a-unknown-linux-gnueabi//usr/local/include -internal-isystem
/usr/bin/../lib/clang/3.0/include -internal-externc-isystem
/usr/armv7a-unknown-linux-gnueabi//usr/include -internal-externc-isystem
/usr/armv7a-unknown-linux-gnueabi//usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include
-ferror-limit 19 -fmessage-length 80 -fno-signed-char -fgnu-runtime
-fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/test-8otd7j.s -x c test.c
clang -cc1 version 3.0 based upon llvm 3.0 hosted on x86_64-pc-linux-gnu
ignoring nonexistent directory
"/usr/armv7a-unknown-linux-gnueabi//usr/local/include"
ignoring nonexistent directory
"/usr/armv7a-unknown-linux-gnueabi//usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/bin/../lib/clang/3.0/include
/usr/armv7a-unknown-linux-gnueabi//usr/include
End of search list.
"/usr/bin/armv7a-unknown-linux-gnueabi-as" -mfpu=neon -o /tmp/test-C14jd9.o
/tmp/test-8otd7j.s
"/usr/bin/armv7a-unknown-linux-gnueabi-ld"
--sysroot=/usr/armv7a-unknown-linux-gnueabi/ -X --eh-frame-hdr -m
armelf_linux_eabi -dynamic-linker /lib/ld-linux.so.3 -o a.out
/usr/armv7a-unknown-linux-gnueabi//usr/lib/crt1.o
/usr/armv7a-unknown-linux-gnueabi//usr/lib/crti.o
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/crtbegin.o
-L/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../../../lib64
-L/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2
-L/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../../../armv7a-unknown-linux-gnueabi/lib
-L/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../..
-L/usr/armv7a-unknown-linux-gnueabi//lib
-L/usr/armv7a-unknown-linux-gnueabi//usr/lib /tmp/test-C14jd9.o -lgcc
--as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/crtend.o
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../../../lib64/crtn.o
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/crtbegin.o: file not recognized: File
format not recognized
clang: error: linker command failed with exit code 1 (use -v to see invocation)
clang -v -ccc-host-triple armv7a-unknown-linux-gnueabi test.c
--sysroot=/usr/armv7a-unknown-linux-gnueabi//usr/armv7a-unknown-linux-gnueabi/
clang version 3.0 (tags/RELEASE_30/final)
Target: armv7a-unknown-linux-gnueabi
Thread model: posix
/usr/armv7a-unknown-linux-gnueabi/
/usr/armv7a-unknown-linux-gnueabi//usr/lib/crt1.o
/usr/armv7a-unknown-linux-gnueabi/
/usr/armv7a-unknown-linux-gnueabi//usr/lib/crti.o
/usr/armv7a-unknown-linux-gnueabi/
/usr/armv7a-unknown-linux-gnueabi//usr/lib/crtbegin.o
"/usr/bin/clang" -cc1 -triple armv7-unknown-linux-gnueabi -S -disable-free
-disable-llvm-verifier -main-file-name test.c -mrelocation-model static
-mdisable-fp-elim -mconstructor-aliases -target-abi aapcs-linux -target-cpu
cortex-a8 -mfloat-abi soft -target-feature +soft-float-abi
-target-linker-version 2.21.1 -momit-leaf-frame-pointer -v -resource-dir
/usr/bin/../lib/clang/3.0 -isysroot /usr/armv7a-unknown-linux-gnueabi/
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/armv7a-unknown-linux-gnueabi//usr/local/include -internal-isystem
/usr/bin/../lib/clang/3.0/include -internal-externc-isystem
/usr/armv7a-unknown-linux-gnueabi//usr/include -internal-externc-isystem
/usr/armv7a-unknown-linux-gnueabi//usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include
-ferror-limit 19 -fmessage-length 80 -fno-signed-char -fgnu-runtime
-fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/test-5rVpdW.s -x c test.c
clang -cc1 version 3.0 based upon llvm 3.0 hosted on x86_64-pc-linux-gnu
ignoring nonexistent directory
"/usr/armv7a-unknown-linux-gnueabi//usr/local/include"
ignoring nonexistent directory
"/usr/armv7a-unknown-linux-gnueabi//usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/bin/../lib/clang/3.0/include
/usr/armv7a-unknown-linux-gnueabi//usr/include
End of search list.
"/usr/bin/armv7a-unknown-linux-gnueabi-as" -mfpu=neon -o /tmp/test-N6lSSB.o
/tmp/test-5rVpdW.s
"/usr/bin/armv7a-unknown-linux-gnueabi-ld"
--sysroot=/usr/armv7a-unknown-linux-gnueabi/ -X --eh-frame-hdr -m
armelf_linux_eabi -dynamic-linker /lib/ld-linux.so.3 -o a.out
/usr/armv7a-unknown-linux-gnueabi//usr/lib/crt1.o
/usr/armv7a-unknown-linux-gnueabi//usr/lib/crti.o
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/crtbegin.o
-L/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../../../lib64
-L/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2
-L/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../../../armv7a-unknown-linux-gnueabi/lib
-L/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../..
-L/usr/armv7a-unknown-linux-gnueabi//lib
-L/usr/armv7a-unknown-linux-gnueabi//usr/lib /tmp/test-N6lSSB.o -lgcc
--as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/crtend.o
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../../../lib64/crtn.o
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/crtbegin.o: file not recognized: File
format not recognized
Part of the patch is similar to something crafted for freebsd/netbsd and
possibly could be generalized for those targets as well.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list