Kbuild fixes for v4.18 (2nd)

- update Kbuild and Kconfig documents
 
  - sanitize -I compiler option handling
 
  - update extract-vmlinux script to recognize LZ4 and ZSTD
 
  - fix tools Makefiles
 
  - update tags.sh to handle __ro_after_init
 
  - suppress warnings in case getconf does not recognize LFS_* parameters
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJbSK5LAAoJED2LAQed4NsGOJQP/3bwaUKcOgWyBeYD1l/lcu5q
 spysRnxR7e+7Lp/HQV0v2XzOM9G0DWBA+j/dYUp8RcPsWOrXJkM8QkNk584YfxBY
 ve0q/6QlUGmjgiizdT86xYpKhCfdF2uSnx7QvM9qXyt+WlyVzmeK1QatwDmcMuPF
 ZLgi7P8XQ4uaUTIYss79SpDAMOCyCOHa2bapiiqJ2azR32L1AiwRF36u1bCVKMIC
 gfcPRN2XjOkJfp/l5JYzJbr28uE80n9d0b9ua+vO8aKs4RGBiLwM2ci+43EPH19i
 yNrgfBkjOO3HVCpS60STHARktNx+osSfMjTFP3xg+5vyIDwbqJl0+hgNEXRRUsCq
 nSA7uvRwppnvPLWuI3/iaE0BvN1rBqVssateylsuOIfrcgFb71WAHCGWX+9t1QT5
 4V3kkH+QgqEEFQg7BUrXI9ccTpT28vDBKjRD4O8O/SLtWo0GprXvuje6ZxZpa/ob
 8V2MVcdPuLamZkSCy2I6pIIfNZ0wifI6/WX1HQ0A0VzOw5dJWH4qO/DMy7l8vw3m
 fP84E79011PZ8BByrEE1EZ0cWeMGInoyC3Q5BmB0b4R2uxSC2vEhCct4MJpOxVYQ
 gUBgiti33mkvHmpZKGTgt89+71X3u26HYOjgTO2vnffSYpKGdYkDAhMyxxw9EqqJ
 AcBKpL1fxz2Ik7DgW75J
 =aXcg
 -----END PGP SIGNATURE-----

Merge tag 'kbuild-fixes-v4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - update Kbuild and Kconfig documents

 - sanitize -I compiler option handling

 - update extract-vmlinux script to recognize LZ4 and ZSTD

 - fix tools Makefiles

 - update tags.sh to handle __ro_after_init

 - suppress warnings in case getconf does not recognize LFS_* parameters

* tag 'kbuild-fixes-v4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kbuild: suppress warnings from 'getconf LFS_*'
  scripts/tags.sh: add __ro_after_init
  tools: build: Use HOSTLDFLAGS with fixdep
  tools: build: Fixup host c flags
  tools build: fix # escaping in .cmd files for future Make
  scripts: teach extract-vmlinux about LZ4 and ZSTD
  kbuild: remove duplicated comments about PHONY
  kbuild: .PHONY is not a variable, but PHONY is
  kbuild: do not drop -I without parameter
  kbuild: document the KBUILD_KCONFIG env. variable
  kconfig: update user kconfig tools doc.
  kbuild: delete INSTALL_FW_PATH from kbuild documentation
  kbuild: update ARCH alias info for sparc
  kbuild: update ARCH alias info for sh
This commit is contained in:
Linus Torvalds 2018-07-13 12:15:12 -07:00
commit 79facf308f
15 changed files with 63 additions and 50 deletions

View File

@ -50,6 +50,11 @@ LDFLAGS_MODULE
-------------------------------------------------- --------------------------------------------------
Additional options used for $(LD) when linking modules. Additional options used for $(LD) when linking modules.
KBUILD_KCONFIG
--------------------------------------------------
Set the top-level Kconfig file to the value of this environment
variable. The default name is "Kconfig".
KBUILD_VERBOSE KBUILD_VERBOSE
-------------------------------------------------- --------------------------------------------------
Set the kbuild verbosity. Can be assigned same values as "V=...". Set the kbuild verbosity. Can be assigned same values as "V=...".
@ -88,7 +93,8 @@ In most cases the name of the architecture is the same as the
directory name found in the arch/ directory. directory name found in the arch/ directory.
But some architectures such as x86 and sparc have aliases. But some architectures such as x86 and sparc have aliases.
x86: i386 for 32 bit, x86_64 for 64 bit x86: i386 for 32 bit, x86_64 for 64 bit
sparc: sparc for 32 bit, sparc64 for 64 bit sh: sh for 32 bit, sh64 for 64 bit
sparc: sparc32 for 32 bit, sparc64 for 64 bit
CROSS_COMPILE CROSS_COMPILE
-------------------------------------------------- --------------------------------------------------
@ -148,15 +154,6 @@ stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
the default option --strip-debug will be used. Otherwise, the default option --strip-debug will be used. Otherwise,
INSTALL_MOD_STRIP value will be used as the options to the strip command. INSTALL_MOD_STRIP value will be used as the options to the strip command.
INSTALL_FW_PATH
--------------------------------------------------
INSTALL_FW_PATH specifies where to install the firmware blobs.
The default value is:
$(INSTALL_MOD_PATH)/lib/firmware
The value can be overridden in which case the default value is ignored.
INSTALL_HDR_PATH INSTALL_HDR_PATH
-------------------------------------------------- --------------------------------------------------
INSTALL_HDR_PATH specifies where to install user space headers when INSTALL_HDR_PATH specifies where to install user space headers when

View File

@ -2,9 +2,9 @@ This file contains some assistance for using "make *config".
Use "make help" to list all of the possible configuration targets. Use "make help" to list all of the possible configuration targets.
The xconfig ('qconf') and menuconfig ('mconf') programs also The xconfig ('qconf'), menuconfig ('mconf'), and nconfig ('nconf')
have embedded help text. Be sure to check it for navigation, programs also have embedded help text. Be sure to check that for
search, and other general help text. navigation, search, and other general help text.
====================================================================== ======================================================================
General General
@ -17,13 +17,16 @@ this happens, using a previously working .config file and running
for you, so you may find that you need to see what NEW kernel for you, so you may find that you need to see what NEW kernel
symbols have been introduced. symbols have been introduced.
To see a list of new config symbols when using "make oldconfig", use To see a list of new config symbols, use
cp user/some/old.config .config cp user/some/old.config .config
make listnewconfig make listnewconfig
and the config program will list any new symbols, one per line. and the config program will list any new symbols, one per line.
Alternatively, you can use the brute force method:
make oldconfig
scripts/diffconfig .config.old .config | less scripts/diffconfig .config.old .config | less
______________________________________________________________________ ______________________________________________________________________
@ -160,7 +163,7 @@ Searching in menuconfig:
This lists all config symbols that contain "hotplug", This lists all config symbols that contain "hotplug",
e.g., HOTPLUG_CPU, MEMORY_HOTPLUG. e.g., HOTPLUG_CPU, MEMORY_HOTPLUG.
For search help, enter / followed TAB-TAB-TAB (to highlight For search help, enter / followed by TAB-TAB (to highlight
<Help>) and Enter. This will tell you that you can also use <Help>) and Enter. This will tell you that you can also use
regular expressions (regexes) in the search string, so if you regular expressions (regexes) in the search string, so if you
are not interested in MEMORY_HOTPLUG, you could try are not interested in MEMORY_HOTPLUG, you could try
@ -202,6 +205,39 @@ Example:
make MENUCONFIG_MODE=single_menu menuconfig make MENUCONFIG_MODE=single_menu menuconfig
======================================================================
nconfig
--------------------------------------------------
nconfig is an alternate text-based configurator. It lists function
keys across the bottom of the terminal (window) that execute commands.
You can also just use the corresponding numeric key to execute the
commands unless you are in a data entry window. E.g., instead of F6
for Save, you can just press 6.
Use F1 for Global help or F3 for the Short help menu.
Searching in nconfig:
You can search either in the menu entry "prompt" strings
or in the configuration symbols.
Use / to begin a search through the menu entries. This does
not support regular expressions. Use <Down> or <Up> for
Next hit and Previous hit, respectively. Use <Esc> to
terminate the search mode.
F8 (SymSearch) searches the configuration symbols for the
given string or regular expression (regex).
NCONFIG_MODE
--------------------------------------------------
This mode shows all sub-menus in one large tree.
Example:
make NCONFIG_MODE=single_menu nconfig
====================================================================== ======================================================================
xconfig xconfig
-------------------------------------------------- --------------------------------------------------
@ -230,8 +266,7 @@ gconfig
Searching in gconfig: Searching in gconfig:
None (gconfig isn't maintained as well as xconfig or menuconfig); There is no search command in gconfig. However, gconfig does
however, gconfig does have a few more viewing choices than have several different viewing choices, modes, and options.
xconfig does.
### ###

View File

@ -353,9 +353,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \ else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi ; fi) else echo sh; fi ; fi)
HOST_LFS_CFLAGS := $(shell getconf LFS_CFLAGS) HOST_LFS_CFLAGS := $(shell getconf LFS_CFLAGS 2>/dev/null)
HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS) HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS 2>/dev/null)
HOST_LFS_LIBS := $(shell getconf LFS_LIBS) HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null)
HOSTCC = gcc HOSTCC = gcc
HOSTCXX = g++ HOSTCXX = g++
@ -1712,6 +1712,6 @@ endif # skip-makefile
PHONY += FORCE PHONY += FORCE
FORCE: FORCE:
# Declare the contents of the .PHONY variable as phony. We keep that # Declare the contents of the PHONY variable as phony. We keep that
# information in a variable so we can use it in if_changed and friends. # information in a variable so we can use it in if_changed and friends.
.PHONY: $(PHONY) .PHONY: $(PHONY)

View File

@ -214,7 +214,7 @@ hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj
# Prefix -I with $(srctree) if it is not an absolute path. # Prefix -I with $(srctree) if it is not an absolute path.
# skip if -I has no parameter # skip if -I has no parameter
addtree = $(if $(patsubst -I%,%,$(1)), \ addtree = $(if $(patsubst -I%,%,$(1)), \
$(if $(filter-out -I/% -I./% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1))) $(if $(filter-out -I/% -I./% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1)),$(1))
# Find all -I options and call addtree # Find all -I options and call addtree
flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))

View File

@ -590,7 +590,4 @@ endif
# We never want them to be removed automatically. # We never want them to be removed automatically.
.SECONDARY: $(targets) .SECONDARY: $(targets)
# Declare the contents of the .PHONY variable as phony. We keep that
# information in a variable se we can use it in if_changed and friends.
.PHONY: $(PHONY) .PHONY: $(PHONY)

View File

@ -88,7 +88,4 @@ PHONY += $(subdir-ymn)
$(subdir-ymn): $(subdir-ymn):
$(Q)$(MAKE) $(clean)=$@ $(Q)$(MAKE) $(clean)=$@
# Declare the contents of the .PHONY variable as phony. We keep that
# information in a variable se we can use it in if_changed and friends.
.PHONY: $(PHONY) .PHONY: $(PHONY)

View File

@ -54,8 +54,4 @@ PHONY += $(subdir-ym)
$(subdir-ym): $(subdir-ym):
$(Q)$(MAKE) $(modbuiltin)=$@ $(Q)$(MAKE) $(modbuiltin)=$@
# Declare the contents of the .PHONY variable as phony. We keep that
# information in a variable se we can use it in if_changed and friends.
.PHONY: $(PHONY) .PHONY: $(PHONY)

View File

@ -35,8 +35,4 @@ modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))
$(modules): $(modules):
$(call cmd,modules_install,$(MODLIB)/$(modinst_dir)) $(call cmd,modules_install,$(MODLIB)/$(modinst_dir))
# Declare the contents of the .PHONY variable as phony. We keep that
# information in a variable so we can use it in if_changed and friends.
.PHONY: $(PHONY) .PHONY: $(PHONY)

View File

@ -149,8 +149,4 @@ ifneq ($(cmd_files),)
include $(cmd_files) include $(cmd_files)
endif endif
# Declare the contents of the .PHONY variable as phony. We keep that
# information in a variable se we can use it in if_changed and friends.
.PHONY: $(PHONY) .PHONY: $(PHONY)

View File

@ -27,7 +27,4 @@ modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))
$(modules): $(modules):
$(call cmd,sign_ko,$(MODLIB)/$(modinst_dir)) $(call cmd,sign_ko,$(MODLIB)/$(modinst_dir))
# Declare the contents of the .PHONY variable as phony. We keep that
# information in a variable se we can use it in if_changed and friends.
.PHONY: $(PHONY) .PHONY: $(PHONY)

View File

@ -57,6 +57,8 @@ try_decompress '\3757zXZ\000' abcde unxz
try_decompress 'BZh' xy bunzip2 try_decompress 'BZh' xy bunzip2
try_decompress '\135\0\0\0' xxx unlzma try_decompress '\135\0\0\0' xxx unlzma
try_decompress '\211\114\132' xy 'lzop -d' try_decompress '\211\114\132' xy 'lzop -d'
try_decompress '\002!L\030' xxx 'lz4 -d'
try_decompress '(\265/\375' xxx unzstd
# Bail out: # Bail out:
echo "$me: Cannot find vmlinux." >&2 echo "$me: Cannot find vmlinux." >&2

View File

@ -245,7 +245,7 @@ exuberant()
{ {
setup_regex exuberant asm c setup_regex exuberant asm c
all_target_sources | xargs $1 -a \ all_target_sources | xargs $1 -a \
-I __initdata,__exitdata,__initconst, \ -I __initdata,__exitdata,__initconst,__ro_after_init \
-I __initdata_memblock \ -I __initdata_memblock \
-I __refdata,__attribute,__maybe_unused,__always_unused \ -I __refdata,__attribute,__maybe_unused,__always_unused \
-I __acquires,__releases,__deprecated \ -I __acquires,__releases,__deprecated \

View File

@ -63,8 +63,8 @@ dep-cmd = $(if $(wildcard $(fixdep)),
$(fixdep) $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp; \ $(fixdep) $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp; \
rm -f $(depfile); \ rm -f $(depfile); \
mv -f $(dot-target).tmp $(dot-target).cmd, \ mv -f $(dot-target).tmp $(dot-target).cmd, \
printf '\# cannot find fixdep (%s)\n' $(fixdep) > $(dot-target).cmd; \ printf '$(pound) cannot find fixdep (%s)\n' $(fixdep) > $(dot-target).cmd; \
printf '\# using basic dep data\n\n' >> $(dot-target).cmd; \ printf '$(pound) using basic dep data\n\n' >> $(dot-target).cmd; \
cat $(depfile) >> $(dot-target).cmd; \ cat $(depfile) >> $(dot-target).cmd; \
printf '\n%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd) printf '\n%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd)
@ -98,4 +98,4 @@ cxx_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXX
### ###
## HOSTCC C flags ## HOSTCC C flags
host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj)) host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(HOSTCFLAGS) -D"BUILD_STR(s)=\#s" $(HOSTCFLAGS_$(basetarget).o) $(HOSTCFLAGS_$(obj))

View File

@ -43,7 +43,7 @@ $(OUTPUT)fixdep-in.o: FORCE
$(Q)$(MAKE) $(build)=fixdep $(Q)$(MAKE) $(build)=fixdep
$(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o $(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o
$(QUIET_LINK)$(HOSTCC) $(LDFLAGS) -o $@ $< $(QUIET_LINK)$(HOSTCC) $(HOSTLDFLAGS) -o $@ $<
FORCE: FORCE:

View File

@ -1,7 +1,7 @@
hostprogs := jevents hostprogs := jevents
jevents-y += json.o jsmn.o jevents.o jevents-y += json.o jsmn.o jevents.o
CHOSTFLAGS_jevents.o = -I$(srctree)/tools/include HOSTCFLAGS_jevents.o = -I$(srctree)/tools/include
pmu-events-y += pmu-events.o pmu-events-y += pmu-events.o
JDIR = pmu-events/arch/$(SRCARCH) JDIR = pmu-events/arch/$(SRCARCH)
JSON = $(shell [ -d $(JDIR) ] && \ JSON = $(shell [ -d $(JDIR) ] && \