diff mbox series

kbuild: add KBUILD_HOSTLDFLAGS to cmd_host-csingle

Message ID 20220824083722.2963-1-heiko.thiery@gmail.com
State Accepted
Commit a638bd349ea438256daf9c1f323402a137c55e03
Delegated to: Tom Rini
Headers show
Series kbuild: add KBUILD_HOSTLDFLAGS to cmd_host-csingle | expand

Commit Message

Heiko Thiery Aug. 24, 2022, 8:37 a.m. UTC
When compiling executables from a single.c file, the linker is also
invoked. Pass the flags like the other linker commands.

cherry-pick kbuild change from Linux:

63185b46cdb3 (kbuild: use HOSTLDFLAGS for single .c executables)

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
 scripts/Makefile.host | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass Aug. 25, 2022, 1:25 a.m. UTC | #1
On Wed, 24 Aug 2022 at 01:37, Heiko Thiery <heiko.thiery@gmail.com> wrote:
>
> When compiling executables from a single.c file, the linker is also
> invoked. Pass the flags like the other linker commands.
>
> cherry-pick kbuild change from Linux:
>
> 63185b46cdb3 (kbuild: use HOSTLDFLAGS for single .c executables)
>
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
> ---
>  scripts/Makefile.host | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini Aug. 31, 2022, 11:33 p.m. UTC | #2
On Wed, Aug 24, 2022 at 10:37:23AM +0200, Heiko Thiery wrote:

> When compiling executables from a single.c file, the linker is also
> invoked. Pass the flags like the other linker commands.
> 
> cherry-pick kbuild change from Linux:
> 
> 63185b46cdb3 (kbuild: use HOSTLDFLAGS for single .c executables)
> 
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 69983a19a4..7624304e3e 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -89,7 +89,7 @@  hostcxx_flags  = -Wp,-MD,$(depfile) $(__hostcxx_flags)
 # Create executable from a single .c file
 # host-csingle -> Executable
 quiet_cmd_host-csingle 	= HOSTCC  $@
-      cmd_host-csingle	= $(HOSTCC) $(hostc_flags) -o $@ $< \
+      cmd_host-csingle	= $(HOSTCC) $(hostc_flags) $(KBUILD_HOSTLDFLAGS) -o $@ $< \
 	  	$(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F))
 $(host-csingle): $(obj)/%: $(src)/%.c FORCE
 	$(call if_changed_dep,host-csingle)