fix build for qt5 and the Intel compiler (#14387)

* Set conflicts for qt5 and the Intel compiler

This PR sets a `conflicts` statement for QT5 and the Intel compiler.

* New patches for intel compiles

This commit adds two patches to get QT5 to compile with the intel
compilers. The two patches are very similar but the file being patched
was changed substantially between qt-5.11 and qt-5.12. The patch checks
versions of both GCC and Intel compilers to know when to use overflow
builtis. Essentially, GCC must be >= 5 and Intel must be >= 18.

The sqlite dependency needs the `+column_metadata` variant when the
Intel compiler is used. That is made conditional on the compiler but it
might make sense to make that the default for the sqlite dependency.

Some other changes were made based on testing builds of various QT5
versions with several Intel compilers.

- The libxext dependency is still needed for QT5
- A dependency on libxrender is needed
- The gtk option format needs to be constrained at the qt@5.7 level, not
  qt@5.8.
- An extra configure option is needed for the sql plugins RPATH
This commit is contained in:
Glenn Johnson 2020-01-08 13:02:37 -06:00 committed by Adam J. Stewart
parent f79649d2e3
commit 4a84155caa
3 changed files with 35 additions and 3 deletions

View File

@ -117,6 +117,10 @@ class Qt(Package):
patch('qt4-gcc8.3-asm-volatile-fix.patch', when='@4')
patch('qt5-gcc8.3-asm-volatile-fix.patch', when='@5.0.0:5.12.1')
# patch overflow builtins
patch('qt5_11-intel-overflow.patch', when='@5.11')
patch('qt5_12-intel-overflow.patch', when='@5.12:')
# Build-only dependencies
depends_on("pkgconfig", type='build')
depends_on("flex", when='+webkit', type='build')
@ -135,6 +139,7 @@ class Qt(Package):
depends_on("gtkplus", when='+gtk')
depends_on("openssl", when='+ssl')
depends_on("sqlite", when='+sql', type=('build', 'run'))
depends_on("sqlite+column_metadata", when='+sql%intel', type=('build', 'run'))
depends_on("libpng@1.2.57", when='@3')
depends_on("pcre+multibyte", when='@5.0:5.8')
@ -160,7 +165,8 @@ class Qt(Package):
depends_on("xcb-util-keysyms")
depends_on("xcb-util-renderutil")
depends_on("xcb-util-wm")
depends_on("libxext", when='@3:4.99')
depends_on("libxext")
depends_on("libxrender")
conflicts('+framework',
msg="QT cannot be built as a framework except on macOS.")
else:
@ -342,7 +348,11 @@ def common_config_args(self):
config_args.append('-no-openssl')
if '+sql' in self.spec:
config_args.append('-system-sqlite')
sqlite = self.spec['sqlite']
config_args.extend([
'-system-sqlite',
'-R', '{0}'.format(sqlite.prefix.lib),
])
else:
comps = ['db2', 'ibase', 'oci', 'tds', 'mysql', 'odbc', 'psql',
'sqlite', 'sqlite2']
@ -504,7 +514,7 @@ def configure(self, spec, prefix):
'-no-directfb',
'-{0}gtk{1}'.format(
'' if '+gtk' in spec else 'no-',
'' if version >= Version('5.8') else 'style')
'' if version >= Version('5.7') else 'style')
])
if MACOS_VERSION:

View File

@ -0,0 +1,11 @@
--- a/qtbase/src/corelib/global/qnumeric_p.h 2018-11-25 06:51:11.000000000 -0600
+++ b/qtbase/src/corelib/global/qnumeric_p.h 2020-01-07 14:13:12.103818264 -0600
@@ -168,7 +168,7 @@
// size_t. Implementations for 8- and 16-bit types will work but may not be as
// efficient. Implementations for 64-bit may be missing on 32-bit platforms.
-#if (defined(Q_CC_GNU) && (Q_CC_GNU >= 500) || (defined(Q_CC_INTEL) && !defined(Q_OS_WIN))) || QT_HAS_BUILTIN(__builtin_add_overflowx)
+#if (defined(Q_CC_GNU) && (Q_CC_GNU >= 500) && !defined(Q_CC_INTEL) || (defined(Q_CC_INTEL) && (Q_CC_INTEL >= 1800) && (Q_CC_GNU >= 500) && !defined(Q_OS_WIN))) || QT_HAS_BUILTIN(__builtin_add_overflowx)
// GCC 5, ICC 18, and Clang 3.8 have builtins to detect overflows
template <typename T> inline

View File

@ -0,0 +1,11 @@
--- a/qtbase/src/corelib/global/qnumeric_p.h 2019-08-31 03:29:31.000000000 -0500
+++ b/qtbase/src/corelib/global/qnumeric_p.h 2020-01-06 14:23:40.719851927 -0600
@@ -231,7 +231,7 @@
// size_t. Implementations for 8- and 16-bit types will work but may not be as
// efficient. Implementations for 64-bit may be missing on 32-bit platforms.
-#if (defined(Q_CC_GNU) && (Q_CC_GNU >= 500) || (defined(Q_CC_INTEL) && !defined(Q_OS_WIN))) || QT_HAS_BUILTIN(__builtin_add_overflow)
+#if (defined(Q_CC_GNU) && (Q_CC_GNU >= 500) && !defined(Q_CC_INTEL) || (defined(Q_CC_INTEL) && (Q_CC_INTEL >= 1800) && (Q_CC_GNU >= 500) && !defined(Q_OS_WIN))) || QT_HAS_BUILTIN(__builtin_add_overflow)
// GCC 5, ICC 18, and Clang 3.8 have builtins to detect overflows
template <typename T> inline