Skip to content

Commit f92d19e

Browse files
labbottmasahir0y
authored andcommitted
kbuild: Use HOST*FLAGS options from the command line
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> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent 8377bd2 commit f92d19e

2 files changed

Lines changed: 21 additions & 4 deletions

File tree

‎Documentation/kbuild/kbuild.txt‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,22 @@ LDFLAGS_MODULE
5050
--------------------------------------------------
5151
Additional options used for $(LD) when linking modules.
5252

53+
HOSTCFLAGS
54+
--------------------------------------------------
55+
Additional flags to be passed to $(HOSTCC) when building host programs.
56+
57+
HOSTCXXFLAGS
58+
--------------------------------------------------
59+
Additional flags to be passed to $(HOSTCXX) when building host programs.
60+
61+
HOSTLDFLAGS
62+
--------------------------------------------------
63+
Additional flags to be passed when linking host programs.
64+
65+
HOSTLDLIBS
66+
--------------------------------------------------
67+
Additional libraries to link against when building host programs.
68+
5369
KBUILD_KCONFIG
5470
--------------------------------------------------
5571
Set the top-level Kconfig file to the value of this environment

‎Makefile‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,11 @@ HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null)
360360
HOSTCC = gcc
361361
HOSTCXX = g++
362362
KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \
363-
-fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS)
364-
KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS)
365-
KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS)
366-
KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS)
363+
-fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \
364+
$(HOSTCFLAGS)
365+
KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
366+
KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)
367+
KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
367368

368369
# Make variables (CC, etc...)
369370
AS = $(CROSS_COMPILE)as

0 commit comments

Comments
 (0)