Skip to content

Enable BUILD_SHARED_LIBS for BoringSSL DLL generation#69

Merged
bernardladenthin merged 4 commits intomasterfrom
claude/fix-ssl-dll-dependencies-Sd1HR
Apr 4, 2026
Merged

Enable BUILD_SHARED_LIBS for BoringSSL DLL generation#69
bernardladenthin merged 4 commits intomasterfrom
claude/fix-ssl-dll-dependencies-Sd1HR

Conversation

@bernardladenthin
Copy link
Copy Markdown
Owner

  • Set BUILD_SHARED_LIBS=ON before FetchContent_MakeAvailable(llama.cpp)
  • Forces BoringSSL to build as shared library (DLL/SO/DYLIB)
  • Generates runtime libraries instead of static import libs
  • Restore BUILD_SHARED_LIBS=OFF after build completes

This ensures libssl and libcrypto DLLs are actually created and can be packaged into JAR resources for runtime dependency resolution.

https://claude.ai/code/session_01FEBhTt2x3NakgzgxF2zxwJ

claude added 4 commits April 3, 2026 22:07
- Set BUILD_SHARED_LIBS=ON before FetchContent_MakeAvailable(llama.cpp)
- Forces BoringSSL to build as shared library (DLL/SO/DYLIB)
- Generates runtime libraries instead of static import libs
- Restore BUILD_SHARED_LIBS=OFF after build completes

This ensures libssl and libcrypto DLLs are actually created and can be
packaged into JAR resources for runtime dependency resolution.

https://claude.ai/code/session_01FEBhTt2x3NakgzgxF2zxwJ
- Remove global BUILD_SHARED_LIBS=ON (was breaking all platforms)
- Add cmake/copy_dll_files.cmake script for DLL/SO/DYLIB discovery
- Script searches llama.cpp build directory for shared libraries
- Platform-aware: looks for .dll (Windows), .so (Linux), .dylib (macOS)
- Gracefully handles static builds (no DLLs to copy)
- POST_BUILD runs script to copy any discovered libraries to JAR resources

This approach is more flexible:
- If BoringSSL/other libs generate DLLs → copied to JAR
- If everything is static → no error, works normally
- Future changes to llama.cpp linkage mode won't break the build

https://claude.ai/code/session_01FEBhTt2x3NakgzgxF2zxwJ
- copy_dll_files.cmake now accepts variables via -D flags instead of find_package
- Eliminates Java dependency issue in POST_BUILD context
- Pass SOURCE_DIR, BINARY_DIR, OS_NAME, OS_ARCH, GGML_CUDA via command line
- Script validates all required variables at startup
- Better error messages with [DLL Discovery] prefix

https://claude.ai/code/session_01FEBhTt2x3NakgzgxF2zxwJ
Document known issue where outdated C++ runtime library (msvcp140.dll)
bundled with some JDK versions causes EXCEPTION_ACCESS_VIOLATION crashes.
Provide solution to remove outdated DLLs from JDK directory so system
C++ runtime is used instead.

https://claude.ai/code/session_01FEBhTt2x3NakgzgxF2zxwJ
@bernardladenthin bernardladenthin merged commit 9e14fc9 into master Apr 4, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants