Skip to contentSkip to conversation

kexec: fix build when BR2_STRIP_none=y

PATCH New Marcin Nowakowski 4 participants 8 messages Dec 2, 2016 – Dec 7, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec: fix build when BR2_STRIP_none=y

When BR2_STRIP is set to none, a dummy 'true' app is used instead of strip utility. However, kexec package always requires a real strip executable as it is used to generate intermediate files during the build process.

If 'true' is used the build system runs the following command:

true --strip-debug -o purgatory/purgatory.ro purgatory/purgatory.ro.sym

which obviously doesn't do anything useful and the build later fails with:

bin/bin-to-hex purgatory < purgatory/purgatory.ro > kexec/purgatory.c /bin/sh: purgatory/purgatory.ro: No such file or directory kexec/Makefile:7: recipe for target 'kexec/purgatory.c' failed make[2]: *** [kexec/purgatory.c] Error 1

To resolve it always specify STRIP=$(CROSS_COMPILE)strip, regardless of buildroot configuration.

---
 package/kexec/kexec.mk | 2 ++
 1 file changed, 2 insertions(+)
package/kexec/kexec.mk +2 -0
index 4ca55e5..08c5424 100644
@@ -10,6 +10,8 @@ KEXEC_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/kernel/kexec
 KEXEC_LICENSE = GPLv2
 KEXEC_LICENSE_FILES = COPYING
 
+KEXEC_MAKE_OPTS = STRIP="$(TARGET_CROSS)strip"
+
 ifeq ($(BR2_PACKAGE_KEXEC_ZLIB),y)
 KEXEC_CONF_OPTS += --with-zlib
 KEXEC_DEPENDENCIES = zlib
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 kexec: fix build when BR2_STRIP_none=y

Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Marcin" == Marcin Nowakowski <[email protected]> writes:

When BR2_STRIP is set to none, a dummy 'true' app is used instead of strip utility. However, kexec package always requires a real strip executable as it is used to generate intermediate files during the build process.

If 'true' is used the build system runs the following command:

true --strip-debug -o purgatory/purgatory.ro purgatory/purgatory.ro.sym

which obviously doesn't do anything useful and the build later fails with:

Quoted 7 lines

bin/bin-to-hex purgatory < purgatory/purgatory.ro > kexec/purgatory.c /bin/sh: purgatory/purgatory.ro: No such file or directory kexec/Makefile:7: recipe for target 'kexec/purgatory.c' failed make[2]: *** [kexec/purgatory.c] Error 1

To resolve it always specify STRIP=$(CROSS_COMPILE)strip, regardless of buildroot configuration.

My first thought was that we shouldn't strip when the user has selected not to do so, but as it leaves the unstripped variant around I guess it is OK.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 kexec: fix build when BR2_STRIP_none=y

Hello,

Quoted 17 lines · Peter Korsgaard
Quoted 16 lines

When BR2_STRIP is set to none, a dummy 'true' app is used instead of strip utility. However, kexec package always requires a real strip executable as it is used to generate intermediate files during the build process.

If 'true' is used the build system runs the following command:

true --strip-debug -o purgatory/purgatory.ro purgatory/purgatory.ro.sym

which obviously doesn't do anything useful and the build later fails with:

bin/bin-to-hex purgatory < purgatory/purgatory.ro > kexec/purgatory.c /bin/sh: purgatory/purgatory.ro: No such file or directory kexec/Makefile:7: recipe for target 'kexec/purgatory.c' failed make[2]: *** [kexec/purgatory.c] Error 1

Quoted 6 lines
Quoted 2 lines

To resolve it always specify STRIP=$(CROSS_COMPILE)strip, regardless of buildroot configuration.

My first thought was that we shouldn't strip when the user has selected not to do so, but as it leaves the unstripped variant around I guess it is OK.

My other thought is that I believe it's not the first time (see commit fc174b7057495ebb31393ae27f3ceeefdc490022), so perhaps our idea of having STRIP=true when BR2_STRIP_none=y is a bad idea, and we should handle this in a different way.

Thomas

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

PATCH 1/1 kexec: fix build when BR2_STRIP_none=y

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hi,

Quoted 4 lines

My other thought is that I believe it's not the first time (see commit fc174b7057495ebb31393ae27f3ceeefdc490022), so perhaps our idea of having STRIP=true when BR2_STRIP_none=y is a bad idea, and we should handle this in a different way.

The question is how? Create a dummy shell script to better emulate the command line options / behaviour of strip?

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/1 kexec: fix build when BR2_STRIP_none=y

Hello,

Quoted 9 lines · Peter Korsgaard

Hi,

Quoted 4 lines

My other thought is that I believe it's not the first time (see commit fc174b7057495ebb31393ae27f3ceeefdc490022), so perhaps our idea of having STRIP=true when BR2_STRIP_none=y is a bad idea, and we should handle this in a different way.

The question is how? Create a dummy shell script to better emulate the command line options / behaviour of strip?

I'm not sure. Yet another wrapper kind of sucks. Is it possible to pass enough options to strip to have it not strip anything? :-)

Thomas

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

PATCH 1/1 kexec: fix build when BR2_STRIP_none=y

Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,

Quoted 7 lines · Peter Korsgaard

Hi,

Quoted 4 lines

My other thought is that I believe it's not the first time (see commit fc174b7057495ebb31393ae27f3ceeefdc490022), so perhaps our idea of having STRIP=true when BR2_STRIP_none=y is a bad idea, and we should handle this in a different way.

Quoted 5 lines
Quoted 2 lines

The question is how? Create a dummy shell script to better emulate the command line options / behaviour of strip?

I'm not sure. Yet another wrapper kind of sucks. Is it possible to pass enough options to strip to have it not strip anything? :-)

Not that I'm aware of at least. Anyone?

Signature · 1 line
Bye, Peter Korsgaard
#6 lore raw

PATCH 1/1 kexec: fix build when BR2_STRIP_none=y

Quoted 12 lines · Peter Korsgaard
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,

Quoted 7 lines · Peter Korsgaard

Hi,

Quoted 4 lines

My other thought is that I believe it's not the first time (see commit fc174b7057495ebb31393ae27f3ceeefdc490022), so perhaps our idea of having STRIP=true when BR2_STRIP_none=y is a bad idea, and we should handle this in a different way.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

The question is how? Create a dummy shell script to better emulate the command line options / behaviour of strip?

I'm not sure. Yet another wrapper kind of sucks. Is it possible to pass enough options to strip to have it not strip anything? :-)

Not that I'm aware of at least. Anyone?

Why do we have to set TARGET_STRIP to something different when
BR2_STRIP_none=y? BR2_STRIP_none is supposed to mean that we don't strip all binaries, it doesn't mean that an individual package isn't allowed to strip its binaries...

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#7 lore raw

PATCH 1/1 kexec: fix build when BR2_STRIP_none=y

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Hi,

Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 7 lines
Quoted 4 lines

My other thought is that I believe it's not the first time (see commit fc174b7057495ebb31393ae27f3ceeefdc490022), so perhaps our idea of having STRIP=true when BR2_STRIP_none=y is a bad idea, and we should handle this in a different way.

The question is how? Create a dummy shell script to better emulate the command line options / behaviour of strip?

I'm not sure. Yet another wrapper kind of sucks. Is it possible to pass enough options to strip to have it not strip anything? :-)

Quoted 6 lines
Quoted 1 line

Not that I'm aware of at least. Anyone?

Why do we have to set TARGET_STRIP to something different when
BR2_STRIP_none=y? BR2_STRIP_none is supposed to mean that we don't strip all binaries, it doesn't mean that an individual package isn't allowed to strip its binaries...

Sorry, I don't agree. Quite some packages afaik call $(STRIP) (which we set to TARGET_STRIP) in their 'make install'. Users don't really care if binaries are stripped during <foo>-install-target or target-finalize, the end result for them is the same.

Signature · 1 line
Bye, Peter Korsgaard