summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Johnson <glenn-johnson@uiowa.edu>2021-11-13 14:39:50 -0600
committerGitHub <noreply@github.com>2021-11-13 15:39:50 -0500
commit7a00cef055e5864f72e8d7dbd9e8bd2097e538d0 (patch)
tree5134a08189ab016968c207eae3d0c708300d30c4
parent9fb9399487eab04238d99a3b8220f324d672768b (diff)
downloadspack-7a00cef055e5864f72e8d7dbd9e8bd2097e538d0.tar.gz
spack-7a00cef055e5864f72e8d7dbd9e8bd2097e538d0.tar.bz2
spack-7a00cef055e5864f72e8d7dbd9e8bd2097e538d0.tar.xz
spack-7a00cef055e5864f72e8d7dbd9e8bd2097e538d0.zip
qt: turn off features if not supported by the kernel (#27438)
If building Qt on a system with a recent glibc but an older kernel, it is possible that Qt configures features based on glibc that are not supported in the kernel. This PR tests the kernel version and ensures certain features are disabled if the kernel does not support them.
-rw-r--r--var/spack/repos/builtin/packages/qt/package.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py
index 2b96ddde3d..324d29ad42 100644
--- a/var/spack/repos/builtin/packages/qt/package.py
+++ b/var/spack/repos/builtin/packages/qt/package.py
@@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import itertools
import os
+import platform
import sys
import llnl.util.tty as tty
@@ -12,6 +13,7 @@ from spack import *
from spack.operating_systems.mac_os import macos_version
MACOS_VERSION = macos_version() if sys.platform == 'darwin' else None
+LINUX_VERSION = Version(platform.release()) if platform.system() == 'Linux' else None
class Qt(Package):
@@ -637,6 +639,20 @@ class Qt(Package):
config_args.append('-I{0}/include'.format(spec['libx11'].prefix))
config_args.append('-I{0}/include'.format(spec['xproto'].prefix))
+ # If the version of glibc is new enough Qt will configure features that
+ # may not be supported by the kernel version on the system. This will
+ # cause errors like:
+ # error while loading shared libraries: libQt5Core.so.5: cannot open
+ # shared object file: No such file or directory
+ # Test the kernel version and disable features that Qt detects in glibc
+ # but that are not supported in the kernel as determined by information
+ # in: qtbase/src/corelib/global/minimum-linux_p.h.
+ if LINUX_VERSION and version >= Version('5.10'):
+ if LINUX_VERSION < Version('3.16'):
+ config_args.append('-no-feature-renameat2')
+ if LINUX_VERSION < Version('3.17'):
+ config_args.append('-no-feature-getentropy')
+
if '~webkit' in spec:
config_args.extend([
'-skip',