wget: fixing compilation issue with gcc11+ on rhel7 (#30858)
This commit is contained in:
parent
a05e729e1b
commit
37426e41cb
1 changed files with 10 additions and 0 deletions
|
@ -53,6 +53,16 @@ class Wget(AutotoolsPackage, GNUMirrorPackage):
|
|||
|
||||
build_directory = 'spack-build'
|
||||
|
||||
def flag_handler(self, name, flags):
|
||||
# gcc11 defaults to c17, which breaks compilation with older
|
||||
# glibc versions as shipped with rhel7 and likely other OS
|
||||
# versions too, feel free to add as necessary
|
||||
older_glibc = self.spec.satisfies('os=rhel7') or \
|
||||
self.spec.satisfies('os=centos7')
|
||||
if self.spec.satisfies('%gcc@11:') and older_glibc and name.lower() == 'cflags':
|
||||
flags.append(self.compiler.c11_flag)
|
||||
return (None, None, flags)
|
||||
|
||||
def configure_args(self):
|
||||
spec = self.spec
|
||||
|
||||
|
|
Loading…
Reference in a new issue