From nobody Fri Jan 21 15:41:03 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 19B76195743B for ; Fri, 21 Jan 2022 15:41:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JgNrb5vDPz4mQs for ; Fri, 21 Jan 2022 15:41:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB6F91E256 for ; Fri, 21 Jan 2022 15:41:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 20LFf3iA027713 for ; Fri, 21 Jan 2022 15:41:03 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 20LFf3nl027712 for bugs@FreeBSD.org; Fri, 21 Jan 2022 15:41:03 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f 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 Date: Fri, 21 Jan 2022 15:41:03 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 12.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: hayatelee@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642779663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gdFlcQVmL/s0GyzI4zOO4sTCWP+H1DA1/kXisoiV19w=; b=mWOBj0mxR23LBTlJAlw0zZJsJbfWBJ0T8XK+RmFnFTQMc9ioovTCdrfxnV7BILWSr1jN+h K1QVv1jfU83jx43wABt9CgmFPJa+JPjWI6QwdFyCm4ZjnaJTufnezFbGkPxSoyDVGfxPdx mqLukNYep8bur20Kadgl4Rm4/qzF7alWymtmnctisJc/JYDWDs5lQ42vzduJz1djI2g+EE GBlqY+M67vAlnjzRBkGaYVkiz9+yW091507QvQvNCWS+0ETQLeL0r3m3YoGvK6dA8wND2Y 0Ad3a6m1FN0Wec0gTJHXojwbwYIGMLd91El8ZnuoIYKbwkhkokU41+W3YLpc/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642779663; a=rsa-sha256; cv=none; b=bgGcQPpLorpSwT3vhXiyKKyRxTDp1X0M6uEWc0uaHOmKcURxFm7GKIH4YP9EOOOYFcHWTk iqccEQ7Ad0kvOvhLODzQzEtCq6zJA0ifIIhG03BG8HzWOM0GZ70vBcOkxahyWUMCItS/h8 kJjQn0mgtDL0UxUA322i2mvisieSlx06ROpsatPfneGtGbzDqfKQOvs/rXLxU+cu87YCum CDSs5+Khzn+HWxdrSo+NWzTUVeD6oPqiSQQ0BQhLlI4CvikcHh+xHTaSyPVM89m34XHKUD fYUTlOE9jFcVyZwbi3/FC4mm1kVkefQewVoZIQUN7V3B+ABVfRXUgjVatOKHcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N 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 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.=