Skip to contentSkip to conversation

kbuild: add KBUILD_HOSTLDFLAGS to cmd_host-csingle

PATCH In review Heiko Thiery 3 participants 3 messages Aug 24, 2022 – Aug 31, 2022 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: add KBUILD_HOSTLDFLAGS to cmd_host-csingle

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)

---
 scripts/Makefile.host | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.host +1 -1
index 69983a19a4..7624304e3e 100644
@@ -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)
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Heiko Thiery

When compiling executables from a single.c file, the linker is also invoked. Pass the flags like the other linker commands.

Quoted 8 lines

cherry-pick kbuild change from Linux:

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

---
 scripts/Makefile.host | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)