Skip to content

Commit 3c99f5a

Browse files
committed
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 bitcoin/bitcoin#29015 (comment)
1 parent 86c80e9 commit 3c99f5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/devtools/check-deps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ extract_symbols() {
7575
local temp_dir="$1"
7676
for lib in "${!LIBS[@]}"; do
7777
for lib_path in ${LIBS[$lib]}; do
78-
nm -o "$lib_path" | grep ' T ' | awk '{print $3, $1}' >> "${temp_dir}/${lib}_exports.txt"
78+
nm -o "$lib_path" | grep ' T \| W ' | awk '{print $3, $1}' >> "${temp_dir}/${lib}_exports.txt"
7979
nm -o "$lib_path" | grep ' U ' | awk '{print $3, $1}' >> "${temp_dir}/${lib}_imports.txt"
8080
awk '{print $1}' "${temp_dir}/${lib}_exports.txt" | sort -u > "${temp_dir}/${lib}_exported_symbols.txt"
8181
awk '{print $1}' "${temp_dir}/${lib}_imports.txt" | sort -u > "${temp_dir}/${lib}_imported_symbols.txt"

0 commit comments

Comments
 (0)