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.
This commit is contained in:
Aiden Grossman
2023-07-26 07:46:37 -07:00
committed by GitHub
parent eb19f59fb1
commit 8bdfaf4ae5

View File

@@ -50,3 +50,10 @@ def configure_args(self):
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)