fix(build): GCC15 segfault fallback, bin dir fix, check_nfqws --version

This commit is contained in:
Auto Fix
2026-05-11 08:22:56 +04:00
parent cdd49369a5
commit e47a7e2461
8 changed files with 26 additions and 9 deletions

0
.env.example Normal file → Executable file
View File

0
.gitignore vendored Normal file → Executable file
View File

0
PROJECT.md Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

View File

@@ -114,21 +114,36 @@ if [ ! -f "$BUILD_DIR/zapret/nfq/nfqws" ]; then
fi
# Verify the binary actually runs (catch segfaults early)
if ! "$BUILD_DIR/zapret/nfq/nfqws" --help >/dev/null 2>&1; then
echo "[!] nfqws segfaults with current flags. Rebuilding without strip..."
if ! "$BUILD_DIR/zapret/nfq/nfqws" --help > /dev/null 2>&1; then
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
make -C nfq clean && 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
if ! "$BUILD_DIR/zapret/nfq/nfqws" --help > /dev/null 2>&1; then
echo "[!] nfqws still segfaults with -O0. Last attempt: disable LTO + gc-sections..."
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
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/"
chmod +x "$BIN_DIR/nfqws"

View File

@@ -112,8 +112,9 @@ describe_strategy() {
esac
}
# Verify the binary actually runs (catches segfaults/missing deps)
check_nfqws() {
if [[ ! -x "$BIN_DIR/nfqws" ]]; then
if [[ ! -f "$BIN_DIR/nfqws" ]] || [[ ! -x "$BIN_DIR/nfqws" ]]; then
echo ""
print_red "ERROR: nfqws binary not found!"
echo ""
@@ -122,8 +123,9 @@ check_nfqws() {
echo ""
return 1
fi
# Verify the binary actually runs (catches segfaults/missing deps)
if ! "$BIN_DIR/nfqws" --help >/dev/null 2>&1; then
# Verify the binary actually runs (catches segfaults/missing deps).
# Use --version because --help exits with code 1 in zapret.
if ! "$BIN_DIR/nfqws" --version >/dev/null 2>&1; then
echo ""
print_red "ERROR: nfqws binary exists but does not run (segfault? missing deps?)"
echo ""

2
lists/ipset-exclude.txt Normal file → Executable file
View File

@@ -8,4 +8,4 @@
100.64.0.0/10
::1
fc00::/7
fe80::/10
fe80::/10

0
lists/list-google.txt Normal file → Executable file
View File