Skip to contentSkip to conversation

core: always pass full path to strip command

PATCH New Yann E. MORIN 3 participants 3 messages Jul 1, 2017 – Jul 2, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 core: always pass full path to strip command

In some cases, passing STRIP=true is not sufficient to disable striping altogether, as some (incorrectly generated?) configure scripts will ignore a ${STRIP} that is not a full path.

This is the case, for example, for nmap, which ends up using the host strip command when we pass STRIP=true:

checking for arm-buildroot-linux-gnueabihf-strip... no
checking for strip... /usr/bin/strip
configure: WARNING: using cross tools not prefixed with host triplet
[--SNIP--]
/usr/bin/install -c -c -m 755 nping /home/ymorin/dev/buildroot/O/target/usr/bin/nping /usr/bin/strip -x /home/ymorin/dev/buildroot/O/target/usr/bin/nping
/usr/bin/strip: Unable to recognise the format of the input file `/home/ymorin/dev/buildroot/O/target/usr/bin/nping'

We fix that by forcing a full path to the strip sommand when it is
disabled: STRIP=/bin/true

---
 package/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/Makefile.in +1 -1
index 4a3eb26963..c1dc714331 100644
@@ -207,7 +207,7 @@ TARGET_STRIP = $(TARGET_CROSS)strip
 STRIPCMD = $(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note
 endif
 ifeq ($(BR2_STRIP_none),y)
-TARGET_STRIP = true
+TARGET_STRIP = /bin/true
 STRIPCMD = $(TARGET_STRIP)
 endif
 INSTALL := $(shell which install || type -p install)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 core: always pass full path to strip command

Hello,

Quoted 15 lines · Yann E. MORIN

In some cases, passing STRIP=true is not sufficient to disable striping altogether, as some (incorrectly generated?) configure scripts will ignore a ${STRIP} that is not a full path.

This is the case, for example, for nmap, which ends up using the host strip command when we pass STRIP=true:

checking for arm-buildroot-linux-gnueabihf-strip... no
checking for strip... /usr/bin/strip
configure: WARNING: using cross tools not prefixed with host triplet
[--SNIP--]
/usr/bin/install -c -c -m 755 nping /home/ymorin/dev/buildroot/O/target/usr/bin/nping /usr/bin/strip -x /home/ymorin/dev/buildroot/O/target/usr/bin/nping
/usr/bin/strip: Unable to recognise the format of the input file `/home/ymorin/dev/buildroot/O/target/usr/bin/nping'

Quoted 7 lines

We fix that by forcing a full path to the strip sommand when it is
disabled: STRIP=/bin/true

---
 package/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 core: always pass full path to strip command

In reply to Yann E. MORIN
Quoted 17 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

In some cases, passing STRIP=true is not sufficient to disable striping altogether, as some (incorrectly generated?) configure scripts will ignore a ${STRIP} that is not a full path.

This is the case, for example, for nmap, which ends up using the host strip command when we pass STRIP=true:

checking for arm-buildroot-linux-gnueabihf-strip... no
checking for strip... /usr/bin/strip
configure: WARNING: using cross tools not prefixed with host triplet
[--SNIP--]
/usr/bin/install -c -c -m 755 nping /home/ymorin/dev/buildroot/O/target/usr/bin/nping /usr/bin/strip -x /home/ymorin/dev/buildroot/O/target/usr/bin/nping
/usr/bin/strip: Unable to recognise the format of the input file `/home/ymorin/dev/buildroot/O/target/usr/bin/nping'

Quoted 4 lines

We fix that by forcing a full path to the strip sommand when it is
disabled: STRIP=/bin/true

Committed to 2017.02.x and 2017.05.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard