add travis job to compare symbols of dynamic libraries
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
diff --git a/.travis.yml b/.travis.yml
index d8aa885..4c6e557 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -72,6 +72,13 @@ matrix:
packages:
- astyle
+ # Check public symbols of dynamic libraries
+ - env: BUILDOPTIONS='--symbols'
+ addons:
+ apt:
+ packages:
+ - libtool-bin
+
# Run always with valgrind (no sanitizer, but debug info)
- env: COMPILE_DEBUG=1 BUILDOPTIONS='--with-cc=gcc-4.9 --with-m64 --with-valgrind'
addons:
diff --git a/testme.sh b/testme.sh
index 1a03f55..41a165b 100755
--- a/testme.sh
+++ b/testme.sh
@@ -195,6 +195,7 @@ VALGRIND_OPTS=" --leak-check=full --show-leak-kinds=all --error-exitcode=1 "
#VALGRIND_OPTS=""
VALGRIND_BIN=""
CHECK_FORMAT=""
+CHECK_SYMBOLS=""
C89=""
C89_C99_ROUNDTRIP=""
TUNE_CMD="./etc/tune -t -r 10 -L 3"
@@ -276,6 +277,9 @@ do
--format)
CHECK_FORMAT="1"
;;
+ --symbols)
+ CHECK_SYMBOLS="1"
+ ;;
--all)
COMPILERS="gcc clang"
ARCHFLAGS="-m64 -m32 -mx32"
@@ -309,6 +313,25 @@ then
exit $?
fi
+if [[ "$CHECK_SYMBOLS" == "1" ]]
+then
+ make -f makefile.shared
+ cat << EOF
+
+
+The following list shows the discrepancy between
+the shared library and the Windows dynamic library.
+To fix this error, one of the following things
+has to be done:
+* the script which generates tommath.def has to be modified
+ (function generate_def() in helper.pl).
+* The exported symbols are really different for some reason
+ This has to be manually investigated.
+
+EOF
+ 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)
+fi
+
if [[ "$CHECK_FORMAT" == "1" ]]
then
make astyle