/usr/local/bin/ld: BFD (GNU Binutils) 2.31.1 assertion fail elflink.c:2920 /usr/local/bin/ld: BFD (GNU Binutils) 2.31.1 assertion fail elflink.c:2920 c++: error: linker command failed with exit code 1 (use -v to see invocation) http://beefy8.nyi.freebsd.org/data/head-armv6-default/p491221_s343459/logs/errors/llvm80-8.0.0.r1.log /usr/local/bin/ld: BFD (GNU Binutils) 2.30 assertion fail elflink.c:2824 /usr/local/bin/ld: BFD (GNU Binutils) 2.30 assertion fail elflink.c:2824 c++: error: linker command failed with exit code 1 (use -v to see invocation) https://ptpb.pw/nJAQ
llvm80 builds fine with Clang 6.0.1 from 12.0 base system: https://ptpb.pw/v34W. I didn't try llvm60 because that'd be too slow with qemu-user-static.
Given it works with 6.0.1, this sounds like a 7.0.1 regression.
The question is if it'll work with lld, though. I guess clang 8 uses something that BFD ld can't handle.
Should this not (also?) be a devel/binutils bug? Even if exposed by the update to LLVM 8 it's detecting an internal inconsistency in BFD.
(In reply to Dimitry Andric from comment #3) LDFLAGS_armv6=-fuse-ld=lld does help: https://ptpb.pw/xbs6 . However, I've tried it only after upgrading my jail to clang800-import and testing that Clang 8 alone didn't help.
11.2 armv6 doesn't need -fuse-ld=lld but also builds fine with it: https://ptpb.pw/8DNd However, LLD 6 in 11.2 base spews /usr/bin/ld.lld: warning: lld uses extended branch encoding, no object with architecture supporting feature detected. /usr/bin/ld.lld: warning: lld may use movt/movw, no object with architecture supporting feature detected.
(In reply to Jan Beich from comment #6) lld 6 supports only armv7+
A commit references this bug: Author: brooks Date: Wed Feb 6 19:01:23 UTC 2019 New revision: 492319 URL: https://svnweb.freebsd.org/changeset/ports/492319 Log: Attempt to work around a problem with binutils not liking the armv6 code generated buy LLVM 7. PR: 235282 Changes: head/devel/llvm80/Makefile
armv7 is also affected ( https://ptpb.pw/gAzw ) but wasn't previously ( https://ptpb.pw/PirA ). Probably, ports r451923 needs to be partially reverted: armv7 can use lld on all supported FreeBSD releases.
(In reply to Jan Beich from comment #9) r451923 should have no effect on armv7 unless there is some completely absurd handling of LDFLAGS_${ARCH}. All it does is conditionally set: LDFLAGS_armv6=-fuse-ld=lld
(In reply to Brooks Davis from comment #10) LDFLAGS_armv6 was added by r492319 while I'm talking about r451923 which made armv7 use COMPILER_PATH=${LOCALBASE}/bin.
(In reply to Jan Beich from comment #11) Ah, is the fix then to remove the: || ${ARCH} == "armv7"
Correct. This can be done in all devel/llvm* ports. 12.0 armv7 (lld 6): - devel/llvm40: https://ptpb.pw/731b - devel/llvm50: https://ptpb.pw/DYes - devel/llvm60: https://ptpb.pw/PgCb - devel/llvm70: https://ptpb.pw/0dRm - devel/llvm80: https://ptpb.pw/xRX9 13.0 armv7 (lld 8): - devel/llvm50: https://ptpb.pw/9P0t - devel/llvm60: https://ptpb.pw/f14A - devel/llvm70: https://ptpb.pw/X1gv - devel/llvm80: https://ptpb.pw/mx5v
A commit references this bug: Author: brooks Date: Mon Feb 18 21:52:50 UTC 2019 New revision: 493328 URL: https://svnweb.freebsd.org/changeset/ports/493328 Log: Don't override the compiler on armv7. The base system compiler is now sufficent to build and link. No version bump. While technically required for armv7, forcing everyone to rebuild for this minor change that doesn't effect actual use is not justifiable. PR: 235282 Submitted by: jbeich Changes: head/devel/llvm40/Makefile head/devel/llvm50/Makefile head/devel/llvm60/Makefile head/devel/llvm70/Makefile
I believe this is now fixed.
A commit references this bug: Author: antoine Date: Thu May 23 09:12:34 UTC 2019 New revision: 502329 URL: https://svnweb.freebsd.org/changeset/ports/502329 Log: Attempt to work around a problem with binutils not liking the armv6 code generated by LLVM 7. PR: 235282 With hat: portmgr Changes: head/devel/llvm60/Makefile
Can you apply ports r492319 to devel/llvm70 as well? See https://reviews.freebsd.org/P328
A commit references this bug: Author: brooks Date: Wed Oct 9 17:41:22 UTC 2019 New revision: 514175 URL: https://svnweb.freebsd.org/changeset/ports/514175 Log: ttempt to work around a problem with binutils not liking the armv6 code generated by LLVM 7. PR: 235282 Requested by: jbeich Changes: head/devel/llvm70/Makefile