From 5066ba8dd03ca9b123c624fe33da5bc775cc3be9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 11 Oct 2025 10:09:53 -0400 Subject: [PATCH] Fix MUSL static linking by disabling glibc fortification - Add -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 to CFLAGS - Prevents __snprintf_chk and __fprintf_chk symbol errors - Required for Alpine Linux / MUSL static builds - Maintains compatibility with glibc builds --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 486e0664..bb5bc25f 100755 --- a/build.sh +++ b/build.sh @@ -530,7 +530,8 @@ for nip in $NEEDED_NIPS; do done # Build flags -CFLAGS="-Wall -Wextra -std=c99 -fPIC -O2" +# Disable fortification for MUSL compatibility (prevents __*_chk symbol issues) +CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -Wall -Wextra -std=c99 -fPIC -O2" CFLAGS="$CFLAGS -DENABLE_FILE_LOGGING -DENABLE_WEBSOCKET_LOGGING -DENABLE_DEBUG_LOGGING" INCLUDES="-I. -Inostr_core -Inostr_core/crypto -Icjson -Inostr_websocket"