Skip to contentSkip to conversation

parisc: fix the exit status of arch/parisc/nm

PATCH In review Masahiro Yamada 2 participants 3 messages May 27, 2022

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

PATCH 1/1 parisc: fix the exit status of arch/parisc/nm

Parisc overrides 'nm' with a shell script. I was hit by a false-positive error of $(NM) because this script returns the exit code of grep instead of ${CROSS_COMPILE}nm. (grep exits with 1 if no lines were selected)

I tried to fix it, but in the code review, Helge suggested to remove it entirely. [1]

This script was added in 2003. [2]

Presumably, it was a workaround for old toolchains (but even the parisc maintainer does not know the detail any more).

Hopefully recent tools should work fine.

[1]: https://lore.kernel.org/all/[email protected]/
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=36eaa6e4c0e0b6950136b956b72fd08155b92ca3

---

I want to apply this to kbuild tree with Helge's Ack

 arch/parisc/Makefile | 1 -
 arch/parisc/nm       | 6 ------
 2 files changed, 7 deletions(-)
 delete mode 100644 arch/parisc/nm
arch/parisc/Makefile +0 -1
index aca1710fd658..e38d993d87f2 100644
@@ -18,7 +18,6 @@
 boot := arch/parisc/boot
 KBUILD_IMAGE := $(boot)/bzImage
 
-NM		= sh $(srctree)/arch/parisc/nm
 CHECKFLAGS	+= -D__hppa__=1
 
 ifdef CONFIG_64BIT
arch/parisc/nm deleted +0 -6
deleted file mode 100644
index c788308de33f..000000000000
@@ -1,6 +0,0 @@
-#!/bin/sh
-##
-# Hack to have an nm which removes the local symbols.  We also rely
-# on this nm being hidden out of the ordinarily executable path
-##
-${CROSS_COMPILE}nm $* | grep -v '.LC*[0-9]*$'
Signature · 1 line
2.32.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Masahiro Yamada

Parisc overrides 'nm' with a shell script. I was hit by a false-positive error of $(NM) because this script returns the exit code of grep instead of ${CROSS_COMPILE}nm. (grep exits with 1 if no lines were selected)

I tried to fix it, but in the code review, Helge suggested to remove it entirely. [1]

This script was added in 2003. [2]

Presumably, it was a workaround for old toolchains (but even the parisc maintainer does not know the detail any more).

Quoted 7 lines

Hopefully recent tools should work fine.

[1]: https://lore.kernel.org/all/[email protected]/
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=36eaa6e4c0e0b6950136b956b72fd08155b92ca3

Thank you!
Helge

Quoted 33 lines

---

I want to apply this to kbuild tree with Helge's Ack

 arch/parisc/Makefile | 1 -
 arch/parisc/nm       | 6 ------
 2 files changed, 7 deletions(-)
 delete mode 100644 arch/parisc/nm
arch/parisc/Makefile +0 -1
index aca1710fd658..e38d993d87f2 100644
@@ -18,7 +18,6 @@
 boot := arch/parisc/boot
 KBUILD_IMAGE := $(boot)/bzImage
 
-NM		= sh $(srctree)/arch/parisc/nm
 CHECKFLAGS	+= -D__hppa__=1
 
 ifdef CONFIG_64BIT
arch/parisc/nm deleted +0 -6
deleted file mode 100644
index c788308de33f..000000000000
@@ -1,6 +0,0 @@
-#!/bin/sh
-##
-# Hack to have an nm which removes the local symbols.  We also rely
-# on this nm being hidden out of the ordinarily executable path
-##
-${CROSS_COMPILE}nm $* | grep -v '.LC*[0-9]*$'
#2 lore raw
Quoted 19 lines · Helge Deller
Quoted 17 lines · Masahiro Yamada

Parisc overrides 'nm' with a shell script. I was hit by a false-positive error of $(NM) because this script returns the exit code of grep instead of ${CROSS_COMPILE}nm. (grep exits with 1 if no lines were selected)

I tried to fix it, but in the code review, Helge suggested to remove it entirely. [1]

This script was added in 2003. [2]

Presumably, it was a workaround for old toolchains (but even the parisc maintainer does not know the detail any more).

Hopefully recent tools should work fine.

[1]: https://lore.kernel.org/all/[email protected]/
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=36eaa6e4c0e0b6950136b956b72fd08155b92ca3

Quoted 8 lines
Quoted 2 lines

Thank you!
Helge

I just forgot to change the patch subject.

I changed it to

"parisc: remove arch/parisc/nm"

Applied to linux-kbuild.
Thanks for the ack.

Signature · 2 lines
Best Regards
Masahiro Yamada