]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
kbuild: add KBUILD_HOSTLDFLAGS to cmd_host-csingle
authorHeiko Thiery <heiko.thiery@gmail.com>
Wed, 24 Aug 2022 08:37:23 +0000 (10:37 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 31 Aug 2022 16:16:01 +0000 (12:16 -0400)
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>
scripts/Makefile.host

index 69983a19a4422fdd155013f3b4fcab8728ac394a..7624304e3e9d2dccf0885d38ee47e5aa601531e8 100644 (file)
@@ -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)