aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Ofsky <ryan@ofsky.org>2024-07-09 11:29:50 -0400
committerRyan Ofsky <ryan@ofsky.org>2024-09-04 15:30:58 -0400
commit3c99f5a38a47e4e10a0daab3a114b5e476fcacfa (patch)
treed58b32c6ac78462b57046b68eada7fec72001dd8
parent86c80e9cf296f6560f2f846bd4e7286f7b958b93 (diff)
contrib: fix check-deps.sh to check for weak symbols
Fix check-deps.sh to check for weak symbols so it can detect when an exported template function is used from another library. In a previous version of this commit, this change caused an invalid dependency in the consensus library on the TryParseHex template function from the util library to be detected, and a suppression was added here. But #30377 removed the invalid dependency so the suppression is no longer needed. The invalid dependency and problem detecting weak symbol usage was originally reported by Hennadii Stepanov in https://github.com/bitcoin/bitcoin/pull/29015#issuecomment-2209258843
-rwxr-xr-xcontrib/devtools/check-deps.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/devtools/check-deps.sh b/contrib/devtools/check-deps.sh
index f49e360d16..d3a76f0751 100755
--- a/contrib/devtools/check-deps.sh
+++ b/contrib/devtools/check-deps.sh
@@ -75,7 +75,7 @@ extract_symbols() {
local temp_dir="$1"
for lib in "${!LIBS[@]}"; do
for lib_path in ${LIBS[$lib]}; do
- nm -o "$lib_path" | grep ' T ' | awk '{print $3, $1}' >> "${temp_dir}/${lib}_exports.txt"
+ nm -o "$lib_path" | grep ' T \| W ' | awk '{print $3, $1}' >> "${temp_dir}/${lib}_exports.txt"
nm -o "$lib_path" | grep ' U ' | awk '{print $3, $1}' >> "${temp_dir}/${lib}_imports.txt"
awk '{print $1}' "${temp_dir}/${lib}_exports.txt" | sort -u > "${temp_dir}/${lib}_exported_symbols.txt"
awk '{print $1}' "${temp_dir}/${lib}_imports.txt" | sort -u > "${temp_dir}/${lib}_imported_symbols.txt"