diff mbox series

swupdate: pass full TARGET_CONFIGURE_OPTS

Message ID 20181217234301.7111-1-arnout@mind.be
State Superseded
Headers show
Series swupdate: pass full TARGET_CONFIGURE_OPTS | expand

Commit Message

Arnout Vandecappelle Dec. 17, 2018, 11:43 p.m. UTC
Although we set CONFIG_CROSS_COMPILE to TARGET_CROSS in swupdate's
.config file, swupdate's build system just appends 'cc' to it, not
'gcc'. Some external toolchains don't provide a cc -> gcc symlink,
leading to errors like:

/bin/sh: .../host/bin/arm-none-linux-gnueabi-cc: No such file or directory

We can just pass TARGET_CONFIGURE_OPTS which explicitly sets CC=, like
we do for all other packages.

Although this makes setting CONFIG_CROSS_COMPILE redundant, it's nice to
keep it as well for consistency.

Fixes:
http://autobuild.buildroot.net/results/e302d0edb59ff7617b5f2d21f06eb65ae04981fe
http://autobuild.buildroot.net/results/dbb69acadc20b4bb559311348eca276c1e6343f7

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Peter Korsgaard <peter@korsgaard.com>
---
 package/swupdate/swupdate.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Korsgaard Dec. 18, 2018, 8:22 a.m. UTC | #1
>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes:

 > Although we set CONFIG_CROSS_COMPILE to TARGET_CROSS in swupdate's
 > .config file, swupdate's build system just appends 'cc' to it, not
 > 'gcc'. Some external toolchains don't provide a cc -> gcc symlink,
 > leading to errors like:

 > /bin/sh: .../host/bin/arm-none-linux-gnueabi-cc: No such file or directory

 > We can just pass TARGET_CONFIGURE_OPTS which explicitly sets CC=, like
 > we do for all other packages.

 > Although this makes setting CONFIG_CROSS_COMPILE redundant, it's nice to
 > keep it as well for consistency.

 > Fixes:
 > http://autobuild.buildroot.net/results/e302d0edb59ff7617b5f2d21f06eb65ae04981fe
 > http://autobuild.buildroot.net/results/dbb69acadc20b4bb559311348eca276c1e6343f7

 > Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
 > Cc: Peter Korsgaard <peter@korsgaard.com>

Committed, thanks.

Do we still want https://patchwork.ozlabs.org/patch/1014334/ to handle
similar issues in other packages?
Peter Korsgaard Dec. 18, 2018, 8:30 a.m. UTC | #2
>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes:

 > Although we set CONFIG_CROSS_COMPILE to TARGET_CROSS in swupdate's
 > .config file, swupdate's build system just appends 'cc' to it, not
 > 'gcc'. Some external toolchains don't provide a cc -> gcc symlink,
 > leading to errors like:

 > /bin/sh: .../host/bin/arm-none-linux-gnueabi-cc: No such file or directory

 > We can just pass TARGET_CONFIGURE_OPTS which explicitly sets CC=, like
 > we do for all other packages.

Hmm, wait - This also passes LD="$(TARGET_LD)", whereas swupdate used CC
to link. Is that really working?
Peter Korsgaard Dec. 18, 2018, 9:06 a.m. UTC | #3
>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:

>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes:
 >> Although we set CONFIG_CROSS_COMPILE to TARGET_CROSS in swupdate's
 >> .config file, swupdate's build system just appends 'cc' to it, not
 >> 'gcc'. Some external toolchains don't provide a cc -> gcc symlink,
 >> leading to errors like:

 >> /bin/sh: .../host/bin/arm-none-linux-gnueabi-cc: No such file or directory

 >> We can just pass TARGET_CONFIGURE_OPTS which explicitly sets CC=, like
 >> we do for all other packages.

 > Hmm, wait - This also passes LD="$(TARGET_LD)", whereas swupdate used CC
 > to link. Is that really working?

No it doesn't:

  LD      core/built-in.o
/home/peko/source/buildroot/output-sw/host/bin/mips-img-linux-gnu-ld: core/swupdate.o: compiled for a little endian system and target is big endian

scripts/Makefile.build:224: recipe for target 'core/built-in.o' failed
make[3]: *** [core/built-in.o] Error 1
Makefile:480: recipe for target 'core' failed
make[2]: *** [core] Error 2

With this defconfig:
BR2_mipsel=y
BR2_mips_32r6=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_PACKAGE_SWUPDATE=y

I will change it to explicitly pass CC="$(TARGET_CC)" LD="$(TARGET_CC)"
instead.
Arnout Vandecappelle Dec. 18, 2018, 9:08 a.m. UTC | #4
On 18/12/2018 10:06, Peter Korsgaard wrote:
>>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:
> 
>>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes:
>  >> Although we set CONFIG_CROSS_COMPILE to TARGET_CROSS in swupdate's
>  >> .config file, swupdate's build system just appends 'cc' to it, not
>  >> 'gcc'. Some external toolchains don't provide a cc -> gcc symlink,
>  >> leading to errors like:
> 
>  >> /bin/sh: .../host/bin/arm-none-linux-gnueabi-cc: No such file or directory
> 
>  >> We can just pass TARGET_CONFIGURE_OPTS which explicitly sets CC=, like
>  >> we do for all other packages.
> 
>  > Hmm, wait - This also passes LD="$(TARGET_LD)", whereas swupdate used CC
>  > to link. Is that really working?

 Crap. I did think of that but not hard enough. Mental note: next time test
mipsel...

 Regards,
 Arnout

> 
> No it doesn't:
> 
>   LD      core/built-in.o
> /home/peko/source/buildroot/output-sw/host/bin/mips-img-linux-gnu-ld: core/swupdate.o: compiled for a little endian system and target is big endian
> 
> scripts/Makefile.build:224: recipe for target 'core/built-in.o' failed
> make[3]: *** [core/built-in.o] Error 1
> Makefile:480: recipe for target 'core' failed
> make[2]: *** [core] Error 2
> 
> With this defconfig:
> BR2_mipsel=y
> BR2_mips_32r6=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_PACKAGE_SWUPDATE=y
> 
> I will change it to explicitly pass CC="$(TARGET_CC)" LD="$(TARGET_CC)"
> instead.
>
diff mbox series

Patch

diff --git a/package/swupdate/swupdate.mk b/package/swupdate/swupdate.mk
index 6285437aaa..27a53e3837 100644
--- a/package/swupdate/swupdate.mk
+++ b/package/swupdate/swupdate.mk
@@ -118,7 +118,7 @@  define SWUPDATE_KCONFIG_FIXUP_CMDS
 endef
 
 define SWUPDATE_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(SWUPDATE_MAKE_ENV) $(MAKE) -C $(@D)
+	$(TARGET_CONFIGURE_OPTS) $(SWUPDATE_MAKE_ENV) $(MAKE) -C $(@D)
 endef
 
 define SWUPDATE_INSTALL_TARGET_CMDS