From 20753411b0a00d220781cbd6d00a5996ee3a6f46 Mon Sep 17 00:00:00 2001 From: James Mayclin Date: Thu, 9 Jan 2025 19:45:47 +0000 Subject: [PATCH 1/2] fix: don't prefix empty string when interning --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e0280167c2..da31df881a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -402,7 +402,8 @@ if (S2N_INTERN_LIBCRYPTO) # copy the static version of libcrypto cp ${crypto_STATIC_LIBRARY} s2n_libcrypto.a && # dump all of the symbols and prefix them with `s2n$` - bash -c "${CMAKE_NM} s2n_libcrypto.a | awk '/ [A-Z] /{print $3\" s2n$\"$3}' | sort | uniq > libcrypto.symbols" && + bash -c "${CMAKE_NM} s2n_libcrypto.a | awk '/ [A-Z] /{if ($3) print $3\" s2n$\"$3}' | sort | uniq > libcrypto.symbols" && + cp libcrypto.symbols my_analysis.symbols && # redefine the libcrypto libary symbols ${CMAKE_OBJCOPY} --redefine-syms libcrypto.symbols s2n_libcrypto.a && rm -rf s2n_libcrypto && From f966eac9ce7f8754d47f9b8cf90eda48c14aeb7b Mon Sep 17 00:00:00 2001 From: James Mayclin Date: Thu, 9 Jan 2025 13:09:15 -0800 Subject: [PATCH 2/2] Update CMakeLists.txt --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index da31df881a3..23ef74369c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -403,7 +403,6 @@ if (S2N_INTERN_LIBCRYPTO) cp ${crypto_STATIC_LIBRARY} s2n_libcrypto.a && # dump all of the symbols and prefix them with `s2n$` bash -c "${CMAKE_NM} s2n_libcrypto.a | awk '/ [A-Z] /{if ($3) print $3\" s2n$\"$3}' | sort | uniq > libcrypto.symbols" && - cp libcrypto.symbols my_analysis.symbols && # redefine the libcrypto libary symbols ${CMAKE_OBJCOPY} --redefine-syms libcrypto.symbols s2n_libcrypto.a && rm -rf s2n_libcrypto &&