Skip to content

Commit ae92cc7

Browse files
committed
Add tools/check-abi.sh
1 parent b40e2d3 commit ae92cc7

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tools/check-abi.sh

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/sh
2+
3+
set -eux
4+
5+
configure_and_build() {
6+
cmake -S "$1" --preset dev-mode \
7+
-DCMAKE_C_COMPILER=gcc -DCMAKE_BUILD_TYPE=None -DCMAKE_C_FLAGS="-g -Og -gdwarf-4" \
8+
-DSECP256K1_BUILD_BENCHMARK=OFF \
9+
-DSECP256K1_BUILD_TESTS=OFF \
10+
-DSECP256K1_BUILD_EXHAUSTIVE_TESTS=OFF \
11+
-DSECP256K1_BUILD_CTIME_TESTS=OFF \
12+
-DSECP256K1_BUILD_EXAMPLES=OFF
13+
cmake --build . -j "$(nproc)"
14+
}
15+
16+
source_dir=$(pwd)
17+
18+
git checkout "$1"
19+
base_build_dir=$(mktemp -d)
20+
cd "$base_build_dir"
21+
configure_and_build "$source_dir"
22+
abi-dumper src/libsecp256k1.so -o ABI.dump -lver "$1"
23+
cd "$source_dir"
24+
25+
git checkout "$2"
26+
current_build_dir=$(mktemp -d)
27+
cd "$current_build_dir"
28+
configure_and_build "$source_dir"
29+
abi-dumper src/libsecp256k1.so -o ABI.dump -lver "$2"
30+
cd "$source_dir"
31+
32+
abi-compliance-checker -lib libsecp256k1 -old "${base_build_dir}/ABI.dump" -new "${current_build_dir}/ABI.dump"

0 commit comments

Comments
 (0)