p0f: fix build for GCC 14 (#404305)

This commit is contained in:
Robert Scott
2025-05-05 15:04:20 +01:00
committed by GitHub
2 changed files with 15 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
diff --git a/build.sh b/build.sh
index f674433..f181344 100755
--- a/build.sh
+++ b/build.sh
@@ -197,7 +197,7 @@ echo -n "[*] Checking if memory alignment is required... "
rm -f "$TMP" "$TMP.c" "$TMP.log" || exit 1
-echo -e "#include \"types.h\"\nvolatile u8 tmp[6]; int main() { printf(\"%d\x5cn\", *(u32*)(tmp+1)); return 0; }" >"$TMP.c" || exit 1
+echo -e "#include \"types.h\"\n#include \"stdio.h\"\nvolatile u8 tmp[6]; int main() { printf(\"%d\x5cn\", *(u32*)(tmp+1)); return 0; }" >"$TMP.c" || exit 1
$CC $USE_CFLAGS $USE_LDFLAGS "$TMP.c" -o "$TMP" &>"$TMP.log"
if [ ! -x "$TMP" ]; then
+2
View File
@@ -17,6 +17,8 @@ stdenv.mkDerivation rec {
buildInputs = [ libpcap ];
patches = [ ./build-stdio.patch ];
buildPhase = ''
substituteInPlace config.h --replace "p0f.fp" "$out/etc/p0f.fp"
substituteInPlace build.sh --replace "/bin/bash" "${bash}/bin/bash"