Bug 237745 - Mk/Uses/qt-dist.mk: fix qt5 with GCC architectures
Summary: Mk/Uses/qt-dist.mk: fix qt5 with GCC architectures
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-kde (Team)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-04 06:39 UTC by Piotr Kubaj
Modified: 2019-05-26 19:27 UTC (History)
7 users (show)

See Also:


Attachments
patch (5.06 KB, patch)
2019-05-04 06:39 UTC, Piotr Kubaj
tcberner: maintainer-approval-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2019-05-04 06:39:35 UTC
Created attachment 204209 [details]
patch

Remove devel/qt5/files/extrapatch-mkspecs_freebsd-g++_qmake.conf, it's not needed.

Copy devel/qt5/files/extrapatch-mkspecs_common_bsd_bsd.conf to devel/qt5/files/extrapatch-mkspecs_common_bsd_bsd.conf-gcc and add:
EXTRA_INCLUDEPATH     += %%LOCALBASE%%/lib/gcc%%GCC_DEFAULT%%/include %%LOCALBASE%%/lib/gcc%%GCC_DEFAULT%%/include/c++

Move devel/qt5/files/extrapatch-mkspecs_common_bsd_bsd.conf to devel/qt5/files/extrapatch-mkspecs_common_bsd_bsd.conf-clang and apply on Clang architectures.

I compiled qt5-core on amd64 and powerpc64, seems to build fine.
Comment 1 Mathieu Arnold freebsd_committer 2019-05-07 13:10:39 UTC
over to the maintainer.
Comment 2 Tobias C. Berner freebsd_committer 2019-05-07 19:27:31 UTC
I still think that it should work without putting it in bsd.conf, which is just included by the compiler specific one....

I need to setup a gcc environment to figure our why it does not work.

Does it already fail at qt5-core?


Mfg Tobias
Comment 3 Piotr Kubaj freebsd_committer 2019-05-07 19:33:26 UTC
(In reply to Tobias C. Berner from comment #2)
Yes, e.g. http://pylon.nyi.freebsd.org/data/head-powerpc64-default/p500451_s346935/logs/errors/qt5-core-5.12.2_1.log
Comment 4 Piotr Kubaj freebsd_committer 2019-05-23 16:42:44 UTC
(In reply to Tobias C. Berner from comment #2)
Anything about it? With my patch, qt5 applications build and run on my ppc64 desktop.
Comment 5 Tobias C. Berner freebsd_committer 2019-05-24 04:26:59 UTC
Not yet, as I did not yet have time to setup something to test it with.
Comment 6 Piotr Kubaj freebsd_committer 2019-05-24 09:23:33 UTC
(In reply to Tobias C. Berner from comment #5)
Just if you don't know this, you can just set USE_GCC="YES" in /etc/src.conf and rebuild world.

You don't need to remove llvm.
Comment 7 Mark Millard 2019-05-24 15:22:59 UTC
Comment on attachment 204209 [details]
patch

The line:

-+EXTRA_INCLUDEPATH	+= %%LOCALBASE%%/lib/gcc%%GCC_DEFAULT%%/include %%LOCALBASE%%/lib/gcc%%GCC_DEFAULT%%/include/c++

involves multiple %%LOCALBASE%% so the substitution needs to
allow more than one substitution per line: use of "g".

In my context this looks like:

# svnlite diff/usr/ports/Mk/Uses/
Index: /usr/ports/Mk/Uses/qt-dist.mk
===================================================================
--- /usr/ports/Mk/Uses/qt-dist.mk	(revision 501994)
+++ /usr/ports/Mk/Uses/qt-dist.mk	(working copy)
@@ -251,7 +251,7 @@
 .if ${_QT_VER:M5}
 post-patch: gcc-post-patch
 gcc-post-patch:
-	${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|' \
+	${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' \
 		${WRKSRC}/mkspecs/common/gcc-base.conf \
 		${WRKSRC}/mkspecs/freebsd-g++/qmake.conf
 	${REINPLACE_CMD} 's|%%GCC_DEFAULT%%|${GCC_DEFAULT}|g' \

I and Jason Bacon were able to build devel/qt5-core with this
change to how svn has things.

(This does not address the oddity of some places having the
optional -e and others not when there is only one sed command
being fed to ${REINPLACE_CMD}.)
Comment 8 Tobias C. Berner freebsd_committer 2019-05-24 15:33:00 UTC
Pjotr, could you please check whether fixing the sed call and nothing else is enough?  You'll need to rebuild qt5-qmake too.


Mfg Tobias
Comment 9 Mark Millard 2019-05-24 15:33:36 UTC
(In reply to Mark Millard from comment #7)

I forgot to mention: powerpc64 context for building.
In my case a system-clang-8 based world, no gcc 4.2.1
present.

Side note for the system-clang-8 context:

Without another change devel/qt5-core builds but is
incoherent by having both libstdc++ and libc++/libcxxrt
involved overall in /usr/local/lib/qt5/bin/qlalr :

/usr/local/lib/libicui18n.so.64
/usr/local/lib/libicuuc.so.64

are not built by GCC (in my case gcc8/g+=8) and cause
libc++/libcxxrt to be in use in addition to the
libstdc++ from gcc parts of the build.

My temporary hack to work around the issue is as follows
but would not be appropriate for a gcc 4.2.1 environment.

@@ -171,7 +171,9 @@
                        ${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_features_qt__module.prf \
                        ${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_common_bsd_bsd.conf \
                        ${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_freebsd-clang_qmake.conf
-.        if ${ARCH:Mmips*} || ${ARCH:Mpowerpc*} || ${ARCH} == sparc64
+.        if ${ARCH:Mpowerpc64}
+               # HACK: for experimenting with a system-clang-8-based world
+.        elif ${ARCH:Mmips*} || ${ARCH:Mpowerpc*} || ${ARCH} == sparc64
 _EXTRA_PATCHES_QT5+=   ${PORTSDIR}/devel/${_QT_RELNAME}/files/extra-patch-mkspecs_common_g++-base.conf \
                        ${PORTSDIR}/devel/${_QT_RELNAME}/files/extra-patch-mkspecs_common_gcc-base.conf \
                        ${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_freebsd-g++_qmake.conf
Comment 10 Piotr Kubaj freebsd_committer 2019-05-24 17:47:02 UTC
(In reply to Mark Millard from comment #7)
Yes, this change helps.

@tcberner
Can you commit this change?
Comment 11 Tobias C. Berner freebsd_committer 2019-05-24 18:14:29 UTC
Yup, I will. Thanks for testing and the fix @mark
Comment 12 Jason W. Bacon freebsd_committer 2019-05-24 19:12:31 UTC
FYI, this small, innocuous-looking patch, provided by Mark Millard on the freebsd-ppc list, was sufficient for me to build keepassx.

There may be other issues addressed by Piotr's more extensive changes, but perhaps the patch below could be committed while that's analyzed, so we can at least build and test some of the qt5 dependents?

Index: /usr/ports/Mk/Uses/qt-dist.mk
===================================================================
--- /usr/ports/Mk/Uses/qt-dist.mk	(revision 501994)
+++ /usr/ports/Mk/Uses/qt-dist.mk	(working copy)
@@ -251,7 +251,7 @@
 .if ${_QT_VER:M5}
 post-patch: gcc-post-patch
 gcc-post-patch:
-	${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|' \
+	${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' \
 		${WRKSRC}/mkspecs/common/gcc-base.conf \
 		${WRKSRC}/mkspecs/freebsd-g++/qmake.conf
 	${REINPLACE_CMD} 's|%%GCC_DEFAULT%%|${GCC_DEFAULT}|g' \

===>   Registering installation for keepassxc-2.4.1
Installing keepassxc-2.4.1...
<<<ROOT@powermacg5.acadix>>> /usr/ports/security/keepassxc 361 # pkg info |grep qt5
qt5-buildtools-5.12.2          Qt build tools
qt5-concurrent-5.12.2          Qt multi-threading module
qt5-core-5.12.2_1              Qt core non-graphical module
qt5-dbus-5.12.2                Qt D-Bus inter-process communication module
qt5-declarative-5.12.2         Qt declarative framework for dynamic user interfaces
qt5-gui-5.12.2                 Qt graphical user interface module
qt5-linguisttools-5.12.2       Qt localization tools
qt5-network-5.12.2_1           Qt network module
qt5-qmake-5.12.2               Qt Makefile generator
qt5-sql-5.12.2                 Qt SQL database integration module
qt5-svg-5.12.2                 Qt SVG support module
qt5-testlib-5.12.2             Qt unit testing module
qt5-widgets-5.12.2             Qt C++ widgets module
qt5-x11extras-5.12.2           Qt platform-specific features for X11-based systems
qt5-xml-5.12.2                 Qt SAX and DOM implementations
qt5-xmlpatterns-5.12.2         Qt support for XPath, XQuery, XSLT and XML Schema
quazip-qt5-0.7.6_2             Qt/C++ wrapper for ZIP/UNZIP package
Comment 13 Jason W. Bacon freebsd_committer 2019-05-25 19:54:38 UTC
Add print/qpdfview and x11/lumina to the ports that build on powerpc64 following the simple reinplace patch.

Since powerpc64 packages are only built for quarterly snapshots, it would be nice to have a fix committed before the next branch.
Comment 14 commit-hook freebsd_committer 2019-05-25 20:03:28 UTC
A commit references this bug:

Author: tcberner
Date: Sat May 25 20:02:56 UTC 2019
New revision: 502628
URL: https://svnweb.freebsd.org/changeset/ports/502628

Log:
  qt5: fix build on gcc architectures

  - the sed call was only replacing one of the %%LOCALBASE%% by ${LOCALBASE},
    due to the missing 'g' flag to the sed call.

  - with this change the gcc architectures should be able to build Qt5 again.

  PR:		237745
  Submitted by:	Mark Millard <marklmi26-fbsd@yahoo.com>, jwb
  Reported by:	pkubaj

Changes:
  head/Mk/Uses/qt-dist.mk
  head/devel/qt5-qmake/Makefile
Comment 15 commit-hook freebsd_committer 2019-05-25 20:54:17 UTC
A commit references this bug:

Author: tcberner
Date: Sat May 25 20:53:14 UTC 2019
New revision: 502634
URL: https://svnweb.freebsd.org/changeset/ports/502634

Log:
  MFH: r499101 r499116 r502628

  Fix build when using GCC. Needed by GCC architectures.

  Tested for no breakage on amd64 with Clang.

  PR:	235921
  Reviewed by:	tcberner
  Approved by:	tcberner (mentor)

  devel/qt5: Follow-up to r499101

  - Move the GCC related path fix into freebsd-g++/qmake.conf
    Otherwise the inclusion of the GCC path would break clang
    based systems when gcc-${GCC_DEFAULT} was installed.

  - This might break GCC architectures again, and if so, that
    will be fixed in a follow up commit.

  PR:		235921

  qt5: fix build on gcc architectures

  - the sed call was only replacing one of the %%LOCALBASE%% by ${LOCALBASE},
    due to the missing 'g' flag to the sed call.

  - with this change the gcc architectures should be able to build Qt5 again.

  PR:		237745
  Submitted by:	Mark Millard <marklmi26-fbsd@yahoo.com>, jwb
  Reported by:	pkubaj

  Approved by:	ports-secteam (joneum via irc)

Changes:
_U  branches/2019Q2/
  branches/2019Q2/Mk/Uses/qt-dist.mk
  branches/2019Q2/devel/qt5/files/extrapatch-mkspecs_freebsd-g++_qmake.conf
  branches/2019Q2/devel/qt5-qmake/Makefile
Comment 16 Mark Linimon freebsd_committer freebsd_triage 2019-05-26 19:27:08 UTC
(In reply to Jason W. Bacon from comment #13)

Yes, it was nice to get the change into quarterly ... but, actually, powerpc64 packages are built for both 12-STABLE quarterly and 13-CURRENT.

fwiw, this change has not yet propogated to either.