*-symbol-checks hard-code the nm executable
https://bugs.freedesktop.org/show_bug.cgi?id=105163
Bug ID: 105163
Summary: *-symbol-checks hard-code the nm executable
Product: DRI
Version: XOrg git
Hardware: All
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: libdrm
Assignee: [email protected]
Reporter: [email protected]
Created attachment 137439
--> https://bugs.freedesktop.org/attachment.cgi?id=137439&action=edit
libdrm-symbol-check-Don-t-hard-code-nm-executable.patch
Currently the *-symbol-checks hard-code the nm executable which may result in build failures when using a prefixed toolchain, e.g. /usr/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-nm.
There was a patch suggested in 2016 and sent to the mailing list but it hasn't been fixed yet:
https://lists.freedesktop.org/archives/dri-devel/2016-October/119999.html
Attached is the patch in question for the sake of completeness.
It would be nice to get this fixed upstream.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 1/1 *-symbol-check: Don't hard-code nm executable
From: Heiko Becker <[email protected]>
Helpful if your nm executable has a prefix based on the architecture, for example.
--- amdgpu/amdgpu-symbol-check | 2 +- amdgpu/meson.build | 1 + configure.ac | 1 + exynos/exynos-symbol-check | 2 +- exynos/meson.build | 1 + freedreno/freedreno-symbol-check | 2 +- freedreno/meson.build | 1 + intel/intel-symbol-check | 2 +- intel/meson.build | 1 + libkms/kms-symbol-check | 2 +- libkms/meson.build | 1 + meson.build | 3 +++ nouveau/meson.build | 1 + nouveau/nouveau-symbol-check | 2 +- omap/meson.build | 1 + omap/omap-symbol-check | 2 +- radeon/meson.build | 1 + radeon/radeon-symbol-check | 2 +- tegra/meson.build | 1 + tegra/tegra-symbol-check | 2 +- 20 files changed, 22 insertions(+), 9 deletions(-)
amdgpu/amdgpu-symbol-check +1 -1
@@ -3,7 +3,7 @@ # 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 -FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_amdgpu.so} | awk '{print $3}' | while read func; do +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
amdgpu/meson.build +1 -0
@@ -61,5 +61,6 @@ ext_libdrm_amdgpu = declare_dependency( test( 'amdgpu-symbol-check', prog_bash, + env : env_test, args : [files('amdgpu-symbol-check'), libdrm_amdgpu] )
configure.ac +1 -0
@@ -45,6 +45,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # Check for programs AC_PROG_CC AC_PROG_CC_C99 +AC_PROG_NM if test "x$ac_cv_prog_cc_c99" = xno; then AC_MSG_ERROR([Building libdrm requires C99 enabled compiler])
exynos/exynos-symbol-check +1 -1
@@ -3,7 +3,7 @@ # 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 -FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_exynos.so} | awk '{print $3}'| while read func; do +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
exynos/meson.build +1 -0
@@ -49,5 +49,6 @@ pkg.generate( test( 'exynos-symbol-check', prog_bash, + env : env_test, args : [files('exynos-symbol-check'), libdrm_exynos] )
freedreno/freedreno-symbol-check +1 -1
@@ -3,7 +3,7 @@ # 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 -FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_freedreno.so} | awk '{print $3}'| while read func; do +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
freedreno/meson.build +1 -0
@@ -72,5 +72,6 @@ pkg.generate( test( 'freedreno-symbol-check', prog_bash, + env : env_test, args : [files('freedreno-symbol-check'), libdrm_freedreno] )
intel/intel-symbol-check +1 -1
@@ -3,7 +3,7 @@ # 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 -FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_intel.so} | awk '{print $3}' | while read func; do +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
intel/meson.build +1 -0
@@ -101,5 +101,6 @@ test( test( 'intel-symbol-check', prog_bash, + env : env_test, args : [files('intel-symbol-check'), libdrm_intel] )
libkms/kms-symbol-check +1 -1
@@ -3,7 +3,7 @@ # 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 -FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libkms.so} | awk '{print $3}'| while read func; do +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
libkms/meson.build +1 -0
@@ -70,5 +70,6 @@ pkg.generate( test( 'kms-symbol-check', prog_bash, + env : env_test, args : [files('kms-symbol-check'), libkms] )
meson.build +3 -0
@@ -321,6 +321,9 @@ pkg.generate( description : 'Userspace interface to kernel DRM services', ) +env_test = environment() +env_test.set('NM', find_program('nm').path()) + if with_libkms subdir('libkms') endif
nouveau/meson.build +1 -0
@@ -54,5 +54,6 @@ pkg.generate( test( 'nouveau-symbol-check', prog_bash, + env : env_test, args : [files('nouveau-symbol-check'), libdrm_nouveau] )
nouveau/nouveau-symbol-check +1 -1
@@ -3,7 +3,7 @@ # 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 -FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_nouveau.so} | awk '{print $3}'| while read func; do +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
omap/meson.build +1 -0
@@ -49,5 +49,6 @@ pkg.generate( test( 'omap-symbol-check', prog_bash, + env : env_test, args : [files('omap-symbol-check'), libdrm_omap] )
omap/omap-symbol-check +1 -1
@@ -3,7 +3,7 @@ # 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 -FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_omap.so} | awk '{print $3}'| while read func; do +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
radeon/meson.build +1 -0
@@ -59,5 +59,6 @@ pkg.generate( test( 'radeon-symbol-check', prog_bash, + env : env_test, args : [files('radeon-symbol-check'), libdrm_radeon] )
radeon/radeon-symbol-check +1 -1
@@ -3,7 +3,7 @@ # 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 -FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_radeon.so} | awk '{print $3}'| while read func; do +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
tegra/meson.build +1 -0
@@ -48,5 +48,6 @@ pkg.generate( test( 'tegra-symbol-check', prog_bash, + env : env_test, args : [files('tegra-symbol-check'), libdrm_tegra] )
tegra/tegra-symbol-check +1 -1
@@ -2,7 +2,7 @@ # The following symbols (past the first nine) are taken from tegra.h. -FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_tegra.so} | awk '{print $3}'| while read func; do +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__
Signature · 7 lines
Cheers, Eric _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH libdrm v2] *-symbol-check: Don't hard-code nm executable
Quoted 9 lines · Eric Engestrom
From: Heiko Becker <[email protected]>
Helpful if your nm executable has a prefix based on the architecture, for example.
Signed-off-by Heiko Becker <[email protected]>Cc Timo Gurr <[email protected]>[Eric: v2: rebase and add Meson support]Signed-off-by Eric Engestrom <[email protected]>
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH libdrm v2] *-symbol-check: Don't hard-code nm executable
In reply to Eric Engestrommeson.build pkg.generate( · line 326
Quoted 9 lines · Eric Engestrom
From: Heiko Becker <[email protected]>
Helpful if your nm executable has a prefix based on the architecture, for example.
meson.build +3
-0+env_test = environment() +env_test.set('NM', find_program('nm').path()) +
Everything else is great, just not too sure about this hunk. Are you sure it does what the commit message says?
I know meson needs special configuration file for cross compilation - one example where nm has prefix.
Yet the manual [1] does not say anything about nm. I cannot find any instances of nm in the docs all together :-\
If Meson does not handle it currently, please open a bug and add a comment with the bug number/link.
Thanks
Emil
[1] http://mesonbuild.com/Cross-compilation.html
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH libdrm v2] *-symbol-check: Don't hard-code nm executable
Quoted 7 lines · Emil Velikov
Quoted 5 lines · Eric Engestrom
From: Heiko Becker <[email protected]>
Helpful if your nm executable has a prefix based on the architecture, for example.
Quoted 5 lines
meson.build pkg.generate( · line 326
Quoted 3 lines
meson.build +3
-0+env_test = environment() +env_test.set('NM', find_program('nm').path()) +Everything else is great, just not too sure about this hunk. Are you sure it does what the commit message says?
It does, I even asked the meson devs to be sure. find_program() respects the crossfile, unless native: true is added [2].
Quoted 5 lines
I know meson needs special configuration file for cross compilation - one example where nm has prefix.
Yet the manual [1] does not say anything about nm. I cannot find any instances of nm in the docs all together :-\
There's nothing special about nm here, it's just a program that can be set via the crossfile, like cc or ar.
I guess the documentation on the cross-compilation page [1] could be improved to make the behaviour of find_program() more explicit; care to send a patch? :)
Quoted 7 lines
If Meson does not handle it currently, please open a bug and add a comment with the bug number/link.
Thanks
Emil
[1] http://mesonbuild.com/Cross-compilation.html
[2] http://mesonbuild.com/Reference-manual.html#find_program
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH libdrm v2] *-symbol-check: Don't hard-code nm executable
Quoted 30 lines · Eric Engestrom
Quoted 7 lines · Emil Velikov
Quoted 5 lines · Eric Engestrom
From: Heiko Becker <[email protected]>
Helpful if your nm executable has a prefix based on the architecture, for example.
Quoted 5 lines
meson.build pkg.generate( · line 326
Quoted 3 lines
meson.build +3
-0+env_test = environment() +env_test.set('NM', find_program('nm').path()) +Everything else is great, just not too sure about this hunk. Are you sure it does what the commit message says?
It does, I even asked the meson devs to be sure.
find_program()respects the crossfile, unlessnative: trueis added [2].Quoted 5 lines
I know meson needs special configuration file for cross compilation - one example where nm has prefix.
Yet the manual [1] does not say anything about nm. I cannot find any instances of nm in the docs all together :-\There's nothing special about
nmhere, it's just a program that can be set via the crossfile, likeccorar.
I guess the documentation on the cross-compilation page [1] could be improved to make the behaviour offind_program()more explicit; care to send a patch? :)Quoted 1 line
Quoted 8 lines
Quoted 6 lines
If Meson does not handle it currently, please open a bug and add a comment with the bug number/link.
Thanks
Emil
[1] http://mesonbuild.com/Cross-compilation.html[2] http://mesonbuild.com/Reference-manual.html#find_program
Oh btw, I'm making the same change on Mesa right now, I'll send it out in a bit, or next week if I don't have enough spare time today.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Emil Velikov
Reviewed-byRe: [PATCH libdrm v2] *-symbol-check: Don't hard-code nm executable
In reply to Eric EngestromQuoted 8 lines · Eric Engestrom
Quoted 7 lines · Emil Velikov
Quoted 5 lines · Eric Engestrom
From: Heiko Becker <[email protected]>
Helpful if your nm executable has a prefix based on the architecture, for example.
Quoted 9 lines
Quoted 5 lines
meson.build pkg.generate( · line 326
Quoted 3 lines
meson.build +3
-0+env_test = environment() +env_test.set('NM', find_program('nm').path()) +Everything else is great, just not too sure about this hunk. Are you sure it does what the commit message says?
It does, I even asked the meson devs to be sure.
find_program()respects the crossfile, unlessnative: trueis added [2].
I was thinking of cases where a) you're doing a native build and b) the program name has a prefix.
In reality that shouldn't happen, often, so let's worry if we get multiple bug reports.
Quoted 6 lines
Quoted 5 lines
I know meson needs special configuration file for cross compilation - one example where nm has prefix.
Yet the manual [1] does not say anything about nm. I cannot find any instances of nm in the docs all together :-\
Quoted 6 lines
There's nothing special about
nmhere, it's just a program that can be set via the crossfile, likeccorar.
I guess the documentation on the cross-compilation page [1] could be improved to make the behaviour offind_program()more explicit; care to send a patch? :)
Great, I'll let you do the honours of tweaking Meson/its documentation.
Thank you very much for the clarification.
The patch is
-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=105163
Eric Engestrom <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED--- Comment #1 from Eric Engestrom <[email protected]> --- Fixed as of:
commit 4f08bfe96da1542f336589edf310d06ebce3cf20
Author: Heiko Becker <[email protected]> Date: Mon Feb 19 15:13:15 2018 +0000
*-symbol-check: Don't hard-code nm executable
Helpful if your nm executable has a prefix based on the architecture, for example.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel