lkml.org 
[lkml]   [2018]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/3] kbuild: Support HOSTLDFLAGS
2018-03-29 9:48 GMT+09:00 Laura Abbott <labbott@redhat.com>:
>
> In addition to HOSTCFLAGS, there's HOSTLDFLAGS. Ensure these get passed to
> calls to build host binaries.
>
> Signed-off-by: Laura Abbott <labbott@redhat.com>
> ---
> 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)


This hunk is correct, but Robin posted this.
https://patchwork.kernel.org/patch/10243073/

Somehow it fell into a crack, and I missed to pick it up.
I will apply it lately.




> @@ -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)
>

This does not involve the link stage.
You should not do this.


> @@ -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 $@ $<



--
Best Regards
Masahiro Yamada

\
 
 \ /
  Last update: 2018-04-05 07:15    [W:0.040 / U:4.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site