From 1fc31c49b32b60ae3fd112b5cea19557650a5d7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EC=84=9D=ED=98=B8?= Date: Tue, 5 May 2026 16:57:42 +0900 Subject: [PATCH] fix: compat with llama.cpp b8390+ for Gemma 4 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two changes required when building against latest llama.cpp (tested with b8831, which contains Gemma 4 support): 1. llama/addon/addon.cpp:239 - use brace-initialization for std::atomic_bool. AppleClang 17 rejects copy-initialization from bool because std::atomic has a deleted copy constructor: error: copying variable of type 'std::atomic_bool' invokes deleted constructor 2. llama/CMakeLists.txt:132 - the 'common' target was renamed to 'llama-common' upstream. The old -lcommon flag fails to resolve because the actual dylib is now libllama-common.dylib. Verified: - npm run test:typescript passes - npm run lint passes - npm run test:standalone passes - source download --release latest + source build succeeds on macOS 15 arm64 (M-series), AppleClang 17, Node.js 22.15, Metal Signed-off-by: 정석호 --- llama/CMakeLists.txt | 2 +- llama/addon/addon.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llama/CMakeLists.txt b/llama/CMakeLists.txt index efd8fce4..76949abe 100644 --- a/llama/CMakeLists.txt +++ b/llama/CMakeLists.txt @@ -129,7 +129,7 @@ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC} ${GPU_INFO_HE set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node") target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB}) target_link_libraries(${PROJECT_NAME} "llama") -target_link_libraries(${PROJECT_NAME} "common") +target_link_libraries(${PROJECT_NAME} "llama-common") if (DEFINED GPU_INFO_EXTRA_LIBS) target_link_libraries(${PROJECT_NAME} ${GPU_INFO_EXTRA_LIBS}) diff --git a/llama/addon/addon.cpp b/llama/addon/addon.cpp index eb1f35bf..cda2681a 100644 --- a/llama/addon/addon.cpp +++ b/llama/addon/addon.cpp @@ -236,7 +236,7 @@ Napi::Value addonSetNuma(const Napi::CallbackInfo& info) { } Napi::Value markLoaded(const Napi::CallbackInfo& info) { - static std::atomic_bool loaded = false; + static std::atomic_bool loaded{false}; return Napi::Boolean::New(info.Env(), loaded.exchange(true)); }