Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSQUIC Build Issue #508

Open
mhmdreda99 opened this issue Jul 24, 2024 · 1 comment
Open

LSQUIC Build Issue #508

mhmdreda99 opened this issue Jul 24, 2024 · 1 comment

Comments

@mhmdreda99
Copy link

Problem

When building the LSQUIC project, users encountered linking errors related to C++ symbols from BoringSSL. The main issues were:

  1. The project was configured to use only C, but BoringSSL requires C++ support.
  2. The linker couldn't find certain C++ symbols, indicating a mismatch between the BoringSSL library and the LSQUIC project settings.

Solution

The solution involved several steps to properly integrate BoringSSL with LSQUIC:

  1. Modified the CMakeLists.txt to include C++ support:

    • Changed PROJECT(lsquic C) to PROJECT(lsquic C CXX)
  2. Added the C++ standard library to the linker flags:

    • Modified the LIBS variable in CMakeLists.txt to include -lstdc++
  3. Ensured correct paths to BoringSSL were provided to CMake:

    cmake -DBORINGSSL_DIR=/path/to/boringssl \
          -DBORINGSSL_INCLUDE=/path/to/boringssl/include \
          -DBORINGSSL_LIB_ssl=/path/to/boringssl/build/ssl/libssl.a \
          -DBORINGSSL_LIB_crypto=/path/toboringssl/build/crypto/libcrypto.a \
          ..
    
  4. If necessary, rebuilt BoringSSL with compatible compiler settings:

    cd /path/to/boringssl
    rm -rf build
    mkdir build
    cd build
    cmake -DCMAKE_BUILD_TYPE=Release ..
    make
    

Steps to Build LSQUIC

  1. Ensure BoringSSL is properly built and its path is known.
  2. Clean the LSQUIC build directory:
    cd  /path/to/lsquic/build
    rm -rf *
    
  3. Run CMake with the correct BoringSSL paths:
    cmake -DBORINGSSL_DIR=/path/to/boringssl \
          -DBORINGSSL_INCLUDE=/path/to/boringssl/include \
          -DBORINGSSL_LIB_ssl=/path/to/boringssl/build/ssl/libssl.a \
          -DBORINGSSL_LIB_crypto=/path/to/boringssl/build/crypto/libcrypto.a \
          ..
    
  4. Build the project:
    make
    
@flipkickmedia
Copy link

This needs merging. The BORINGSSL env var is a bad way to provide the locations of boringssl since the include dir remains with the source and the libraries are in different paths. Providing them seperately like this is a far better way IMO. Also adding the CXX to the project type and adding stdc++ on line 272 of CMakeLists.txt SET(LIBS lsquic ${BORINGSSL_LIB_ssl} ${BORINGSSL_LIB_crypto} ${ZLIB_LIB} ${LIBS} stdc++) got rid of the errors when linking to boringssl.

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

No branches or pull requests

2 participants