linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/7] HOSTFLAGS and HOSTLDFLAGS from the environment
@ 2018-07-10  0:45 Laura Abbott
  2018-07-10  0:46 ` [PATCHv2 7/7] Kbuild: Use HOST*FLAGS options from the command line Laura Abbott
  2018-07-12 10:13 ` [PATCHv2 0/7] HOSTFLAGS and HOSTLDFLAGS from the environment Masahiro Yamada
  0 siblings, 2 replies; 6+ messages in thread
From: Laura Abbott @ 2018-07-10  0:45 UTC (permalink / raw)
  To: Masahiro Yamada, Josh Poimboeuf, Jiri Olsa
  Cc: Laura Abbott, linux-kbuild, linux-kernel, Robin Jarry,
	Jonathan Corbet, linux-doc


Hi,

This is v2 of the series to set HOSTCFLAGS and HOSTLDFLAGS from the
environment. The changes are mostly minor fixups requested and also
include documentation of the new options.

Laura Abbott (7):
  tools: build: Fixup host c flags
  tools: build: Use HOSTLDFLAGS with fixdep
  treewide: Rename HOSTCFLAGS -> KBUILD_HOSTCFLAGS
  treewide: Rename HOSTCXXFLAGS to KBUILD_HOSTCXXFLAGS
  treewide: Rename HOSTLDFLAGS to KBUILD_HOSTLDFLAGS
  treewide: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS
  Kbuild: Use HOST*FLAGS options from the command line

 Documentation/kbuild/kbuild.txt | 16 ++++++++++++++++
 Makefile                        | 17 +++++++++--------
 arch/alpha/boot/Makefile        |  2 +-
 net/bpfilter/Makefile           |  4 ++--
 samples/bpf/Makefile            | 22 +++++++++++-----------
 samples/seccomp/Makefile        |  6 +++---
 scripts/Kbuild.include          |  2 +-
 scripts/Makefile                |  4 ++--
 scripts/Makefile.host           | 24 ++++++++++++------------
 scripts/kconfig/Makefile        | 10 +++++-----
 tools/build/Build.include       |  2 +-
 tools/build/Makefile            |  2 +-
 tools/objtool/Makefile          |  4 ++--
 tools/perf/pmu-events/Build     |  2 +-
 14 files changed, 67 insertions(+), 50 deletions(-)

-- 
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCHv2 7/7] Kbuild: Use HOST*FLAGS options from the command line
  2018-07-10  0:45 [PATCHv2 0/7] HOSTFLAGS and HOSTLDFLAGS from the environment Laura Abbott
@ 2018-07-10  0:46 ` Laura Abbott
  2018-07-12 10:11   ` Masahiro Yamada
  2018-07-12 10:13 ` [PATCHv2 0/7] HOSTFLAGS and HOSTLDFLAGS from the environment Masahiro Yamada
  1 sibling, 1 reply; 6+ messages in thread
From: Laura Abbott @ 2018-07-10  0:46 UTC (permalink / raw)
  To: Masahiro Yamada, Josh Poimboeuf, Jiri Olsa
  Cc: Laura Abbott, linux-kbuild, linux-kernel, Robin Jarry,
	Jonathan Corbet, linux-doc


Now that we have the rename in place, reuse the HOST*FLAGS options as
something that can be set from the command line and included with the
rest of the flags.

Signed-off-by: Laura Abbott <labbott@redhat.com>
---
v2: Use the correct name for HOSTLDLIBS, update documentation.
---
 Documentation/kbuild/kbuild.txt | 16 ++++++++++++++++
 Makefile                        |  9 +++++----
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt
index 6c9c69ec3986..9847a5974826 100644
--- a/Documentation/kbuild/kbuild.txt
+++ b/Documentation/kbuild/kbuild.txt
@@ -238,3 +238,19 @@ KBUILD_VMLINUX_LIBS
 All .a "lib" files for vmlinux.
 KBUILD_VMLINUX_INIT, KBUILD_VMLINUX_MAIN, and KBUILD_VMLINUX_LIBS together
 specify all the object files used to link vmlinux.
+
+HOSTCFLAGS
+--------------------------------------------------
+Additional flags to be passed to $(HOSTCC) when building host programs.
+
+HOSTLDFLAGS
+--------------------------------------------------
+Additional flags to be passed to $(HOSTLD) when building host programs.
+
+HOSTCXXFLAGS
+--------------------------------------------------
+Additional flags to be passed to $(HOSTCXX) when building host programs.
+
+HOSTLDLIBS
+--------------------------------------------------
+Additional libraries to link against when building host programs.
diff --git a/Makefile b/Makefile
index 96e34381d9ee..c2ee1d4c12c9 100644
--- a/Makefile
+++ b/Makefile
@@ -360,10 +360,11 @@ HOST_LFS_LIBS := $(shell getconf LFS_LIBS)
 HOSTCC       = gcc
 HOSTCXX      = g++
 KBUILD_HOSTCFLAGS   := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \
-		-fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS)
-KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS)
-KBUILD_HOSTLDFLAGS  := $(HOST_LFS_LDFLAGS)
-KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS)
+		-fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \
+		$(HOSTCFLAGS)
+KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
+KBUILD_HOSTLDFLAGS  := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)
+KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
 
 # Make variables (CC, etc...)
 AS		= $(CROSS_COMPILE)as
-- 
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCHv2 7/7] Kbuild: Use HOST*FLAGS options from the command line
  2018-07-10  0:46 ` [PATCHv2 7/7] Kbuild: Use HOST*FLAGS options from the command line Laura Abbott
@ 2018-07-12 10:11   ` Masahiro Yamada
  0 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2018-07-12 10:11 UTC (permalink / raw)
  To: Laura Abbott
  Cc: Josh Poimboeuf, Jiri Olsa, Linux Kbuild mailing list,
	Linux Kernel Mailing List, Robin Jarry, Jonathan Corbet,
	open list:DOCUMENTATION

2018-07-10 9:46 GMT+09:00 Laura Abbott <labbott@redhat.com>:
>
> Now that we have the rename in place, reuse the HOST*FLAGS options as
> something that can be set from the command line and included with the
> rest of the flags.
>
> Signed-off-by: Laura Abbott <labbott@redhat.com>
> ---
> v2: Use the correct name for HOSTLDLIBS, update documentation.
> ---
>  Documentation/kbuild/kbuild.txt | 16 ++++++++++++++++
>  Makefile                        |  9 +++++----
>  2 files changed, 21 insertions(+), 4 deletions(-)
>




> +HOSTLDFLAGS
> +--------------------------------------------------
> +Additional flags to be passed to $(HOSTLD) when building host programs.



Strictly speaking, $(CC) or $(CXX) is used
when linking host programs.


See this.
https://github.com/torvalds/linux/blob/v4.17/scripts/Makefile.host#L95
https://github.com/torvalds/linux/blob/v4.17/scripts/Makefile.host#L112


In fact, there is no definition of 'HOSTLD' in the top Makefile.


I will reword it to:


HOSTLDFLAGS
--------------------------------------------------
Additional flags to be passed when linking host programs.




I will also move this hunk up
after LDFLAGS_MODULE.





-- 
Best Regards
Masahiro Yamada
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCHv2 0/7] HOSTFLAGS and HOSTLDFLAGS from the environment
  2018-07-10  0:45 [PATCHv2 0/7] HOSTFLAGS and HOSTLDFLAGS from the environment Laura Abbott
  2018-07-10  0:46 ` [PATCHv2 7/7] Kbuild: Use HOST*FLAGS options from the command line Laura Abbott
@ 2018-07-12 10:13 ` Masahiro Yamada
  2018-07-12 17:08   ` Laura Abbott
  1 sibling, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2018-07-12 10:13 UTC (permalink / raw)
  To: Laura Abbott
  Cc: Josh Poimboeuf, Jiri Olsa, Linux Kbuild mailing list,
	Linux Kernel Mailing List, Robin Jarry, Jonathan Corbet,
	open list:DOCUMENTATION

2018-07-10 9:45 GMT+09:00 Laura Abbott <labbott@redhat.com>:
>
> Hi,
>
> This is v2 of the series to set HOSTCFLAGS and HOSTLDFLAGS from the
> environment. The changes are mostly minor fixups requested and also
> include documentation of the new options.



I checked this series.


I left minor comments for 3/7 and 7/7.

Unless you disagree,
I will fix them up locally
and queue it to my tree.

Thanks.




> Laura Abbott (7):
>   tools: build: Fixup host c flags
>   tools: build: Use HOSTLDFLAGS with fixdep
>   treewide: Rename HOSTCFLAGS -> KBUILD_HOSTCFLAGS
>   treewide: Rename HOSTCXXFLAGS to KBUILD_HOSTCXXFLAGS
>   treewide: Rename HOSTLDFLAGS to KBUILD_HOSTLDFLAGS
>   treewide: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS
>   Kbuild: Use HOST*FLAGS options from the command line
>
>  Documentation/kbuild/kbuild.txt | 16 ++++++++++++++++
>  Makefile                        | 17 +++++++++--------
>  arch/alpha/boot/Makefile        |  2 +-
>  net/bpfilter/Makefile           |  4 ++--
>  samples/bpf/Makefile            | 22 +++++++++++-----------
>  samples/seccomp/Makefile        |  6 +++---
>  scripts/Kbuild.include          |  2 +-
>  scripts/Makefile                |  4 ++--
>  scripts/Makefile.host           | 24 ++++++++++++------------
>  scripts/kconfig/Makefile        | 10 +++++-----
>  tools/build/Build.include       |  2 +-
>  tools/build/Makefile            |  2 +-
>  tools/objtool/Makefile          |  4 ++--
>  tools/perf/pmu-events/Build     |  2 +-
>  14 files changed, 67 insertions(+), 50 deletions(-)
>
> --
> 2.17.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Best Regards
Masahiro Yamada
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCHv2 0/7] HOSTFLAGS and HOSTLDFLAGS from the environment
  2018-07-12 10:13 ` [PATCHv2 0/7] HOSTFLAGS and HOSTLDFLAGS from the environment Masahiro Yamada
@ 2018-07-12 17:08   ` Laura Abbott
  2018-07-18  0:52     ` Masahiro Yamada
  0 siblings, 1 reply; 6+ messages in thread
From: Laura Abbott @ 2018-07-12 17:08 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Josh Poimboeuf, Jiri Olsa, Linux Kbuild mailing list,
	Linux Kernel Mailing List, Robin Jarry, Jonathan Corbet,
	open list:DOCUMENTATION

On 07/12/2018 03:13 AM, Masahiro Yamada wrote:
> 2018-07-10 9:45 GMT+09:00 Laura Abbott <labbott@redhat.com>:
>>
>> Hi,
>>
>> This is v2 of the series to set HOSTCFLAGS and HOSTLDFLAGS from the
>> environment. The changes are mostly minor fixups requested and also
>> include documentation of the new options.
> 
> 
> 
> I checked this series.
> 
> 
> I left minor comments for 3/7 and 7/7.
> 
> Unless you disagree,
> I will fix them up locally
> and queue it to my tree.
> 

The fixes look fine.

Thanks,
Laura


--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCHv2 0/7] HOSTFLAGS and HOSTLDFLAGS from the environment
  2018-07-12 17:08   ` Laura Abbott
@ 2018-07-18  0:52     ` Masahiro Yamada
  0 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2018-07-18  0:52 UTC (permalink / raw)
  To: Laura Abbott
  Cc: Josh Poimboeuf, Jiri Olsa, Linux Kbuild mailing list,
	Linux Kernel Mailing List, Robin Jarry, Jonathan Corbet,
	open list:DOCUMENTATION

2018-07-13 2:08 GMT+09:00 Laura Abbott <labbott@redhat.com>:
> On 07/12/2018 03:13 AM, Masahiro Yamada wrote:
>>
>> 2018-07-10 9:45 GMT+09:00 Laura Abbott <labbott@redhat.com>:
>>>
>>>
>>> Hi,
>>>
>>> This is v2 of the series to set HOSTCFLAGS and HOSTLDFLAGS from the
>>> environment. The changes are mostly minor fixups requested and also
>>> include documentation of the new options.
>>
>>
>>
>>
>> I checked this series.
>>
>>
>> I left minor comments for 3/7 and 7/7.
>>
>> Unless you disagree,
>> I will fix them up locally
>> and queue it to my tree.
>>
>
> The fixes look fine.
>


Applied to linux-kbuild. Thanks.


> Thanks,
> Laura
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Best Regards
Masahiro Yamada
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-07-18  0:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-10  0:45 [PATCHv2 0/7] HOSTFLAGS and HOSTLDFLAGS from the environment Laura Abbott
2018-07-10  0:46 ` [PATCHv2 7/7] Kbuild: Use HOST*FLAGS options from the command line Laura Abbott
2018-07-12 10:11   ` Masahiro Yamada
2018-07-12 10:13 ` [PATCHv2 0/7] HOSTFLAGS and HOSTLDFLAGS from the environment Masahiro Yamada
2018-07-12 17:08   ` Laura Abbott
2018-07-18  0:52     ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).