Bug 235921 - Mk/Uses/qt-dist.mk: fix build with GCC-based architectures
Summary: Mk/Uses/qt-dist.mk: fix build with GCC-based 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-02-21 19:09 UTC by Piotr Kubaj
Modified: 2019-05-25 20:54 UTC (History)
4 users (show)

See Also:
tcberner: maintainer-feedback+
pkubaj: merge-quarterly?


Attachments
patch (2.68 KB, patch)
2019-02-21 19:09 UTC, Piotr Kubaj
no flags Details | Diff
v2 (1.38 KB, patch)
2019-03-05 13:29 UTC, Piotr Kubaj
no flags Details | Diff
v3 (1.97 KB, patch)
2019-03-12 07:48 UTC, Piotr Kubaj
no flags 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-02-21 19:09:51 UTC
Created attachment 202236 [details]
patch

Qt 5.12.1 made building with GCC on FreeBSD fail. Fix this by adding relevant system directories to QMAKE_DEFAULT_INCDIRS and QMAKE_DEFAULT_LIBDIRS since they are not added automatically when building with GCC (only with Clang).

Also add %%LOCALBASE%%/lib/gcc%%GCC_DEFAULT%%/include and %%LOCALBASE%%/lib/gcc%%GCC_DEFAULT%%/include/c++ to EXTRA_INCLUDEPATH so that headers in those directories are detected during configuring.

Tested by Poudriere build of devel/qt5 on powerpc64 and amd64.

Hardware sponsored by IntegriCloud.
Comment 1 Piotr Kubaj freebsd_committer 2019-03-05 13:29:11 UTC
Created attachment 202578 [details]
v2

Remove the commented out lines used for debugging.
Comment 2 Piotr Kubaj freebsd_committer 2019-03-12 07:48:06 UTC
Created attachment 202806 [details]
v3

Add the part with devel/qt5/files/extrapatch-mkspecs_common_bsd_bsd.conf, removed earlier by mistake.
Comment 3 Tobias C. Berner freebsd_committer 2019-03-21 07:42:22 UTC
Sorry forcthe timeout. I'll look at it this weekend.

Mfg Tobias
Comment 4 Raphael Kubo da Costa freebsd_committer 2019-03-24 19:40:29 UTC
> -	${ECHO_CMD} 'QMAKE_DEFAULT_LIBDIRS = ${LOCALBASE}/lib' >> ${CONFIGURE_WRKSRC}/.qmake.cache
> -	${ECHO_CMD} 'QMAKE_DEFAULT_INCDIRS = ${LOCALBASE}/include' >> ${CONFIGURE_WRKSRC}/.qmake.cache
> +	${ECHO_CMD} 'QMAKE_DEFAULT_LIBDIRS += ${LOCALBASE}/lib /usr/lib /lib' >> ${CONFIGURE_WRKSRC}/.qmake.cache
> +	${ECHO_CMD} 'QMAKE_DEFAULT_INCDIRS += ${LOCALBASE}/include /usr/include' >> ${CONFIGURE_WRKSRC}/.qmake.cache

Can you explain why this is necessary? /usr/lib, /lib and /usr/include should all be part of the standard search paths.

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

Wouldn't that cause those lines to be included even one's not using GCC? Plus, aren't those added automatically by GCC itself?
Comment 5 Piotr Kubaj freebsd_committer 2019-04-16 15:35:05 UTC
(In reply to Raphael Kubo da Costa from comment #4)
"Can you explain why this is necessary? /usr/lib, /lib and /usr/include should all be part of the standard search paths."
Apparently that is true when you build using Clang, but not when using GCC.


"Wouldn't that cause those lines to be included even one's not using GCC? Plus, aren't those added automatically by GCC itself?"
I tried building QT with this patch on amd64 with Clang, it works. GCC from ports doesn't add those arguments automatically.
Comment 6 commit-hook freebsd_committer 2019-04-16 17:31:51 UTC
A commit references this bug:

Author: pkubaj
Date: Tue Apr 16 17:31:19 UTC 2019
New revision: 499101
URL: https://svnweb.freebsd.org/changeset/ports/499101

Log:
  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)

Changes:
  head/Mk/Uses/qt-dist.mk
  head/devel/qt5/files/extrapatch-mkspecs_common_bsd_bsd.conf
Comment 7 Piotr Kubaj freebsd_committer 2019-04-16 17:33:18 UTC
Fixed.
Comment 8 commit-hook freebsd_committer 2019-04-16 19:37:36 UTC
A commit references this bug:

Author: tcberner
Date: Tue Apr 16 19:37:12 UTC 2019
New revision: 499116
URL: https://svnweb.freebsd.org/changeset/ports/499116

Log:
  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

Changes:
  head/Mk/Uses/qt-dist.mk
  head/devel/qt5/files/extrapatch-mkspecs_common_bsd_bsd.conf
  head/devel/qt5/files/extrapatch-mkspecs_freebsd-g++_qmake.conf
Comment 9 commit-hook freebsd_committer 2019-05-25 20:54:12 UTC
A commit references this bug:

Author: tcberner
Date: Sat May 25 20:53:13 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 10 commit-hook freebsd_committer 2019-05-25 20:54:15 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