···21 # Fix warnings from preprocessor instructions.
22 # https://github.com/NixOS/nixpkgs/issues/59929
23 ./preprocessor-warnings.patch
0024 ];
2526 enableParallelBuilding = true;
···55 # cross-compiling, but `autoreconfHook` brings in `makeWrapper` which
56 # doesn't work with the bootstrapTools bash, so can only do this for
57 # cross builds when `stdenv.shell` is a newer bash.
58- ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) autoreconfHook;
0000005960 meta = {
61 description = "ELF object file access library";
···21 # Fix warnings from preprocessor instructions.
22 # https://github.com/NixOS/nixpkgs/issues/59929
23 ./preprocessor-warnings.patch
24+ # `configure` defines a test `main` with an implicit `int` return, which clang 16 disallows.
25+ ./fix-configure-main.patch
26 ];
2728 enableParallelBuilding = true;
···57 # cross-compiling, but `autoreconfHook` brings in `makeWrapper` which
58 # doesn't work with the bootstrapTools bash, so can only do this for
59 # cross builds when `stdenv.shell` is a newer bash.
60+ ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform
61+ # The provided `configure` script fails on clang 16 because some tests have a `main`
62+ # returning an implicit `int`, which clang 16 treats as an error. Running `autoreconf` fixes
63+ # the test and allows `configure` to detect clang properly.
64+ # This is done only for clang on Darwin because the Darwin stdenv bootstrap does not use
65+ # libelf, so should be safe because it will always be run with a compatible version of bash.
66+ || (stdenv.cc.isClang && stdenv.isDarwin)) autoreconfHook;
6768 meta = {
69 description = "ELF object file access library";