Skip to content

Commit 40fbdb4

Browse files
committed
fix: replace BoringSSL with BUILD_SHARED_LIBS=OFF + disable curl/ssl
LLAMA_BUILD_BORINGSSL doesn't exist in this fork's CMakeLists.txt — the flag was silently ignored, binary still linked Homebrew OpenSSL. Correct approach: disable curl and OpenSSL entirely, build all libs statically. Produces a single self-contained binary with only system dylibs (libSystem, libc++, Metal frameworks). - BUILD_SHARED_LIBS=OFF — links libllama, libggml etc. statically - LLAMA_CURL=OFF — no curl dependency, no HF model download - LLAMA_OPENSSL=OFF — no OpenSSL/crypto dependency - hw.ncpu instead of hw.logicalcpu (correct macOS sysctl key) - Verification step: fail CI if any non-system dylib found Made-with: Cursor
1 parent b1f2a49 commit 40fbdb4

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

.github/workflows/build-turboquant-macos.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ jobs:
4747
sysctl -a
4848
cmake -B build \
4949
-DCMAKE_BUILD_TYPE=Release \
50-
-DCMAKE_INSTALL_RPATH='@loader_path' \
51-
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
52-
-DLLAMA_BUILD_BORINGSSL=ON \
50+
-DBUILD_SHARED_LIBS=OFF \
51+
-DLLAMA_CURL=OFF \
52+
-DLLAMA_OPENSSL=OFF \
5353
-DGGML_METAL=ON \
5454
-DGGML_METAL_USE_BF16=ON \
5555
-DGGML_METAL_EMBED_LIBRARY=ON \
5656
-DLLAMA_BUILD_SERVER=ON \
5757
-DLLAMA_BUILD_TOOLS=ON \
5858
-DLLAMA_BUILD_TESTS=OFF \
5959
-DLLAMA_BUILD_EXAMPLES=OFF
60-
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
60+
cmake --build build --config Release -j $(sysctl -n hw.ncpu)
6161
6262
- name: Verify turbo3 support
6363
run: |
@@ -66,14 +66,17 @@ jobs:
6666
file ./build/bin/llama-server
6767
./build/bin/llama-server --version 2>&1 || true
6868
69-
- name: Verify BoringSSL static linkage
69+
- name: Verify static binary
7070
run: |
71-
echo "=== Checking for dynamic SSL/crypto (should be empty) ==="
72-
if otool -L build/bin/llama-server | grep -iE 'ssl|crypto|homebrew'; then
73-
echo "ERROR: Found dynamic SSL/crypto linkage — BoringSSL not static!"
71+
echo "=== All dynamic dependencies (should be system-only) ==="
72+
otool -L build/bin/llama-server
73+
echo "---"
74+
echo "=== Checking for non-system dylibs (should be empty) ==="
75+
if otool -L build/bin/llama-server | grep -vE '/usr/lib|/System|llama-server' | grep '\.dylib'; then
76+
echo "ERROR: Found non-system dynamic dependency!"
7477
exit 1
7578
fi
76-
echo "OK: No dynamic SSL/cryptoBoringSSL is statically linked"
79+
echo "OK: Only system dylibsfully self-contained binary"
7780
echo "---"
7881
echo "=== Binary size ==="
7982
ls -lh build/bin/llama-server

0 commit comments

Comments
 (0)