fix(build): GCC15 segfault fallback, bin dir fix, check_nfqws --version
This commit is contained in:
0
.env.example
Normal file → Executable file
0
.env.example
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
PROJECT.md
Normal file → Executable file
0
PROJECT.md
Normal file → Executable file
@@ -114,21 +114,36 @@ if [ ! -f "$BUILD_DIR/zapret/nfq/nfqws" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Verify the binary actually runs (catch segfaults early)
|
# Verify the binary actually runs (catch segfaults early)
|
||||||
if ! "$BUILD_DIR/zapret/nfq/nfqws" --help >/dev/null 2>&1; then
|
if ! "$BUILD_DIR/zapret/nfq/nfqws" --help > /dev/null 2>&1; then
|
||||||
echo "[!] nfqws segfaults with current flags. Rebuilding without strip..."
|
echo "[!] nfqws segfaults with current flags. Rebuilding with -O0 (no optimizations)..."
|
||||||
|
sed -i 's/-Os/-O0/g' nfq/Makefile 2>/dev/null || true
|
||||||
sed -E -i 's/(^| )-s($| )/\1\2/g' nfq/Makefile 2>/dev/null || true
|
sed -E -i 's/(^| )-s($| )/\1\2/g' nfq/Makefile 2>/dev/null || true
|
||||||
make -C nfq clean && make -C nfq
|
make -C nfq clean && make -C nfq
|
||||||
if [ ! -f "$BUILD_DIR/zapret/nfq/nfqws" ]; then
|
if [ ! -f "$BUILD_DIR/zapret/nfq/nfqws" ]; then
|
||||||
echo "[!] nfqws binary not found after rebuild"
|
echo "[!] nfqws binary not found after rebuild"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if ! "$BUILD_DIR/zapret/nfq/nfqws" --help >/dev/null 2>&1; then
|
if ! "$BUILD_DIR/zapret/nfq/nfqws" --help > /dev/null 2>&1; then
|
||||||
echo "[!] nfqws still segfaults. Aborting."
|
echo "[!] nfqws still segfaults with -O0. Last attempt: disable LTO + gc-sections..."
|
||||||
exit 1
|
make -C nfq clean && CC=gcc CFLAGS="-std=gnu99 -O0 -g" LDFLAGS="" LIBS_LINUX="-lz -lnetfilter_queue -lnfnetlink -lmnl" make -C nfq
|
||||||
|
if [ ! -f "$BUILD_DIR/zapret/nfq/nfqws" ]; then
|
||||||
|
echo "[!] nfqws binary not found after rebuild"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! "$BUILD_DIR/zapret/nfq/nfqws" --help > /dev/null 2>&1; then
|
||||||
|
echo "[!] nfqws still segfaults. Aborting."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "$BIN_DIR"
|
mkdir -p "$BIN_DIR"
|
||||||
|
|
||||||
|
# Fix: if previous runs created bin/nfqws as a directory, remove it
|
||||||
|
if [[ -d "$BIN_DIR/nfqws" ]]; then
|
||||||
|
rm -rf "$BIN_DIR/nfqws"
|
||||||
|
fi
|
||||||
|
|
||||||
cp "$BUILD_DIR/zapret/nfq/nfqws" "$BIN_DIR/"
|
cp "$BUILD_DIR/zapret/nfq/nfqws" "$BIN_DIR/"
|
||||||
chmod +x "$BIN_DIR/nfqws"
|
chmod +x "$BIN_DIR/nfqws"
|
||||||
|
|
||||||
|
|||||||
@@ -112,8 +112,9 @@ describe_strategy() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Verify the binary actually runs (catches segfaults/missing deps)
|
||||||
check_nfqws() {
|
check_nfqws() {
|
||||||
if [[ ! -x "$BIN_DIR/nfqws" ]]; then
|
if [[ ! -f "$BIN_DIR/nfqws" ]] || [[ ! -x "$BIN_DIR/nfqws" ]]; then
|
||||||
echo ""
|
echo ""
|
||||||
print_red "ERROR: nfqws binary not found!"
|
print_red "ERROR: nfqws binary not found!"
|
||||||
echo ""
|
echo ""
|
||||||
@@ -122,8 +123,9 @@ check_nfqws() {
|
|||||||
echo ""
|
echo ""
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
# Verify the binary actually runs (catches segfaults/missing deps)
|
# Verify the binary actually runs (catches segfaults/missing deps).
|
||||||
if ! "$BIN_DIR/nfqws" --help >/dev/null 2>&1; then
|
# Use --version because --help exits with code 1 in zapret.
|
||||||
|
if ! "$BIN_DIR/nfqws" --version >/dev/null 2>&1; then
|
||||||
echo ""
|
echo ""
|
||||||
print_red "ERROR: nfqws binary exists but does not run (segfault? missing deps?)"
|
print_red "ERROR: nfqws binary exists but does not run (segfault? missing deps?)"
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
2
lists/ipset-exclude.txt
Normal file → Executable file
2
lists/ipset-exclude.txt
Normal file → Executable file
@@ -8,4 +8,4 @@
|
|||||||
100.64.0.0/10
|
100.64.0.0/10
|
||||||
::1
|
::1
|
||||||
fc00::/7
|
fc00::/7
|
||||||
fe80::/10
|
fe80::/10
|
||||||
0
lists/list-google.txt
Normal file → Executable file
0
lists/list-google.txt
Normal file → Executable file
Reference in New Issue
Block a user