Merge pull request #7231 from Kelimion/fix-7177

Fix #7177
This commit is contained in:
Jeroen van Rijn
2026-08-05 14:24:17 +02:00
committed by GitHub
2 changed files with 13 additions and 6 deletions

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d698fbbe655db1d1ec6f52dcc23bfed4a2c981fa88040ba449f9f83609edba88
size 3137140
oid sha256:ad5491b77cda430ee03adb68bd6b4d56d3f7d8941327643eecc2b636496acda0
size 1601114

View File

@@ -70,12 +70,19 @@ Darwin)
;;
Linux)
LIB_DIR="../lib/linux-$ARCH"
mkdir -p "$LIB_DIR"
$cc -c -O2 -std=c17 -fPIC -Iinclude src/*.c
$ar rcs "$LIB_DIR/$LIB_NAME" ./*.o
rm ./*.o
mkdir -p "$LIB_DIR" build
for src in src/*.c; do
obj="build/$(basename "${src%.c}.o")"
$cc -c -O2 -std=c17 -fPIC -Iinclude "$src" -o "$obj"
done
# Clean up old library in case `ar` is tempted to preserve old symbols
rm -f "$LIB_DIR/$LIB_NAME"
$ar rcs "$LIB_DIR/$LIB_NAME" build/*.o
$ranlib "$LIB_DIR/$LIB_NAME"
rm -rf build
;;
*)
echo "Error: Unsupported operating system: $(uname -s)"
exit 1
;;