Skip to content

LSQUIC Build Issue #508

Open
Open
@mhmdreda99

Description

@mhmdreda99

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
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions