From d9d1319442a75a26004cae23c37538f1f6506c25 Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl <43588962+bernhardkaindl@users.noreply.github.com> Date: Fri, 5 Nov 2021 19:06:31 +0100 Subject: qt: replace conflicts('%gcc@11:', when='@5.9:5.14') with -include limits (#27241) Noting that missing numeric_limits was the cause of the compile issues with gcc-11, I tested adding -include limits fixing @5.9:5.14%gcc@11. Therefore, we can replace the conflicts('%gcc@11:', when='@5.9:5.14'). Co-authored-by: Bernhard Kaindl --- var/spack/repos/builtin/packages/qt/package.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index 3ae30033dc..2b96ddde3d 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -143,8 +143,7 @@ class Qt(Package): working_dir='qtwebsockets', when='@5.14: %gcc@11:') conflicts('%gcc@10:', when='@5.9:5.12.6 +opengl') - # Error: 'numeric_limits' is not a class template - conflicts('%gcc@11:', when='@5.8:5.14') + conflicts('%gcc@11:', when='@5.8') # Build-only dependencies depends_on("pkgconfig", type='build') @@ -418,6 +417,11 @@ class Qt(Package): filter_file('^QMAKE_LFLAGS_NOUNDEF .*', 'QMAKE_LFLAGS_NOUNDEF = ', conf('g++-unix')) + # https://gcc.gnu.org/gcc-11/porting_to.html: add -include limits + if self.spec.satisfies('@5.9:5.14%gcc@11:'): + with open(conf('gcc-base'), 'a') as f: + f.write("QMAKE_CXXFLAGS += -include limits\n") + if self.spec.satisfies('@4'): # The gnu98 flag is necessary to build with GCC 6 and other modern # compilers (see http://stackoverflow.com/questions/10354371/); -- cgit v1.2.3-70-g09d2