From 8bdfaf4ae58668a45cbcb483e76ac995da54e31e Mon Sep 17 00:00:00 2001 From: Aiden Grossman <39388941+boomanaiden154@users.noreply.github.com> Date: Wed, 26 Jul 2023 07:46:37 -0700 Subject: 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. --- var/spack/repos/builtin/packages/libelf/package.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'var') 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) -- cgit v1.2.3-60-g2f50