diff mbox

[libdrm,10/11] radeon: use new symbols checking script

Message ID 20180404154145.27607-10-eric.engestrom@imgtec.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Engestrom April 4, 2018, 3:41 p.m. UTC
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
 radeon/Makefile.am         |  1 +
 radeon/radeon-symbol-check | 19 ++++++-------------
 2 files changed, 7 insertions(+), 13 deletions(-)
diff mbox

Patch

diff --git a/radeon/Makefile.am b/radeon/Makefile.am
index e241531488c719ae5bde..7f8198bfc7fa74590749 100644
--- a/radeon/Makefile.am
+++ b/radeon/Makefile.am
@@ -43,5 +43,6 @@  libdrm_radeoninclude_HEADERS = $(LIBDRM_RADEON_H_FILES)
 pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libdrm_radeon.pc
 
+AM_TESTS_ENVIRONMENT = top_srcdir='$(top_srcdir)'
 TESTS = radeon-symbol-check
 EXTRA_DIST = $(LIBDRM_RADEON_BOF_FILES) $(TESTS)
diff --git a/radeon/radeon-symbol-check b/radeon/radeon-symbol-check
index 7d79d90127bd6d27d050..0f01c23905cd1f7cb5aa 100755
--- a/radeon/radeon-symbol-check
+++ b/radeon/radeon-symbol-check
@@ -1,15 +1,10 @@ 
 #!/bin/bash
+set -eu
 
-# The following symbols (past the first five) are taken from the public headers.
-# A list of the latter should be available Makefile.sources/LIBDRM_RADEON_H_FILES
+LIB=.libs/libdrm_radeon.so
 
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_radeon.so} | awk '{print $3}'| while read func; do
-( grep -q "^$func$" || echo $func )  <<EOF
-__bss_start
-_edata
-_end
-_fini
-_init
+# Official ABI, taken from the header.
+REQ_FUNCS="
 radeon_bo_debug
 radeon_bo_get_handle
 radeon_bo_get_src_domain
@@ -54,8 +49,6 @@  radeon_surface_best
 radeon_surface_init
 radeon_surface_manager_free
 radeon_surface_manager_new
-EOF
-done)
+"
 
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
+source "$top_srcdir"/symbols-check