Date: Fri, 21 Jan 2022 15:41:03 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 261379] clang 10.0 fails to cross-compile against target x86_64-unknown-freebsd7 Message-ID: <bug-261379-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D261379 Bug ID: 261379 Summary: clang 10.0 fails to cross-compile against target x86_64-unknown-freebsd7 Product: Base System Version: 12.3-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: hayatelee@gmail.com Background: We need to backport a tools built with clang on FreeBSD-12 to FreeBSD-7 Steps: 1. Download sysroot from http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/7.4-R= ELEASE/base/ 2. untar the base and fix the symlinks 3. create a simple main.c with the following content #include <stdio.h> int main() { printf("hello world\n"); return 0; } 4. build it with clang -target x86_64-unknown-freebsd7 --sysroot=3D/path/to/sysroot -fuse-ld= =3Dlld -v main.c 5. linker error: FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2) Target: x86_64-unknown-freebsd7 Thread model: posix InstalledDir: /usr/bin "/usr/bin/clang" -cc1 -triple x86_64-unknown-freebsd7 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name main.c -mrelocation-model static -mthread-model posix -mframe-pointer=3Dall -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -fno-use-init-array -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=3Dgdb -v -resource-dir /usr/lib/clang/10.0.1 -isysroot /path/to/sysroot -fdebug-compilation-dir /usr/home/test -ferror-limit 19 -fmessage-length 117 -fgnuc-version=3D4.2.1 -fobjc-runtime=3Dgnustep -fdiagnostics-show-option -fcolor-diagnostics -fad= drsig -o /tmp/main-ca9b0b.o -x c main.c clang -cc1 version 10.0.1 based upon LLVM 10.0.1 default target x86_64-unknown-freebsd12.2 #include "..." search starts here: #include <...> search starts here: /usr/lib/clang/10.0.1/include /home/vagrant/farm_tree/usr/include End of search list. "/usr/bin/ld.lld" --sysroot=3D/home/vagrant/farm_tree --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 --enable-new-dtags -o a.out /home/vagrant/farm_tree/usr/lib/crt1.o /home/vagrant/farm_tree/usr/lib/crti= .o /home/vagrant/farm_tree/usr/lib/crtbegin.o -L/home/vagrant/farm_tree/usr/lib /tmp/main-ca9b0b.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /home/vagrant/farm_tree/usr/lib/crtend.o /home/vagrant/farm_tree/usr/lib/crtn.o ld.lld: error: .eh_frame: relocation is not in any piece clang: error: linker command failed with exit code 1 (use -v to see invocat= ion) ps: it seems this is a regression, because on FreeBSD-11 with clang 6.0, the above works --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-261379-227>