diff options
author | Emil Velikov <emil.velikov@collabora.com> | 2018-03-15 14:30:28 +0000 |
---|---|---|
committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2018-03-19 11:40:39 +0200 |
commit | 21b1f22eb056cd9a9c90555749f1744f07b38d3f (patch) | |
tree | 9f13f015f4eec1f648d11a311e40fe41ffa19c19 | |
parent | 2ba70f1f6de52e207aad82680bd4f794d7b99e52 (diff) | |
download | wayland-21b1f22eb056cd9a9c90555749f1744f07b38d3f.tar.gz |
wayland-egl: enhance the symbol test
The current test had a few fall-outs:
- it was checking only for T (.text) symbols
- did not consider symbol removal
Fix that by fetching all the symbols and doing a bidirectional check -
for added and removed symbols. Error out with informative message for
each case.
v2: Rebase on top of $NM patch.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
-rwxr-xr-x | egl/wayland-egl-symbols-check | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/egl/wayland-egl-symbols-check b/egl/wayland-egl-symbols-check index 8b3d711..c47026b 100755 --- a/egl/wayland-egl-symbols-check +++ b/egl/wayland-egl-symbols-check @@ -8,17 +8,37 @@ if [ ! -f "$LIB" ]; then exit 1 fi -FUNCS=$($NM -D --defined-only $LIB | grep -o "T .*" | cut -c 3- | while read func; do -( grep -q "^$func$" || echo $func ) <<EOF -wl_egl_window_resize +AVAIL_FUNCS="$($NM -D --format=bsd --defined-only $LIB | awk '{print $3}')" + +# Platform specific symbols. +PLAT_FUNCS="__bss_start +_edata +_end +_fini +_init +" + +# Official ABI, taken from the header. +REQ_FUNCS="wl_egl_window_resize wl_egl_window_create wl_egl_window_destroy wl_egl_window_get_attached_size -_fini -_init -EOF +" + +NEW_ABI=$(echo "$AVAIL_FUNCS" | while read func; do + echo "$REQ_FUNCS" | grep -q "^$func$" && continue + echo "$PLAT_FUNCS" | grep -q "^$func$" && continue + + echo $func done) -test ! -n "$FUNCS" || echo $FUNCS -test ! -n "$FUNCS" +test ! -n "$NEW_ABI" || echo "New ABI detected - If intentional, update the test."; echo "$NEW_ABI" + +REMOVED_ABI=$(echo "$REQ_FUNCS" | while read func; do + echo "$AVAIL_FUNCS" | grep -q "^$func$" && continue + + echo $func +done) +test ! -n "$REMOVED_ABI" || echo "ABI break detected - Required symbol(s) no longer exported!"; echo "$REMOVED_ABI" +test ! -n "$NEW_ABI" || test ! -n "$REMOVED_ABI" |