Bug 249990 - sysutils/tracker: link failure (11.x, old ld(1))
Summary: sysutils/tracker: link failure (11.x, old ld(1))
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-desktop (Team)
URL: http://beefy9.nyi.freebsd.org/data/11...
Keywords:
Depends on:
Blocks: 251004
  Show dependency treegraph
 
Reported: 2020-09-29 18:47 UTC by John Hein
Modified: 2021-04-12 19:13 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (gnome)


Attachments
[patch] avoid old ld(1) due to link problems after switch to meson (672 bytes, patch)
2020-09-29 19:30 UTC, John Hein
jcfyecrayz: maintainer-approval? (bapt)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2020-09-29 18:47:50 UTC
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
Comment 1 John Hein 2020-09-29 19:24:09 UTC
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.
Comment 2 John Hein 2020-09-29 19:30:10 UTC
Created attachment 218418 [details]
[patch] avoid old ld(1) due to link problems after switch to meson

Set maintainer-approval to last committer
Comment 3 John Hein 2020-10-16 16:05:53 UTC
Timeout?

Still failing.  More recent package builder log ...

http://beefy9.nyi.freebsd.org/data/114amd64-default/552369/logs/tracker-2.3.4.log
Comment 4 Tobias C. Berner freebsd_committer freebsd_triage 2020-11-05 18:31:04 UTC
Moin moinm

Shouldn't this change be restricted to only set it on 11?

mfg Tobias
Comment 5 John Hein 2020-11-06 00:10:37 UTC
(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
Comment 6 John Hein 2020-11-06 10:31:53 UTC
(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.
Comment 7 Tobias C. Berner freebsd_committer freebsd_triage 2020-11-15 10:25:39 UTC
Committed, thanks.
Comment 8 commit-hook freebsd_committer freebsd_triage 2020-11-15 10:26:12 UTC
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