$ poudriere jail -cj clang7 -a amd64 -v projects/clang700-import -m svn+https $ poudriere testport -j clang7 graphics/lprof-devel [...] ld: error: undefined symbol: write_output >>> referenced by vinflate.c >>> vinflate.o:(flush_output) in archive src/argyll/libargyll.a ld: error: undefined symbol: write_output >>> referenced by vinflate.c >>> vinflate.o:(inflate_codes) in archive src/argyll/libargyll.a ld: error: undefined symbol: write_output >>> referenced by vinflate.c >>> vinflate.o:(inflate_codes) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_codes) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_codes) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_codes) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_codes) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_codes) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_codes) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_stored) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_stored) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_stored) in archive src/argyll/libargyll.a ld: error: undefined symbol: write_output >>> referenced by vinflate.c >>> vinflate.o:(inflate_stored) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_dynamic) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_dynamic) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_dynamic) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_dynamic) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_dynamic) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_dynamic) in archive src/argyll/libargyll.a ld: error: undefined symbol: get_16bits >>> referenced by vinflate.c >>> vinflate.o:(inflate_dynamic) in archive src/argyll/libargyll.a ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors) c++: error: linker command failed with exit code 1 (use -v to see invocation) See build log: https://ptpb.pw/zSZ1
Can be worked around via LLD_UNSAFE. I can't bisect LLD commits to figure out why LLD 6 built fine.
In order to reproduce outside of clang700-import (e.g., on 11.2) try adding the following to Makefile.local: BUILD_DEPENDS+= ld.lld70:devel/llvm70 LDFLAGS+= -fuse-ld=${LOCALBASE}/bin/ld.lld70 Example build log: https://ptpb.pw/JAre
Created attachment 196688 [details] Fix LD error; Add License graphics/lprof-devel: * Fix LD errors * Added License while here Tested on 12-Current and built fine
Comment on attachment 196688 [details] Fix LD error; Add License > +LICENSE= GPLv3 License headers in the source contain "or (at your option) any later version" clause, so you may want to add "+" suffix i.e., LICENSE=GPLv3+. > +LDD_UNSAFE= yes Typo: LDD -> LLD
Created attachment 196693 [details] Fix LD error; Add License
Approved, please commit.
Let me try something. Think I may have found a way to not use lld_undafe
I’m not on a PC but can if you remove LLD_UNSAFE and add: CFLAGS+= -fPIC This fixes linker issues. Figured this out on one port I’ve been working on
Seems adding fPIC solves the linker issues on 12. Atleast on ones I’ve tried
(In reply to Nathan from comment #9) > Seems adding fPIC solves the linker issues on 12. Atleast on ones I’ve tried Did you use LLD 7 which hasn't landed to -CURRENT yet? -fPIC doesn't help here, see https://ptpb.pw/r0Mf (clang700-import@r338392 amd64)
(In reply to Nathan from comment #9) Indeed, one common failure with lld is 3rd party code for a shared object that isn't compiled with -fPIC, because that implies that the output will have relocations against .text which GNU ld allows by default and lld does not. LLD_UNSAFE=yes is a big but easy hammer for this - just revert to GNU ld. Adding -Wl,-z,notext to LDFLAGS is a medium hammer - link with lld but allow the text relocation. Adding -fPIC CFLAGS is the most "correct" fix but introduces code and perhaps performance changes. Note that this is not the only type of issue that prevents use of LLD, and some software will still fail to link with LLD with -fPIC.
(In reply to Jan Beich from comment #10) Nope I have clang 6.0.1
I added LDFLAGS= -fuse-ld=${LOCALBASE/bin/ld.lldd70} to this port's Makefile, I didn't get no error on amd64 12-cur
A commit references this bug: Author: amdmi3 Date: Fri Dec 28 18:15:55 UTC 2018 New revision: 488613 URL: https://svnweb.freebsd.org/changeset/ports/488613 Log: - Add license - Fix build with LLD PR: 230994 Submitted by: ndowens@yahoo.com Reported by: jbeich@FreeBSD.org Changes: head/graphics/lprof-devel/Makefile