[PATCH libdrm 02/11] amdgpu: use new symbols checking script

Eric Engestrom eric.engestrom at imgtec.com
Wed Apr 4 15:41:36 UTC 2018


Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
---
 amdgpu/Makefile.am         |  1 +
 amdgpu/amdgpu-symbol-check | 19 ++++++-------------
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/amdgpu/Makefile.am b/amdgpu/Makefile.am
index a1b0d05c1457ae681ac8..4ad6949e81ddbd11078e 100644
--- a/amdgpu/Makefile.am
+++ b/amdgpu/Makefile.am
@@ -47,5 +47,6 @@ libdrm_amdgpuinclude_HEADERS = $(LIBDRM_AMDGPU_H_FILES)
 pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libdrm_amdgpu.pc
 
+AM_TESTS_ENVIRONMENT = top_srcdir='$(top_srcdir)'
 TESTS = amdgpu-symbol-check
 EXTRA_DIST = $(TESTS)
diff --git a/amdgpu/amdgpu-symbol-check b/amdgpu/amdgpu-symbol-check
index 90b7a1d633c0b2143f29..5ed24b906c0228233f71 100755
--- a/amdgpu/amdgpu-symbol-check
+++ b/amdgpu/amdgpu-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.am/libdrm_amdgpuinclude_HEADERS
+LIB=.libs/libdrm_amdgpu.so
 
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_amdgpu.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="
 amdgpu_bo_alloc
 amdgpu_bo_cpu_map
 amdgpu_bo_cpu_unmap
@@ -70,8 +65,6 @@ amdgpu_va_range_free
 amdgpu_va_range_query
 amdgpu_vm_reserve_vmid
 amdgpu_vm_unreserve_vmid
-EOF
-done)
+"
 
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
+source "$top_srcdir"/symbols-check
-- 
Cheers,
  Eric



More information about the dri-devel mailing list