Skip to content

Commit fa94aa2

Browse files
committed
add travis job to compare symbols of dynamic libraries
1 parent 301e2c4 commit fa94aa2

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ matrix:
7272
packages:
7373
- astyle
7474

75+
# Check public symbols of dynamic libraries
76+
- env: BUILDOPTIONS='--symbols'
77+
addons:
78+
apt:
79+
packages:
80+
- libtool-bin
81+
7582
# Run always with valgrind (no sanitizer, but debug info)
7683
- env: COMPILE_DEBUG=1 BUILDOPTIONS='--with-cc=gcc-4.9 --with-m64 --with-valgrind'
7784
addons:

testme.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ VALGRIND_OPTS=" --leak-check=full --show-leak-kinds=all --error-exitcode=1 "
195195
#VALGRIND_OPTS=""
196196
VALGRIND_BIN=""
197197
CHECK_FORMAT=""
198+
CHECK_SYMBOLS=""
198199
C89=""
199200
C89_C99_ROUNDTRIP=""
200201
TUNE_CMD="./etc/tune -t -r 10 -L 3"
@@ -276,6 +277,9 @@ do
276277
--format)
277278
CHECK_FORMAT="1"
278279
;;
280+
--symbols)
281+
CHECK_SYMBOLS="1"
282+
;;
279283
--all)
280284
COMPILERS="gcc clang"
281285
ARCHFLAGS="-m64 -m32 -mx32"
@@ -309,6 +313,25 @@ then
309313
exit $?
310314
fi
311315

316+
if [[ "$CHECK_SYMBOLS" == "1" ]]
317+
then
318+
make -f makefile.shared
319+
cat << EOF
320+
321+
322+
The following list shows the discrepancy between
323+
the shared library and the Windows dynamic library.
324+
To fix this error, one of the following things
325+
has to be done:
326+
* the script which generates tommath.def has to be modified
327+
(function generate_def() in helper.pl).
328+
* The exported symbols are really different for some reason
329+
This has to be manually investigated.
330+
331+
EOF
332+
exit $(comm -3 <(nm -D --defined-only .libs/libtommath.so | cut -d' ' -f3 | grep -v '^_' | sort) <(tail -n+9 tommath.def | tr -d ' ' | sort) | tee /dev/tty | wc -l)
333+
fi
334+
312335
if [[ "$CHECK_FORMAT" == "1" ]]
313336
then
314337
make astyle

0 commit comments

Comments
 (0)