Skip to content

Conversation

@angt
Copy link
Collaborator

@angt angt commented Nov 6, 2025

This commit adds an easy way to fetch, build, and statically link the BoringSSL library when LLAMA_BUILD_BORINGSSL is enabled.

The version can be set via the LLAMA_BORINGSSL_VERSION cache variable.

This commit adds an easy way to fetch, build, and statically link the
BoringSSL library when LLAMA_BUILD_BORINGSSL is enabled.

The version can be set via the LLAMA_BORINGSSL_VERSION cache variable.

Signed-off-by: Adrien Gallouët <[email protected]>
@ggerganov
Copy link
Member

Few observations:

  • On Mac builds, there are quite a lot of compile warnings when building BoringSSL. Need to disable those
  • The SSL stuff is now embedded in all tools and examples increasing their binary size. We should build a shared libllama-common library
  • Do we need to create some CI workflows to make sure BSSL builds are succssful?

@angt
Copy link
Collaborator Author

angt commented Nov 7, 2025

  • The SSL stuff is now embedded in all tools and examples increasing their binary size. We should build a shared libllama-common library

As a quick fix, I can support BUILD_SHARED_LIBS=ON by just renaming our libssl to libllama-ssl to avoid conflicts:

build/bin/llama-server:
        @rpath/libmtmd.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libllama-ssl.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libllama-crypto.dylib (compatibility version 0.0.0, current version 0.0.0)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 4040.1.255)
        /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 61901.0.87)
        @rpath/libllama.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libggml.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libggml-cpu.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libggml-blas.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libggml-metal.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libggml-base.dylib (compatibility version 0.0.0, current version 0.0.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 2000.63.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1356.0.0)
  • Do we need to create some CI workflows to make sure BSSL builds are succssful?

Yes, my plan is to progressively remove curl in the CI, step by step, until it’s completely gone.
Also I don’t expect most users to actually use the BoringSSL build, for almost everyone LLAMA_OPENSSL should be enough.

Signed-off-by: Adrien Gallouët <[email protected]>
option(LLAMA_LLGUIDANCE "llama-common: include LLGuidance library for structured output in common utils" OFF)
option(LLAMA_CURL "llama: use libcurl to download model from an URL" ON)
option(LLAMA_OPENSSL "llama: use openssl to support HTTPS" OFF)
option(LLAMA_BUILD_BORINGSSL "llama: build and statically link BoringSSL" OFF)
Copy link
Member

@ggerganov ggerganov Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to call this LLAMA_BUILD_BORINGSSL instead of the more consistent LLAMA_BORINGSSL?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to emphasize that we don’t just use BoringSSL (like we use OpenSSL with LLAMA_OPENSSL), but actually build it. But we can definitely use LLAMA_BORINGSSL.

Also, I think we can simply use BORINGSSL_VERSION to specify the version?

@taronaeo
Copy link
Collaborator

taronaeo commented Nov 8, 2025

Quick heads up, BoringSSL does not support the s390x platform due to endianness issues. So if possible for CI tests, exclude s390x from the BoringSSL tests.

Signed-off-by: Adrien Gallouët <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Compilation issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants