Summary: | devel/qt5-core, devel/qt5-qmake, devel/binutils: qt5 produces unusable library with binutils | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Dmitry Marakasov <amdmi3> | ||||||||||
Component: | Individual Port(s) | Assignee: | freebsd-kde (group) <kde> | ||||||||||
Status: | Closed FIXED | ||||||||||||
Severity: | Affects Many People | CC: | Trond.Endrestol, admin, freebsd, ganthore, george, idhameed, jau, joneum, kde, lampa, lantw44, milios, olevole, rakuco, robbak, schulz89, tcberner, vadimkolchev | ||||||||||
Priority: | --- | Keywords: | needs-patch, needs-qa | ||||||||||
Version: | Latest | Flags: | rakuco:
maintainer-feedback+
tcberner: merge-quarterly+ |
||||||||||
Hardware: | Any | ||||||||||||
OS: | Any | ||||||||||||
Attachments: |
|
Description
Dmitry Marakasov
2017-03-28 15:43:30 UTC
Created attachment 181269 [details]
qmake patch
This patch fixes qmake part, making it always ignore gold.
Created attachment 181271 [details] qmake patch with UPDATING entry I need kde@ approval for this patch ASAP, for I have seen at least two reports of build failures because of this. https://lists.freebsd.org/pipermail/freebsd-ports/2017-March/107895.html http://www.bsdportal.ru/viewtopic.php?f=58&t=28282 (In reply to Dmitry Marakasov from comment #2) > Created attachment 181271 [details] > qmake patch with UPDATING entry This doesn't look right, all Qt5 ports built from qtbase (such as qt5-core and qt5-gui) run the configure script and perform the same gold detection that is being avoided in qmake. It makes more sense to change the configuration arguments in Mk/bsd.qt.mk. However, it's not clear if the bug is really in Qt or in binutils itself. I was reading https://sourceware.org/bugzilla/show_bug.cgi?id=21074 and couldn't figure out if https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=40d7d93ff412f4c34cde3daa04890d5cd2e0d9c9 is supposed to fix this (I'm going to test this later). (In reply to Raphael Kubo da Costa from comment #3) > couldn't figure out if > https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff; > h=40d7d93ff412f4c34cde3daa04890d5cd2e0d9c9 is supposed to fix this (I'm > going to test this later). For the record, it doesn't, it's already included in binutils 2.28. (In reply to Raphael Kubo da Costa from comment #3) > This doesn't look right, all Qt5 ports built from qtbase (such as qt5-core > and qt5-gui) run the configure script and perform the same gold detection > that is being avoided in qmake. It makes more sense to change the > configuration arguments in Mk/bsd.qt.mk. This is at least partially not true because 1) With this patch, all qt libs build fine with binutils present 2) Without this patch, when qmake is built with binutils present and binutils later removed, there are build failures complaining to nonexisting gold If I just build qt5-core with binutils present, with or without the qmake patch, it still links libQt5Core.so with -fuse-ld=gold. Add the last line to /usr/ports/Mk/bsd.qt.mk (line 122): CONFIGURE_ARGS+=-opensource -confirm-license \ -platform ${QMAKESPEC} \ -no-pch \ -no-use-gold-linker \ ... etc I've successfully compiled all the qt5 stuff with this. (In reply to lampa from comment #7) do not work here. me bsd.qt.mk: CONFIGURE_ARGS+=-opensource -confirm-license \ -platform ${QMAKESPEC} \ -no-pch \ -no-use-gold-linker \ -prefix ${PREFIX} \ when i will update x11-toolkits/qt5-widgets: /usr/ports/x11-toolkits/qt5-widgets/work/qtbase-opensource-src-5.7.1/lib/libQt5Core.so:(.dynamic+0x27a98): first defined here /usr/ports/x11-toolkits/qt5-widgets/work/qtbase-opensource-src-5.7.1/lib/libQt5Core.so:(.dynamic+0x2b2a0): multiple definition of `_end@Qt_5' c++: error: linker command failed with exit code 1 (use -v to see invocation) *** [../../../bin/uic] Error code 1 make[2]: stopped in /usr/ports/x11-toolkits/qt5-widgets/work/qtbase-opensource-src-5.7.1/src/tools/uic 1 error Created attachment 181488 [details]
bsd.qt.mk patch
Ok, I don't have time to investigate thoroughly atm, but it should work no worse, as it adds -no-use-gold-linker to CONFIGURE_ARGS in both qt5-qmake and all other qt5 ports.
*** Bug 218404 has been marked as a duplicate of this bug. *** Add me to the list of those who have experienced this bug, found no better way around it, and has had great success using the patch (attachment 181488 [details]) to compile, run and use all my qt5-* ports. Thank you, Dmitry, Raphael, Lampa and Jochen!
(In reply to Jochen Neumeister from comment #8) You need to rebuild devel/qt5-core first before building x11-toolkits/qt5-widgets The -no-user-gold-linker modification to /usr/ports/Mk/bsd.qt.mk works for me as long as I'm building qt5 related ports. However if I build a qt4 port it complains that "-no-user-gold-linker" is not a known option. I believe that this would need to be an option to configure based on the QT version being built. It possibly needs to be added to the .else section: . if ${_QT_VERSION:M4*} CONFIGURE_ARGS+=... . else CONFIGURE_ARGS+=-nomake examples -nomake tests \ -no-use-gold-linker \ I found this running portmaster -af. I'm testing now to see if the above location works better. (In reply to freebsd from comment #13) And if I would have read Dmitry's comment with patch 181488 that's exactly what people are reporting success with. just to clarify: Mr. Monkeyspunk in comment #13, was reporting he'd experienced failure on qt4 builds when -no-use-gold-linker was added around line 122 as per comment #7 (affecting qt4 and qt5 builds) However then in comment #14 Mr. Monkeyspunk has noticed that since comment #9 attachment 181488 [details] is already not affecting qt4 builds anymore because it instead adds -no-use-gold-linker to the line 146 region of bsd.qt.mk (which puts it into an existing appropriate 'else' clause). i have built many many qt4 and qt5 ports successfully today with this patch applied and binutils-2.28,1 installed. now, what i have not verified in the past 10 days is that the original problem still exists in ports/HEAD without this patch applied (that the problem has not been fixed erstwhile elsehow) if anyone is still experiencing this problem, we should commit this patch (attachment 181488 [details]), i think. Confirmed this problem DOES still exist in a clean ports/head as of: Last Changed Rev: 438814 Last Changed Date: 2017-04-18 19:56:24 +0000 (Tue, 18 Apr 2017) and yes then applying attachment 181488 [details] solves all of my qt5 problems while it keeps qt4 builds happy. with the patch applied i rebuilt my qt4-* and qt5-* ports happily and also built and tested using multimedia/vlc with qt5 libraries and net-p2p/namecoin with qt4 libraries. my uname: FreeBSD yoda.ccsys.com 11.0-RELEASE-p8 FreeBSD 11.0-RELEASE-p8 #0 r316324: Fri Mar 31 16:18:12 EDT 2017 root@yoda.ccsys.com:/usr/obj/usr/src/sys/NUOS amd64 Many thank yous to everyone supporting FreeBSD! This is still a problem as of 04/28/2017. I can confirm that the attached patch fixes the problem after applying it and rebuilding devel/qt5-core. I can also confirm that the bug is still present when compiling qt5. I applied the proposed patch and I could build everything without errors. This problem still present. # uname -srm FreeBSD 11.0-RELEASE-p10 amd64 This patch is fine for me too. +1, patch works for me Add me to the list of users affected by the problem, and the patch works for me, too. What are the chances of getting this committed? I suggest to bump devel/qt5-qmake's PORTREVISION additionally. Works for me as well. Notify and assign to kde@ (maintainer). Given they werent' notified (officially, other than cc) on issue creation, reset maintainer timeout. @Dmitry Its always best to assign maintainers (group email, in the case of teams) to issues so that a timeout-reassignment is explicit. If however in this case bapt@ is the only person on kde@ (I don't know), this issue can be considered maintainer timeout immediately, please re-assign accordingly. I believe the patch also needs to be updated to include the QT4 conditional as outlined in comment 13 *** Bug 219633 has been marked as a duplicate of this bug. *** Dmitry, can you attach a patch bumping PORTREVISION? I think we're good to go with this version we have now. Created attachment 183069 [details]
Updated patch.
Updated patch, with current date, and bumped devel/qt5-core and devel/qt5-qmake.
Comment on attachment 183069 [details]
Updated patch.
Thanks, please go ahead and commit. Don't forget the MFH tag.
A commit references this bug: Author: tcberner Date: Fri Jun 2 20:03:12 UTC 2017 New revision: 442460 URL: https://svnweb.freebsd.org/changeset/ports/442460 Log: Do not use gold linker for Qt5 ports. gold linker from binutils 2.28 may produce duplicate library symbols, which makes shared libraries created with it not usable with conventional ld linker. PR: 218187 Submitted by: amdmi3 Changes: head/Mk/bsd.qt.mk head/UPDATING head/devel/qt5-core/Makefile head/devel/qt5-qmake/Makefile A commit references this bug: Author: tcberner Date: Mon Jun 12 17:29:04 UTC 2017 New revision: 443455 URL: https://svnweb.freebsd.org/changeset/ports/443455 Log: MFH: r442460 Do not use gold linker for Qt5 ports. gold linker from binutils 2.28 may produce duplicate library symbols, which makes shared libraries created with it not usable with conventional ld linker. PR: 218187 Submitted by: amdmi3 Approved by: ports-secteam (miwi) Changes: _U branches/2017Q2/ branches/2017Q2/Mk/bsd.qt.mk branches/2017Q2/UPDATING branches/2017Q2/devel/qt5-core/Makefile branches/2017Q2/devel/qt5-qmake/Makefile Sorry for the timeout. |