summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAiden Grossman <39388941+boomanaiden154@users.noreply.github.com>2023-07-26 07:46:37 -0700
committerGitHub <noreply@github.com>2023-07-26 16:46:37 +0200
commit8bdfaf4ae58668a45cbcb483e76ac995da54e31e (patch)
tree1288b6540a005045d0caad84236267aeaa00f257 /var
parenteb19f59fb11c7c0937acd0558230f7b25672052e (diff)
downloadspack-8bdfaf4ae58668a45cbcb483e76ac995da54e31e.tar.gz
spack-8bdfaf4ae58668a45cbcb483e76ac995da54e31e.tar.bz2
spack-8bdfaf4ae58668a45cbcb483e76ac995da54e31e.tar.xz
spack-8bdfaf4ae58668a45cbcb483e76ac995da54e31e.zip
libelf: fix build with clang16+ (#38915)
libelf fails to build with clang16+ due to Wimplicit-int and Wimplicit-function-declarations becoming errors by default. This breaks the configuration stage, so no build takes place. This patch fixes this by passing -Wno-error=implicit-int and -Wno-error=implicit-function-declarations as cflags.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/libelf/package.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/libelf/package.py b/var/spack/repos/builtin/packages/libelf/package.py
index e14b97b8ee..5632464cc7 100644
--- a/var/spack/repos/builtin/packages/libelf/package.py
+++ b/var/spack/repos/builtin/packages/libelf/package.py
@@ -50,3 +50,10 @@ class Libelf(AutotoolsPackage):
def install(self, spec, prefix):
make("install", parallel=False)
+
+ def flag_handler(self, name, flags):
+ if name == "cflags":
+ if self.spec.satisfies("%clang@16:"):
+ flags.append("-Wno-error=implicit-int")
+ flags.append("-Wno-error=implicit-function-declaration")
+ return (flags, None, None)