sysutils/tracker fails to link on 11.x with the old default ld(1). [175/247] cc -o utils/ontology/data-validator utils/ontology/data-validator.p/data-validator.c.o -L/usr/local/lib -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -Wl,--whole-archive -Wl,--start-group src/libtracker-fts/libtracker-fts.a -Wl,--no-whole-archive -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fstack-protector-strong src/libtracker-common/libtracker-common.a src/libtracker-data/libtracker-data.so src/libtracker-data/libtracker-sparql-query.a src/gvdb/libgvdb.a src/libtracker-sparql-backend/libtracker-sparql-2.0.so.0.304.0 /usr/local/lib/libglib-2.0.so /usr/local/lib/libintl.so /usr/local/lib/libgio-2.0.so /usr/local/lib/libgobject-2.0.so -lm /usr/local/lib/libsqlite3.so -luuid /usr/local/lib/libicuuc.so /usr/local/lib/libicudata.so /usr/local/lib/libicui18n.so -Wl,--end-group '-Wl,-rpath,$ORIGIN/../../src/libtracker-data:$ORIGIN/../../src/libtracker-sparql-backend' -Wl,-rpath-link,/z1/local/users/jhein/.nobak/wd/usr/ports/sysutils/tracker/work/tracker-2.3.4/_build/src/libtracker-data -Wl,-rpath-link,/z1/local/users/jhein/.nobak/wd/usr/ports/sysutils/tracker/work/tracker-2.3.4/_build/src/libtracker-sparql-backend FAILED: utils/ontology/data-validator cc -o utils/ontology/data-validator utils/ontology/data-validator.p/data-validator.c.o -L/usr/local/lib -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -Wl,--whole-archive -Wl,--start-group src/libtracker-fts/libtracker-fts.a -Wl,--no-whole-archive -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fstack-protector-strong src/libtracker-common/libtracker-common.a src/libtracker-data/libtracker-data.so src/libtracker-data/libtracker-sparql-query.a src/gvdb/libgvdb.a src/libtracker-sparql-backend/libtracker-sparql-2.0.so.0.304.0 /usr/local/lib/libglib-2.0.so /usr/local/lib/libintl.so /usr/local/lib/libgio-2.0.so /usr/local/lib/libgobject-2.0.so -lm /usr/local/lib/libsqlite3.so -luuid /usr/local/lib/libicuuc.so /usr/local/lib/libicudata.so /usr/local/lib/libicui18n.so -Wl,--end-group '-Wl,-rpath,$ORIGIN/../../src/libtracker-data:$ORIGIN/../../src/libtracker-sparql-backend' -Wl,-rpath-link,/z1/local/users/jhein/.nobak/wd/usr/ports/sysutils/tracker/work/tracker-2.3.4/_build/src/libtracker-data -Wl,-rpath-link,/z1/local/users/jhein/.nobak/wd/usr/ports/sysutils/tracker/work/tracker-2.3.4/_build/src/libtracker-sparql-backend src/libtracker-data/libtracker-data.so: undefined reference to `tracker_sparql_error_quark' src/libtracker-data/libtracker-data.so: undefined reference to `tracker_sparql_cursor_get_type' src/libtracker-data/libtracker-data.so: undefined reference to `tracker_sparql_cursor_get_boolean' src/libtracker-data/libtracker-data.so: undefined reference to `tracker_sparql_cursor_next' cc: error: linker command failed with exit code 1 (use -v to see invocation) See also http://package20.nyi.freebsd.org/data/114i386-default-baseline/550093/logs/tracker-2.3.4.log
This is similar to bug 249974 (seahorse) which also showed up on 11.x after updating to meson. The workaround there (don't use old ld(1)) works here as well. Fiddling around with where the libraries are listed in the link command can get it working (e.g., moving the internal .so's after the .a's works), but that seems to me to just trying to accommodate an old buggy linker.
Created attachment 218418 [details] [patch] avoid old ld(1) due to link problems after switch to meson Set maintainer-approval to last committer
Timeout? Still failing. More recent package builder log ... http://beefy9.nyi.freebsd.org/data/114amd64-default/552369/logs/tracker-2.3.4.log
Moin moinm Shouldn't this change be restricted to only set it on 11? mfg Tobias
(In reply to Tobias C. Berner from comment #4) It's a no-op on 12.x+ since lld is the default (or so I thought, but see *). So in the interest of simplicity I decided to not bother with making it conditional. However (*), I have recently come to understand that powerpc64 (I think) does not have lld until 13.x, so to handle that, we might have to make it conditional. How about this: # This can be removed after 11.x is no longer supported .if exists(/usr/bin/ld.lld) && ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld LDFLAGS+= -fuse-ld=lld .endif Using OSVERSION is an option if powerpc64/11.x is not a supported combination - I believe that's true, but correct me if not: .if ${OPSYS} == FreeBSD && ${OSVERSION} < 1200000 LDFLAGS+= -fuse-ld=lld .endif
(In reply to John Hein from comment #5) It looks like powerpc64/11.x is supported (https://www.freebsd.org/platforms/). So the OSVERSION flavor in the previous comment is probably no good. I didn't see anything for powerpc64/11.x on https://pkg-status.freebsd.org/, so I guessed (incorrectly it seems) that combination may not be supported for ports, but it appears that it is (https://www.freebsd.org/platforms/ppc.html#status). That leaves the '.if exists(/usr/bin/ld.lld) ...' way. It's ugly, but I don't have a better option at the moment.
Committed, thanks.
A commit references this bug: Author: tcberner Date: Sun Nov 15 10:25:32 UTC 2020 New revision: 555190 URL: https://svnweb.freebsd.org/changeset/ports/555190 Log: sysutils/tracker: link failure (11.x, old ld(1)) PR: 249990 Submitted by: John Hein <jcfyecrayz@liamekaens.com> Changes: head/sysutils/tracker/Makefile