Skip to content

Commit

Permalink
[!] fix build errors in xqc_build.sh (#391)
Browse files Browse the repository at this point in the history
* [!] fix xquic auto test error on high versions of CentOS

* [=] always output xquic static library no matter if SSL_DYNAMIC is defined

* [=] rename crypto/hkdf files under babassl/boringssl directory to differ from public files
  • Loading branch information
Kulsk authored Dec 25, 2023
1 parent dadd924 commit 4d024a6
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 31 deletions.
24 changes: 11 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,17 @@ if(${SSL_TYPE} MATCHES "boringssl")
set(
TLS_SOURCE
${TLS_SOURCE}
"src/tls/boringssl/xqc_hkdf.c"
"src/tls/boringssl/xqc_crypto.c"
"src/tls/boringssl/xqc_ssl_if.c"
"src/tls/boringssl/xqc_hkdf_impl.c"
"src/tls/boringssl/xqc_crypto_impl.c"
"src/tls/boringssl/xqc_ssl_if_impl.c"
)
elseif(${SSL_TYPE} MATCHES "babassl")
set(
TLS_SOURCE
${TLS_SOURCE}
"src/tls/babassl/xqc_hkdf.c"
"src/tls/babassl/xqc_crypto.c"
"src/tls/babassl/xqc_ssl_if.c"
"src/tls/babassl/xqc_hkdf_impl.c"
"src/tls/babassl/xqc_crypto_impl.c"
"src/tls/babassl/xqc_ssl_if_impl.c"
)
endif()

Expand Down Expand Up @@ -340,13 +340,11 @@ set (


# target
if(NOT SSL_DYNAMIC)
add_library(
xquic-static
STATIC
${XQC_SOURCE}
)
endif()
add_library(
xquic-static
STATIC
${XQC_SOURCE}
)

add_library(
xquic
Expand Down
12 changes: 6 additions & 6 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,17 +218,17 @@ if(${SSL_TYPE} MATCHES "boringssl")
set(
TLS_SOURCE
${TLS_SOURCE}
"src/tls/boringssl/xqc_hkdf.c"
"src/tls/boringssl/xqc_crypto.c"
"src/tls/boringssl/xqc_ssl_if.c"
"src/tls/boringssl/xqc_hkdf_impl.c"
"src/tls/boringssl/xqc_crypto_impl.c"
"src/tls/boringssl/xqc_ssl_if_impl.c"
)
elseif(${SSL_TYPE} MATCHES "babassl")
set(
TLS_SOURCE
${TLS_SOURCE}
"src/tls/babassl/xqc_hkdf.c"
"src/tls/babassl/xqc_crypto.c"
"src/tls/babassl/xqc_ssl_if.c"
"src/tls/babassl/xqc_hkdf_impl.c"
"src/tls/babassl/xqc_crypto_impl.c"
"src/tls/babassl/xqc_ssl_if_impl.c"
)
endif()

Expand Down
7 changes: 7 additions & 0 deletions cmake/FindLibEvent.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ if(LIBEVENT_INCLUDE_DIR)
"^#define[ ]+[EVENT__VERSION|_EVENT_VERSION]+[ ]+\"([^\"]+)\"")
file(STRINGS "${LIBEVENT_INCLUDE_DIR}/event2/event-config.h"
LIBEVENT_VERSION REGEX "${_version_regex}")

# if event-config.h not found, try find event-config-64.h
if(NOT LIBEVENT_VERSION)
file(STRINGS "${LIBEVENT_INCLUDE_DIR}/event2/event-config-64.h"
LIBEVENT_VERSION REGEX "${_version_regex}")
endif()

string(REGEX REPLACE "${_version_regex}" "\\1"
LIBEVENT_VERSION "${LIBEVENT_VERSION}")
unset(_version_regex)
Expand Down
5 changes: 3 additions & 2 deletions include/xquic/xqc_configure.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
#define xquic_VERSION_MAJOR 0
#define xquic_VERSION_MINOR 1

#define XQC_ENABLE_BBR2
#define XQC_ENABLE_RENO
/* #undef XQC_ENABLE_BBR2 */
/* #undef XQC_ENABLE_RENO */
/* #undef XQC_ENABLE_COPA */
/* #undef XQC_ENABLE_UNLIMITED */
/* #undef XQC_ENABLE_MP_INTEROP */
/* #undef XQC_NO_PID_PACKET_PROCESS */
/* #undef XQC_PROTECT_POOL_MEM */
18 changes: 9 additions & 9 deletions scripts/xquic_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,28 @@ function install_go() {
}

function build_babassl() {
git clone https://github.com/BabaSSL/BabaSSL.git ../third_party/babassl
git clone https://github.com/Tongsuo-Project/Tongsuo.git ../third_party/babassl
cd ../third_party/babassl/
./config --prefix=/usr/local/babassl
./config --prefix=/usr/local/babassl --api=1.1.1 no-deprecated
make -j
SSL_PATH_STR="${PWD}"
SSL_INC_PATH_STR="${PWD}/include"
SSL_LIB_PATH_STR="${PWD}/libssl.a;${PWD}/libcrypto.a"
cd -
}

function build_boringssl() {
git clone https://github.com/google/boringssl.git ../third_party/boringssl
mkdir -p ../third_party/boringssl/build
cd ../third_party/boringssl//build
cd ../third_party/boringssl/build
cmake -DBUILD_SHARED_LIBS=0 -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC" ..
make ssl crypto
cd ..
SSL_PATH_STR="${PWD}"
SSL_INC_PATH_STR="${PWD}/include"
SSL_LIB_PATH_STR="${PWD}/build/ssl/libssl.a;${PWD}/build/crypto/libcrypto.a"
cd ../../build/
}

function do_compile() {
rm -f CMakeCache.txt
if [[ $1 == "XQC_OPENSSL_IS_BORINGSSL" ]]; then
if [[ $1 == "boringssl" ]]; then
build_boringssl
SSL_TYPE_STR="boringssl"

Expand All @@ -61,9 +57,13 @@ function do_compile() {
fi

#turn on Code Coverage
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_PRINT_SECRET=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_ENABLE_RENO=1 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_PRINT_SECRET=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_ENABLE_RENO=1 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} ..
make -j

if [ $? -ne 0 ]; then
echo "cmake failed"
exit 1
fi
rm -f CMakeCache.txt
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion xqc_configure.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
#cmakedefine XQC_ENABLE_COPA
#cmakedefine XQC_ENABLE_UNLIMITED
#cmakedefine XQC_ENABLE_MP_INTEROP
#cmakedefine XQC_NO_PID_PACKET_PROCESS
#cmakedefine XQC_NO_PID_PACKET_PROCESS
#cmakedefine XQC_PROTECT_POOL_MEM

0 comments on commit 4d024a6

Please sign in to comment.