Bug 224488 - Should LDFLAGS+=-Wl,--as-needed be always added when USE_QT5=gui is used?
Summary: Should LDFLAGS+=-Wl,--as-needed be always added when USE_QT5=gui is used?
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-20 20:15 UTC by Yuri Victorovich
Modified: 2018-10-20 18:39 UTC (History)
7 users (show)

See Also:
tcberner: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2017-12-20 20:15:56 UTC
It appears that USE_QT5 always/often induces the unneeded OpenGL dependency.
The recipe to cure this has been floated around: to add "LDFLAGS+=-Wl,--as-needed" in the individual ports. For example, this was done in this submission: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224470

Routinely adding such LDFLAGS to ports seems to be wrong to me. If --as-needed changes the list of actually linked libraries, then the list needs to be fixed instead?

Does USE_QT5=gui always supply wrong link flags, erroneously containing the opengl lib? Is this a problem of framework, or Qt ports, or Qt upstream?
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2017-12-20 20:18:44 UTC
This is not blocking anything,  you can add the LDFLAGS to the individual port.
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2017-12-20 20:27:45 UTC
--as-needed also eliminates XORG dependencies in the above-mentioned submission.
So xorg libs supplied by USE_QT5 are also bogus.
Comment 3 Adriaan de Groot freebsd_committer freebsd_triage 2018-01-19 23:28:20 UTC
qt5-gui depends on both GL and X11; the platform abstractions loaded by qt5-gui are what is actually going to call into GL. So the dependency is only "unneeded" if you have a GUI application that isn't going to run on X11 or GL, ever. I suppose if you're into Qt Automotive on FreeBSD with only the framebuffer that makes sense.
Comment 4 Adriaan de Groot freebsd_committer freebsd_triage 2018-04-08 19:30:33 UTC
I'd prefer to leave this open with an explicit "needs information" tag for a bit, but Bugzilla doesn't seem to support that state. Setting to "in progress" with intent to close soon.

This PR no longer blocks PR #224470, which was committed with the as-needed flags. The comment in the committed Makefile points to this PR.

But what is the actual problem? This PR just states that some dependencies are unneeded, some link flags are wrong, without saying what, or why it, is actually wrong. A concrete example and some explanation would go a long way; otherwise the only real response can be (paraphrased from comment #1) "yeah, just add as-needed if you feel like it".
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2018-04-08 20:53:47 UTC
Yes, it's not a hard error, just unnecessary dependencies.
I'll find an example and will add more explanation.
Comment 6 Tobias C. Berner freebsd_committer freebsd_triage 2018-10-20 18:38:44 UTC
I think adding the flags to the offending child-ports is the better solution.