diff mbox

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

Message ID 20180404154145.27607-2-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>
---
 amdgpu/Makefile.am         |  1 +
 amdgpu/amdgpu-symbol-check | 19 ++++++-------------
 2 files changed, 7 insertions(+), 13 deletions(-)

Comments

Emil Velikov Sept. 6, 2018, 3:44 p.m. UTC | #1
On 4 April 2018 at 16:41, Eric Engestrom <eric.engestrom@imgtec.com> wrote:
> Signed-off-by: Eric Engestrom <eric.engestrom@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)'
Gut suggests that the absolute abs_foo path will be needed here - not
too sure though.

> 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
>
I think this will break meson - it passes the library name as an arg.
One solution is to set LIB (feel free to pick better name), just like NM.

-Emil
diff mbox

Patch

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