Skip to content

Commit 618a9f3

Browse files
bryan-minimalclaude
andcommitted
shadow: fix 4.20.0 build under gcc 15 (-include stdint.h -D_GNU_SOURCE)
shadow 4.20.0's new code trips gcc 15's stricter defaults (implicit declarations are hard errors): find_new_sub_{uid,gid}s.c use uintmax_t without <stdint.h>, and chkname.c uses strdupa without _GNU_SOURCE. Fixed via CFLAGS rather than per-file patches. Verified with a cold local build of shadow 4.20.0. Co-Authored-By: Claude Opus <noreply@anthropic.com>
1 parent 6b7a363 commit 618a9f3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

packages/shadow/build.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ case $(uname -m) in
2222
aarch64) MARCH="-march=armv8-a" ;;
2323
*) MARCH="" ;;
2424
esac
25-
export CFLAGS="$MARCH -O2 -pipe -gno-record-gcc-switches -ffile-prefix-map=$(pwd)=/builddir"
25+
# shadow 4.20.0 doesn't build clean under gcc 15's stricter defaults (implicit
26+
# declarations are now hard errors):
27+
# - find_new_sub_{uid,gid}s.c use uintmax_t without <stdint.h> -> force-include it.
28+
# - chkname.c uses the GNU extension strdupa without _GNU_SOURCE in effect
29+
# -> define it globally so string.h declares it (a missing declaration would
30+
# otherwise be silently miscompiled as int-returning).
31+
# Applied via flags rather than per-file patches: version-agnostic and covers
32+
# any sibling TUs with the same latent omissions.
33+
export CFLAGS="$MARCH -O2 -pipe -gno-record-gcc-switches -ffile-prefix-map=$(pwd)=/builddir -include stdint.h -D_GNU_SOURCE"
2634
export LDFLAGS="-Wl,--build-id=none"
2735
export CXXFLAGS="${CFLAGS}"
2836

0 commit comments

Comments
 (0)