[PATCH 1/3] kbuild: Support HOSTLDFLAGS

From: Laura Abbott
Date: Wed Mar 28 2018 - 20:48:24 EST



In addition to HOSTCFLAGS, there's HOSTLDFLAGS. Ensure these get passed to
calls to build host binaries.

Signed-off-by: Laura Abbott <labbott@xxxxxxxxxx>
---
scripts/Makefile.host | 6 +++---
tools/build/Makefile.build | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index e6dc6ae2d7c4..a3a0e2282a56 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -84,7 +84,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) $(HOSTLDFLAGS) $(hostc_flags) -o $@ $< \
$(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
$(host-csingle): $(obj)/%: $(src)/%.c FORCE
$(call if_changed_dep,host-csingle)
@@ -102,7 +102,7 @@ $(call multi_depend, $(host-cmulti), , -objs)
# Create .o file from a single .c file
# host-cobjs -> .o
quiet_cmd_host-cobjs = HOSTCC $@
- cmd_host-cobjs = $(HOSTCC) $(hostc_flags) -c -o $@ $<
+ cmd_host-cobjs = $(HOSTCC) $(HOSTLDFLAGS) $(hostc_flags) -c -o $@ $<
$(host-cobjs): $(obj)/%.o: $(src)/%.c FORCE
$(call if_changed_dep,host-cobjs)

@@ -126,7 +126,7 @@ $(host-cxxobjs): $(obj)/%.o: $(src)/%.cc FORCE
# Compile .c file, create position independent .o file
# host-cshobjs -> .o
quiet_cmd_host-cshobjs = HOSTCC -fPIC $@
- cmd_host-cshobjs = $(HOSTCC) $(hostc_flags) -fPIC -c -o $@ $<
+ cmd_host-cshobjs = $(HOSTCC) $(HOSTLDFLAGS) $(hostc_flags) -fPIC -c -o $@ $<
$(host-cshobjs): $(obj)/%.o: $(src)/%.c FORCE
$(call if_changed_dep,host-cshobjs)

diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index cd72016c3cfa..cab55f0d90e1 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -64,7 +64,7 @@ quiet_cmd_cc_o_c = CC $@
cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<

quiet_cmd_host_cc_o_c = HOSTCC $@
- cmd_host_cc_o_c = $(HOSTCC) $(host_c_flags) -c -o $@ $<
+ cmd_host_cc_o_c = $(HOSTCC) $(HOSTLDFLAGS) $(host_c_flags) -c -o $@ $<

quiet_cmd_cxx_o_c = CXX $@
cmd_cxx_o_c = $(CXX) $(cxx_flags) -c -o $@ $<
--
2.16.2