Skip to contentSkip to conversation

symbols-check: add new meta-script

PATCH In review Eric Engestrom 2 participants 16 messages Apr 4, 2018 – Sep 6, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/11 symbols-check: add new meta-script

Note: copied from Mesa

---
 meson.build   |  1 +
 symbols-check | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 80 insertions(+)
 create mode 100755 symbols-check
meson.build +1 -0
index a725f05d342bbec4df18..c035a00c6747b8d46a9b 100644
@@ -272,6 +272,7 @@ pkg.generate(
 
 env_test = environment()
 env_test.set('NM', find_program('nm').path())
+env_test.set('top_srcdir', meson.source_root())
 
 if with_libkms
   subdir('libkms')
symbols-check new file +79 -0

79 lines not on this page · raw message

Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/11 amdgpu: use new symbols checking script

---
 amdgpu/Makefile.am         |  1 +
 amdgpu/amdgpu-symbol-check | 19 ++++++-------------
 2 files changed, 7 insertions(+), 13 deletions(-)
amdgpu/Makefile.am +1 -0
index a1b0d05c1457ae681ac8..4ad6949e81ddbd11078e 100644
@@ -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)
amdgpu/amdgpu-symbol-check +6 -13
index 90b7a1d633c0b2143f29..5ed24b906c0228233f71 100755
@@ -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
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

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

Quoted 11 lines · Eric Engestrom
---
 amdgpu/Makefile.am         |  1 +
 amdgpu/amdgpu-symbol-check | 19 ++++++-------------
 2 files changed, 7 insertions(+), 13 deletions(-)
amdgpu/Makefile.am +0 -0
index a1b0d05c1457ae681ac8..4ad6949e81ddbd11078e 100644

amdgpu/Makefile.am libdrm_amdgpuinclude_HEADERS = $(LIBDRM_AMDGPU_H_FILES) · line 50

Quoted 4 lines
amdgpu/Makefile.am +1 -0
@@ -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.

amdgpu/amdgpu-symbol-check line 5

Quoted 12 lines
amdgpu/amdgpu-symbol-check +2 -2
index 90b7a1d633c0b2143f29..5ed24b906c0228233f71 100755
@@ -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
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

PATCH 3/11 etnaviv: use new symbols checking script

In reply to Eric Engestrom
---
 etnaviv/Makefile.am          |  1 +
 etnaviv/etnaviv-symbol-check | 19 ++++++-------------
 etnaviv/meson.build          |  1 +
 3 files changed, 8 insertions(+), 13 deletions(-)
etnaviv/Makefile.am +1 -0
index be96ba868f0d3949c9fa..0ceda75049dc400e07c7 100644
@@ -22,5 +22,6 @@ libdrm_etnavivinclude_HEADERS = $(LIBDRM_ETNAVIV_H_FILES)
 pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libdrm_etnaviv.pc
 
+AM_TESTS_ENVIRONMENT = top_srcdir='$(top_srcdir)'
 TESTS = etnaviv-symbol-check
 EXTRA_DIST = $(TESTS)
etnaviv/etnaviv-symbol-check +6 -13
index b1598ce52838c847096a..14eb56ce4c5ee00753d0 100755
@@ -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_ETNAVIV_H_FILES
+LIB=.libs/libdrm_etnaviv.so
 
-FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_etnaviv.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="
 etna_device_new
 etna_device_new_dup
 etna_device_ref
@@ -46,8 +41,6 @@ etna_perfmon_create
 etna_perfmon_del
 etna_perfmon_get_dom_by_name
 etna_perfmon_get_sig_by_name
-EOF
-done)
+"
 
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
+source "$top_srcdir"/symbols-check
etnaviv/meson.build +1 -0
index ca2aa544c58924a15d8b..74e3679eaad83db09636 100644
@@ -55,5 +55,6 @@ ext_libdrm_etnaviv = declare_dependency(
 test(
   'etnaviv-symbol-check',
   prog_bash,
+  env : env_test,
   args : [files('etnaviv-symbol-check'), libdrm_etnaviv]
 )
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

PATCH 4/11 exynos: use new symbols checking script

In reply to Eric Engestrom
---
 exynos/Makefile.am         |  1 +
 exynos/exynos-symbol-check | 19 ++++++-------------
 2 files changed, 7 insertions(+), 13 deletions(-)
exynos/Makefile.am +1 -0
index f99f8981ff9ef0bf9d4f..9dd1161c6cc4d9f84b64 100644
@@ -23,5 +23,6 @@ libdrm_exynosinclude_HEADERS = exynos_drmif.h
 pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libdrm_exynos.pc
 
+AM_TESTS_ENVIRONMENT = top_srcdir='$(top_srcdir)'
 TESTS = exynos-symbol-check
 EXTRA_DIST = $(TESTS)
exynos/exynos-symbol-check +6 -13
index e9f1b04d5b0a7a258cf1..f1df6645ec243eccce5b 100755
@@ -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_exynos*_HEADERS
+LIB=.libs/libdrm_exynos.so
 
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_exynos.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="
 exynos_bo_create
 exynos_bo_destroy
 exynos_bo_from_name
@@ -33,8 +28,6 @@ g2d_init
 g2d_move
 g2d_scale_and_blend
 g2d_solid_fill
-EOF
-done)
+"
 
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
+source "$top_srcdir"/symbols-check
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

PATCH 5/11 freedreno: use new symbols checking script

In reply to Eric Engestrom
---
 freedreno/Makefile.am            |  1 +
 freedreno/freedreno-symbol-check | 19 ++++++-------------
 2 files changed, 7 insertions(+), 13 deletions(-)
freedreno/Makefile.am +1 -0
index cbb0d031816155755bda..571272cb63aee8e427f9 100644
@@ -27,5 +27,6 @@ libdrm_freedrenocommoninclude_HEADERS = $(LIBDRM_FREEDRENO_H_FILES)
 pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libdrm_freedreno.pc
 
+AM_TESTS_ENVIRONMENT = top_srcdir='$(top_srcdir)'
 TESTS = freedreno-symbol-check
 EXTRA_DIST = $(TESTS)
freedreno/freedreno-symbol-check +6 -13
index 3b119528c6cfbfd9d4a0..bc03d4e7b01a0453e57d 100755
@@ -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_FREEDRENO_H_FILES
+LIB=.libs/libdrm_freedreno.so
 
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_freedreno.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="
 fd_bo_cpu_fini
 fd_bo_cpu_prep
 fd_bo_del
@@ -56,8 +51,6 @@ fd_ringmarker_flush
 fd_ringbuffer_flush2
 fd_ringmarker_mark
 fd_ringmarker_new
-EOF
-done)
+"
 
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
+source "$top_srcdir"/symbols-check
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

PATCH 6/11 intel: use new symbols checking script

In reply to Eric Engestrom
---
 intel/Makefile.am        |  2 ++
 intel/intel-symbol-check | 19 ++++++-------------
 2 files changed, 8 insertions(+), 13 deletions(-)
intel/Makefile.am +2 -0
index c52e8c086a86cf523da4..448a79fbc48e97e3f500 100644
@@ -56,6 +56,8 @@ BATCHES = \
 	tests/gen7-2d-copy.batch \
 	tests/gen7-3d.batch
 
+AM_TESTS_ENVIRONMENT = top_srcdir='$(top_srcdir)'
+
 TESTS = \
 	$(BATCHES:.batch=.batch.sh) \
 	intel-symbol-check
intel/intel-symbol-check +6 -13
index 4d30a4b15feb94e9523d..5962292a91fcfda3788f 100755
@@ -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_INTEL_H_FILES
+LIB=.libs/libdrm_intel.so
 
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_intel.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="
 drm_intel_bo_alloc
 drm_intel_bo_alloc_for_render
 drm_intel_bo_alloc_tiled
@@ -93,8 +88,6 @@ drm_intel_get_pooled_eu
 drm_intel_get_reset_stats
 drm_intel_get_subslice_total
 drm_intel_reg_read
-EOF
-done)
+"
 
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
+source "$top_srcdir"/symbols-check
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

PATCH 7/11 libkms: use new symbols checking script

In reply to Eric Engestrom
---
 libkms/Makefile.am      |  1 +
 libkms/kms-symbol-check | 19 ++++++-------------
 2 files changed, 7 insertions(+), 13 deletions(-)
libkms/Makefile.am +1 -0
index 461fc35b6ff08fdd1a7f..2742c9357250b70661cf 100644
@@ -39,5 +39,6 @@ libkmsinclude_HEADERS = $(LIBKMS_H_FILES)
 pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libkms.pc
 
+AM_TESTS_ENVIRONMENT = top_srcdir='$(top_srcdir)'
 TESTS = kms-symbol-check
 EXTRA_DIST = $(TESTS)
libkms/kms-symbol-check +6 -13
index a5c2120d5ce75616f489..3ff2f98c83a793c53073 100755
@@ -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/LIBKMS_H_FILES
+LIB=.libs/libkms.so
 
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libkms.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="
 kms_bo_create
 kms_bo_destroy
 kms_bo_get_prop
@@ -18,8 +13,6 @@ kms_bo_unmap
 kms_create
 kms_destroy
 kms_get_prop
-EOF
-done)
+"
 
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
+source "$top_srcdir"/symbols-check
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw

PATCH 8/11 nouveau: use new symbols checking script

In reply to Eric Engestrom
---
 nouveau/Makefile.am          |  1 +
 nouveau/nouveau-symbol-check | 19 ++++++-------------
 2 files changed, 7 insertions(+), 13 deletions(-)
nouveau/Makefile.am +1 -0
index 60ebe243d4236e6aa814..5de4bd2a96a57aac74a4 100644
@@ -28,5 +28,6 @@ libdrm_nouveaunvifinclude_HEADERS = nvif/class.h \
 pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libdrm_nouveau.pc
 
+AM_TESTS_ENVIRONMENT = top_srcdir='$(top_srcdir)'
 TESTS = nouveau-symbol-check
 EXTRA_DIST = $(TESTS)
nouveau/nouveau-symbol-check +6 -13
index b3a24101e52d8aae1bba..5dab5686fe3d9d8790a6 100755
@@ -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_NOUVEAU_H_FILES
+LIB=.libs/libdrm_nouveau.so
 
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_nouveau.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="
 nouveau_bo_map
 nouveau_bo_name_get
 nouveau_bo_name_ref
@@ -51,8 +46,6 @@ nouveau_pushbuf_reloc
 nouveau_pushbuf_space
 nouveau_pushbuf_validate
 nouveau_setparam
-EOF
-done)
+"
 
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
+source "$top_srcdir"/symbols-check
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#9 lore raw

PATCH 9/11 omap: use new symbols checking script

In reply to Eric Engestrom
---
 omap/Makefile.am       |  1 +
 omap/omap-symbol-check | 19 ++++++-------------
 2 files changed, 7 insertions(+), 13 deletions(-)
omap/Makefile.am +1 -0
index 599bb9ded5003f17a2f7..bdb809907df0c12aa3ac 100644
@@ -20,5 +20,6 @@ libdrm_omapinclude_HEADERS = omap_drmif.h
 pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libdrm_omap.pc
 
+AM_TESTS_ENVIRONMENT = top_srcdir='$(top_srcdir)'
 TESTS = omap-symbol-check
 EXTRA_DIST = $(TESTS)
omap/omap-symbol-check +6 -13
index 0fb4a0f2664cf9edbc27..843b410933e49889552d 100755
@@ -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_omap*HEADERS
+LIB=.libs/libdrm_omap.so
 
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_omap.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="
 omap_bo_cpu_fini
 omap_bo_cpu_prep
 omap_bo_del
@@ -28,8 +23,6 @@ omap_device_new
 omap_device_ref
 omap_get_param
 omap_set_param
-EOF
-done)
+"
 
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
+source "$top_srcdir"/symbols-check
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#10 lore raw

PATCH 10/11 radeon: use new symbols checking script

In reply to Eric Engestrom
---
 radeon/Makefile.am         |  1 +
 radeon/radeon-symbol-check | 19 ++++++-------------
 2 files changed, 7 insertions(+), 13 deletions(-)
radeon/Makefile.am +1 -0
index e241531488c719ae5bde..7f8198bfc7fa74590749 100644
@@ -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)
radeon/radeon-symbol-check +6 -13
index 7d79d90127bd6d27d050..0f01c23905cd1f7cb5aa 100755
@@ -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
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#11 lore raw

PATCH 11/11 tegra: use new symbols checking script

In reply to Eric Engestrom
---
 tegra/Makefile.am        |  1 +
 tegra/tegra-symbol-check | 22 ++++++----------------
 2 files changed, 7 insertions(+), 16 deletions(-)
tegra/Makefile.am +1 -0
index fb40be55a3b807fcfb6d..a88bea5225efcc942d12 100644
@@ -21,5 +21,6 @@ libdrm_tegrainclude_HEADERS = tegra.h
 pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libdrm_tegra.pc
 
+AM_TESTS_ENVIRONMENT = top_srcdir='$(top_srcdir)'
 TESTS = tegra-symbol-check
 EXTRA_DIST = $(TESTS)
tegra/tegra-symbol-check +6 -16
index 509b678c37b899a25f0a..4a340df2567e45792f98 100755
@@ -1,18 +1,10 @@
 #!/bin/bash
+set -eu
 
-# The following symbols (past the first nine) are taken from tegra.h.
+LIB=.libs/libdrm_tegra.so
 
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_tegra.so} | awk '{print $3}'| while read func; do
-( grep -q "^$func$" || echo $func )  <<EOF
-__bss_end__
-__bss_start__
-__bss_start
-__end__
-_bss_end__
-_edata
-_end
-_fini
-_init
+# Official ABI, taken from the header.
+REQ_FUNCS="
 drm_tegra_bo_get_flags
 drm_tegra_bo_get_handle
 drm_tegra_bo_get_tiling
@@ -26,8 +18,6 @@ drm_tegra_bo_unref
 drm_tegra_bo_wrap
 drm_tegra_close
 drm_tegra_new
-EOF
-done)
+"
 
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
+source "$top_srcdir"/symbols-check
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#12 lore raw
In reply to Eric Engestrom
Quoted 40 lines · Eric Engestrom

Note: copied from Mesa

---
 meson.build   |  1 +
 symbols-check | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 80 insertions(+)
 create mode 100755 symbols-check
meson.build +1 -0
index a725f05d342bbec4df18..c035a00c6747b8d46a9b 100644
@@ -272,6 +272,7 @@ pkg.generate(
 
 env_test = environment()
 env_test.set('NM', find_program('nm').path())
+env_test.set('top_srcdir', meson.source_root())
 
 if with_libkms
   subdir('libkms')
symbols-check new file +13 -0
new file mode 100755
index 00000000000000000000..bac466d93dcb45cee0bb
@@ -0,0 +1,79 @@
+#!/bin/sh
+set -eu
+set -o pipefail
+
+# Platform specific symbols
+# These will simply be ignored
+PLAT_FUNCS="
+__bss_start
+_init
+_fini
+_end
+_edata
+

symbols-check line 23

Quoted 10 lines
symbols-check new file +10 -0
+# From tegra-symbol-check
+__bss_end__
+__bss_start__
+__bss_start
+__end__
+_bss_end__
+_edata
+_end
+_fini
+_init

Haha, oops... I had noticed that one of the old scripts had more platform symbols than the rest, and I wanted to check if/when those were needed so I just stuffed them here in the mean time, but then I forgot :]

I'll check this when I have the time (not this week), or if anyone knows..?

In the mean time, please review the rest and ignore these 10 lines :)

Quoted 60 lines
symbols-check new file +56 -0
+"
+
+if [ -z "$LIB" ]; then
+  echo "\$LIB needs to be defined for autotools to be able to run this test"
+  exit 1
+fi
+
+# The lib name is passed in with Meson but autotools doesn't support that
+# so it needs to be hardcoded and overwritten here
+if [ $# -ge 1 ]; then
+  LIB=$1
+fi
+
+if ! [ -f "$LIB" ]; then
+  echo "lib $LIB doesn't exist"
+  exit 1
+fi
+
+if [ -z "$NM" ]; then
+  echo "\$NM is undefined or empty"
+  exit 1
+elif ! command -v $NM >/dev/null; then
+  echo "\$NM is not a valid command"
+  exit 1
+fi
+
+AVAIL_FUNCS="$($NM -D --format=bsd --defined-only $LIB | awk '{print $3}')"
+
+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)
+
+REMOVED_ABI=$(echo "$REQ_FUNCS" | while read func; do
+  echo "$AVAIL_FUNCS" | grep -q "^$func$" && continue
+
+  echo $func
+done)
+
+if [ -n "$NEW_ABI" ]; then
+  echo "New ABI detected - If intentional, update the test."
+  echo "$NEW_ABI"
+fi
+
+if [ -n "$REMOVED_ABI" ]; then
+  echo "ABI break detected - Required symbol(s) no longer exported!"
+  echo "$REMOVED_ABI"
+fi
+
+if [ -z "$NEW_ABI" ] && [ -z "$REMOVED_ABI" ]; then
+  exit 0
+else
+  exit 1
+fi
Signature · 2 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#13 lore raw
Quoted 56 lines · Eric Engestrom
Quoted 40 lines · Eric Engestrom

Note: copied from Mesa

---
 meson.build   |  1 +
 symbols-check | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 80 insertions(+)
 create mode 100755 symbols-check
meson.build +1 -0
index a725f05d342bbec4df18..c035a00c6747b8d46a9b 100644
@@ -272,6 +272,7 @@ pkg.generate(
 
 env_test = environment()
 env_test.set('NM', find_program('nm').path())
+env_test.set('top_srcdir', meson.source_root())
 
 if with_libkms
   subdir('libkms')
symbols-check new file +13 -0
new file mode 100755
index 00000000000000000000..bac466d93dcb45cee0bb
@@ -0,0 +1,79 @@
+#!/bin/sh
+set -eu
+set -o pipefail
+
+# Platform specific symbols
+# These will simply be ignored
+PLAT_FUNCS="
+__bss_start
+_init
+_fini
+_end
+_edata
+

symbols-check line 23

Quoted 10 lines
symbols-check new file +10 -0
+# From tegra-symbol-check
+__bss_end__
+__bss_start__
+__bss_start
+__end__
+_bss_end__
+_edata
+_end
+_fini
+_init

Haha, oops... I had noticed that one of the old scripts had more platform symbols than the rest, and I wanted to check if/when those were needed so I just stuffed them here in the mean time, but then I forgot :]

Quoted 4 lines

I'll check this when I have the time (not this week), or if anyone knows..?

In the mean time, please review the rest and ignore these 10 lines :)

The extra __ suffix/prefixed ones are ARM specific. They seems to be introduced from day 1 in glibc, without any obvious reason. They're just aliases - __end__, _bss_end__, etc are identical to _end

If you want to cater for GNU/Hurd - the following three should be listed as well.

_fbss
_fdata
_ftext

I haven't had time to read through the patches, although +1 on the overall idea. Will try to get to it sometime tomorrow.

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#14 lore raw
Quoted 65 lines · Emil Velikov
Quoted 56 lines · Eric Engestrom
Quoted 40 lines · Eric Engestrom

Note: copied from Mesa

---
 meson.build   |  1 +
 symbols-check | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 80 insertions(+)
 create mode 100755 symbols-check
meson.build +1 -0
index a725f05d342bbec4df18..c035a00c6747b8d46a9b 100644
@@ -272,6 +272,7 @@ pkg.generate(
 
 env_test = environment()
 env_test.set('NM', find_program('nm').path())
+env_test.set('top_srcdir', meson.source_root())
 
 if with_libkms
   subdir('libkms')
symbols-check new file +13 -0
new file mode 100755
index 00000000000000000000..bac466d93dcb45cee0bb
@@ -0,0 +1,79 @@
+#!/bin/sh
+set -eu
+set -o pipefail
+
+# Platform specific symbols
+# These will simply be ignored
+PLAT_FUNCS="
+__bss_start
+_init
+_fini
+_end
+_edata
+

symbols-check line 23

Quoted 10 lines
symbols-check new file +10 -0
+# From tegra-symbol-check
+__bss_end__
+__bss_start__
+__bss_start
+__end__
+_bss_end__
+_edata
+_end
+_fini
+_init

Haha, oops... I had noticed that one of the old scripts had more platform symbols than the rest, and I wanted to check if/when those were needed so I just stuffed them here in the mean time, but then I forgot :]

Quoted 4 lines

I'll check this when I have the time (not this week), or if anyone knows..?

In the mean time, please review the rest and ignore these 10 lines :)

The extra __ suffix/prefixed ones are ARM specific. They seems to be introduced from day 1 in glibc, without any obvious reason. They're just aliases - __end__, _bss_end__, etc are identical to _end

Quoted 6 lines

If you want to cater for GNU/Hurd - the following three should be listed as well.

_fbss
_fdata
_ftext

Thanks for the explanation!
I think I'll just add all these to the platform-specific list on both mesa and libdrm, they have specific enough names (beginning with underscore, for starters) that no entrypoint of ours should ever match.

Quoted 3 lines

I haven't had time to read through the patches, although +1 on the overall idea. Will try to get to it sometime tomorrow.

Thanks, but I won't have time to push anything until next week anyway, so there's no rush ^^

Quoted 2 lines

-Emil

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#15 lore raw
In reply to Eric Engestrom

symbols-check line 4

Quoted 7 lines · Eric Engestrom
symbols-check new file +4 -0
@@ -0,0 +1,79 @@
+#!/bin/sh
+set -eu
+set -o pipefail
+

We could drop the execute bit, shebang and set. Pretty much all of it is handled by the callers (modulo pipefail)

Quoted 9 lines
symbols-check new file +9 -0
+if [ -z "$LIB" ]; then
+  echo "\$LIB needs to be defined for autotools to be able to run this test"
+  exit 1
+fi
+
+# The lib name is passed in with Meson but autotools doesn't support that
+# so it needs to be hardcoded and overwritten here
+if [ $# -ge 1 ]; then
+  LIB=$1

symbols-check line 44

Quoted 10 lines
symbols-check new file +10 -0
+fi
+
+if ! [ -f "$LIB" ]; then
+  echo "lib $LIB doesn't exist"
+  exit 1
+fi
+
+if [ -z "$NM" ]; then
+  echo "\$NM is undefined or empty"
+  exit 1

I would drop all these - set -u will provide reasonable error handling

HTH
Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel