Skip to content

Commit 9bb6a26

Browse files
committed
p0f: fix build for GCC 14
1 parent 83c45b9 commit 9bb6a26

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/build.sh b/build.sh
2+
index f674433..f181344 100755
3+
--- a/build.sh
4+
+++ b/build.sh
5+
@@ -197,7 +197,7 @@ echo -n "[*] Checking if memory alignment is required... "
6+
7+
rm -f "$TMP" "$TMP.c" "$TMP.log" || exit 1
8+
9+
-echo -e "#include \"types.h\"\nvolatile u8 tmp[6]; int main() { printf(\"%d\x5cn\", *(u32*)(tmp+1)); return 0; }" >"$TMP.c" || exit 1
10+
+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
11+
$CC $USE_CFLAGS $USE_LDFLAGS "$TMP.c" -o "$TMP" &>"$TMP.log"
12+
13+
if [ ! -x "$TMP" ]; then

pkgs/by-name/p0/p0f/package.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ stdenv.mkDerivation rec {
1717

1818
buildInputs = [ libpcap ];
1919

20+
patches = [ ./build-stdio.patch ];
21+
2022
buildPhase = ''
2123
substituteInPlace config.h --replace "p0f.fp" "$out/etc/p0f.fp"
2224
substituteInPlace build.sh --replace "/bin/bash" "${bash}/bin/bash"

0 commit comments

Comments
 (0)