Skip to content

Commit

Permalink
Revert "Allow static and shared libs to be mixed. (#3467)" (#3483)
Browse files Browse the repository at this point in the history
This reverts commit 60005ef.
  • Loading branch information
dougch authored Sep 9, 2022
1 parent 60005ef commit fd014b0
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 163 deletions.
14 changes: 2 additions & 12 deletions cmake/s2n-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,9 @@ endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules")
find_dependency(crypto)

# Allow static or shared lib to be used.
# If both are installed, choose based on BUILD_SHARED_LIBS.
if (BUILD_SHARED_LIBS)
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/shared")
include(${CMAKE_CURRENT_LIST_DIR}/shared/@PROJECT_NAME@-targets.cmake)
else()
include(${CMAKE_CURRENT_LIST_DIR}/static/@PROJECT_NAME@-targets.cmake)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/shared/@PROJECT_NAME@-targets.cmake)
else()
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/static")
include(${CMAKE_CURRENT_LIST_DIR}/static/@PROJECT_NAME@-targets.cmake)
else()
include(${CMAKE_CURRENT_LIST_DIR}/shared/@PROJECT_NAME@-targets.cmake)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/static/@PROJECT_NAME@-targets.cmake)
endif()

1 change: 0 additions & 1 deletion codebuild/bin/s2n_codebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ if [[ "$TESTS" == "ALL" || "$TESTS" == "asan" ]]; then make clean; S2N_ADDRESS_S
if [[ "$TESTS" == "ALL" || "$TESTS" == "integration" ]]; then make clean; S2N_NO_SSLYZE=1 make integration ; fi
if [[ "$TESTS" == "ALL" || "$TESTS" == "integrationv2" ]]; then $CB_BIN_DIR/install_s2n_head.sh "$(mktemp -d)"; make clean; make integrationv2 ; fi
if [[ "$TESTS" == "ALL" || "$TESTS" == "crt" ]]; then ./codebuild/bin/build_aws_crt_cpp.sh $(mktemp -d) $(mktemp -d); fi
if [[ "$TESTS" == "ALL" || "$TESTS" == "sharedandstatic" ]]; then ./codebuild/bin/test_install_shared_and_static.sh $(mktemp -d); fi
# Env must have S2N_USE_CRITERION set for the following to work
if [[ "$TESTS" == "ALL" || "$TESTS" == "integrationv2crit" ]]; then make install; make -C bindings/rust ; make -C tests/integrationv2 "${INTEGV2_TEST}"; fi
if [[ "$TESTS" == "ALL" || "$TESTS" == "fuzz" ]]; then (make clean && make fuzz) ; fi
Expand Down
11 changes: 1 addition & 10 deletions codebuild/bin/s2n_setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ source codebuild/bin/s2n_set_build_preset.sh
: "${LATEST_CLANG:=false}"
: "${TESTS:=integration}"
: "${S2N_COVERAGE:=false}"
: "${LD_LIBRARY_PATH:=NONE}"

# Setup the cache directory paths.
# Set Env Variables with defaults if they aren't already set
Expand Down Expand Up @@ -143,16 +144,6 @@ if [[ "$S2N_LIBCRYPTO" == "libressl" ]]; then export LIBCRYPTO_ROOT=$LIBRESSL_IN
# have the "libcrypto-root" directory path hardcoded.
rm -rf libcrypto-root && ln -s "$LIBCRYPTO_ROOT" libcrypto-root

# Add $LIBCRYPTO_ROOT/lib to LD_LIBRARY_PATH ("lib" could also be "lib64" or "lib32").
# This fixes tests that INSTALL (not simply build) s2n.
# When s2n is built, if libcrypto.so isn't in an official system lib dir,
# its path is stored in the RPATH/RUNPATH of libs2n.so. But many tools (CMake, Ninja)
# strip the RPATH/RUNPATH during installation. Setting LD_LIBRARY_PATH ensures
# the desired libcrypto.so is found.
for LIBDIR in $LIBCRYPTO_ROOT/lib*; do
export LD_LIBRARY_PATH=$LIBDIR${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
done

# Set the libfuzzer to use for fuzz tests
export LIBFUZZER_ROOT=$LIBFUZZER_INSTALL_DIR

Expand Down
131 changes: 0 additions & 131 deletions codebuild/bin/test_install_shared_and_static.sh

This file was deleted.

9 changes: 0 additions & 9 deletions codebuild/spec/buildspec_omnibus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,6 @@ batch:
GCC_VERSION: '6'
TESTS: crt

- identifier: s2nInstallSharedAndStatic
buildspec: codebuild/spec/buildspec_ubuntu.yml
env:
compute-type: BUILD_GENERAL1_SMALL
privileged-mode: true
variables:
TESTS: sharedandstatic
S2N_LIBCRYPTO: openssl-1.1.1

- buildspec: codebuild/spec/buildspec_ubuntu.yml
env:
compute-type: BUILD_GENERAL1_LARGE
Expand Down

0 comments on commit fd014b0

Please sign in to comment.