Merge tag 'kbuild-fixes-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild fixes from Masahiro Yamada: - Fix bugs in checkkconfigsymbols.py - Fix missing sys import in gen_compile_commands.py - Fix missing FORCE warning for ARCH=sh builds - Fix -Wignored-optimization-argument warnings for Clang builds - Turn -Wignored-optimization-argument into an error in order to stop building instead of sprinkling warnings * tag 'kbuild-fixes-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: Add -Werror=ignored-optimization-argument to CLANG_FLAGS x86/build: Do not add -falign flags unconditionally for clang kbuild: Fix comment typo in scripts/Makefile.modpost sh: Add missing FORCE prerequisites in Makefile gen_compile_commands: fix missing 'sys' package checkkconfigsymbols.py: Remove skipping of help lines in parse_kconfig_file checkkconfigsymbols.py: Forbid passing 'HEAD' to --commit
This commit is contained in:
@ -80,30 +80,30 @@ $(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE
|
|||||||
$(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE
|
$(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE
|
||||||
$(call if_changed,lzo)
|
$(call if_changed,lzo)
|
||||||
|
|
||||||
$(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2
|
$(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2 FORCE
|
||||||
$(call if_changed,uimage,bzip2)
|
$(call if_changed,uimage,bzip2)
|
||||||
|
|
||||||
$(obj)/uImage.gz: $(obj)/vmlinux.bin.gz
|
$(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE
|
||||||
$(call if_changed,uimage,gzip)
|
$(call if_changed,uimage,gzip)
|
||||||
|
|
||||||
$(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma
|
$(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma FORCE
|
||||||
$(call if_changed,uimage,lzma)
|
$(call if_changed,uimage,lzma)
|
||||||
|
|
||||||
$(obj)/uImage.xz: $(obj)/vmlinux.bin.xz
|
$(obj)/uImage.xz: $(obj)/vmlinux.bin.xz FORCE
|
||||||
$(call if_changed,uimage,xz)
|
$(call if_changed,uimage,xz)
|
||||||
|
|
||||||
$(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo
|
$(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo FORCE
|
||||||
$(call if_changed,uimage,lzo)
|
$(call if_changed,uimage,lzo)
|
||||||
|
|
||||||
$(obj)/uImage.bin: $(obj)/vmlinux.bin
|
$(obj)/uImage.bin: $(obj)/vmlinux.bin FORCE
|
||||||
$(call if_changed,uimage,none)
|
$(call if_changed,uimage,none)
|
||||||
|
|
||||||
OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
|
OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
|
||||||
$(obj)/vmlinux.srec: $(obj)/compressed/vmlinux
|
$(obj)/vmlinux.srec: $(obj)/compressed/vmlinux FORCE
|
||||||
$(call if_changed,objcopy)
|
$(call if_changed,objcopy)
|
||||||
|
|
||||||
OBJCOPYFLAGS_uImage.srec := -I binary -O srec
|
OBJCOPYFLAGS_uImage.srec := -I binary -O srec
|
||||||
$(obj)/uImage.srec: $(obj)/uImage
|
$(obj)/uImage.srec: $(obj)/uImage FORCE
|
||||||
$(call if_changed,objcopy)
|
$(call if_changed,objcopy)
|
||||||
|
|
||||||
$(obj)/uImage: $(obj)/uImage.$(suffix-y)
|
$(obj)/uImage: $(obj)/uImage.$(suffix-y)
|
||||||
|
@ -4,6 +4,12 @@
|
|||||||
|
|
||||||
tune = $(call cc-option,-mtune=$(1),$(2))
|
tune = $(call cc-option,-mtune=$(1),$(2))
|
||||||
|
|
||||||
|
ifdef CONFIG_CC_IS_CLANG
|
||||||
|
align := -falign-functions=0 $(call cc-option,-falign-jumps=0) $(call cc-option,-falign-loops=0)
|
||||||
|
else
|
||||||
|
align := -falign-functions=0 -falign-jumps=0 -falign-loops=0
|
||||||
|
endif
|
||||||
|
|
||||||
cflags-$(CONFIG_M486SX) += -march=i486
|
cflags-$(CONFIG_M486SX) += -march=i486
|
||||||
cflags-$(CONFIG_M486) += -march=i486
|
cflags-$(CONFIG_M486) += -march=i486
|
||||||
cflags-$(CONFIG_M586) += -march=i586
|
cflags-$(CONFIG_M586) += -march=i586
|
||||||
@ -19,11 +25,11 @@ cflags-$(CONFIG_MK6) += -march=k6
|
|||||||
# They make zero difference whatsosever to performance at this time.
|
# They make zero difference whatsosever to performance at this time.
|
||||||
cflags-$(CONFIG_MK7) += -march=athlon
|
cflags-$(CONFIG_MK7) += -march=athlon
|
||||||
cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,-march=athlon)
|
cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,-march=athlon)
|
||||||
cflags-$(CONFIG_MCRUSOE) += -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0
|
cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)
|
||||||
cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) -falign-functions=0 -falign-jumps=0 -falign-loops=0
|
cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) $(align)
|
||||||
cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586)
|
cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586)
|
||||||
cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=winchip2,-march=i586)
|
cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=winchip2,-march=i586)
|
||||||
cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) -falign-functions=0 -falign-jumps=0 -falign-loops=0
|
cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) $(align)
|
||||||
cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686)
|
cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686)
|
||||||
cflags-$(CONFIG_MVIAC7) += -march=i686
|
cflags-$(CONFIG_MVIAC7) += -march=i686
|
||||||
cflags-$(CONFIG_MCORE2) += -march=i686 $(call tune,core2)
|
cflags-$(CONFIG_MCORE2) += -march=i686 $(call tune,core2)
|
||||||
|
@ -29,7 +29,12 @@ CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
|
|||||||
else
|
else
|
||||||
CLANG_FLAGS += -fintegrated-as
|
CLANG_FLAGS += -fintegrated-as
|
||||||
endif
|
endif
|
||||||
|
# By default, clang only warns when it encounters an unknown warning flag or
|
||||||
|
# certain optimization flags it knows it has not implemented.
|
||||||
|
# Make it behave more like gcc by erroring when these flags are encountered
|
||||||
|
# so they can be implemented or wrapped in cc-option.
|
||||||
CLANG_FLAGS += -Werror=unknown-warning-option
|
CLANG_FLAGS += -Werror=unknown-warning-option
|
||||||
|
CLANG_FLAGS += -Werror=ignored-optimization-argument
|
||||||
KBUILD_CFLAGS += $(CLANG_FLAGS)
|
KBUILD_CFLAGS += $(CLANG_FLAGS)
|
||||||
KBUILD_AFLAGS += $(CLANG_FLAGS)
|
KBUILD_AFLAGS += $(CLANG_FLAGS)
|
||||||
export CLANG_FLAGS
|
export CLANG_FLAGS
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# Stage 2 is handled by this file and does the following
|
# Stage 2 is handled by this file and does the following
|
||||||
# 1) Find all modules listed in modules.order
|
# 1) Find all modules listed in modules.order
|
||||||
# 2) modpost is then used to
|
# 2) modpost is then used to
|
||||||
# 3) create one <module>.mod.c file pr. module
|
# 3) create one <module>.mod.c file per module
|
||||||
# 4) create one Module.symvers file with CRC for all exported symbols
|
# 4) create one Module.symvers file with CRC for all exported symbols
|
||||||
|
|
||||||
# Step 3 is used to place certain information in the module's ELF
|
# Step 3 is used to place certain information in the module's ELF
|
||||||
|
@ -34,7 +34,6 @@ REGEX_SOURCE_SYMBOL = re.compile(SOURCE_SYMBOL)
|
|||||||
REGEX_KCONFIG_DEF = re.compile(DEF)
|
REGEX_KCONFIG_DEF = re.compile(DEF)
|
||||||
REGEX_KCONFIG_EXPR = re.compile(EXPR)
|
REGEX_KCONFIG_EXPR = re.compile(EXPR)
|
||||||
REGEX_KCONFIG_STMT = re.compile(STMT)
|
REGEX_KCONFIG_STMT = re.compile(STMT)
|
||||||
REGEX_KCONFIG_HELP = re.compile(r"^\s+help\s*$")
|
|
||||||
REGEX_FILTER_SYMBOLS = re.compile(r"[A-Za-z0-9]$")
|
REGEX_FILTER_SYMBOLS = re.compile(r"[A-Za-z0-9]$")
|
||||||
REGEX_NUMERIC = re.compile(r"0[xX][0-9a-fA-F]+|[0-9]+")
|
REGEX_NUMERIC = re.compile(r"0[xX][0-9a-fA-F]+|[0-9]+")
|
||||||
REGEX_QUOTES = re.compile("(\"(.*?)\")")
|
REGEX_QUOTES = re.compile("(\"(.*?)\")")
|
||||||
@ -102,6 +101,9 @@ def parse_options():
|
|||||||
"continue.")
|
"continue.")
|
||||||
|
|
||||||
if args.commit:
|
if args.commit:
|
||||||
|
if args.commit.startswith('HEAD'):
|
||||||
|
sys.exit("The --commit option can't use the HEAD ref")
|
||||||
|
|
||||||
args.find = False
|
args.find = False
|
||||||
|
|
||||||
if args.ignore:
|
if args.ignore:
|
||||||
@ -432,7 +434,6 @@ def parse_kconfig_file(kfile):
|
|||||||
lines = []
|
lines = []
|
||||||
defined = []
|
defined = []
|
||||||
references = []
|
references = []
|
||||||
skip = False
|
|
||||||
|
|
||||||
if not os.path.exists(kfile):
|
if not os.path.exists(kfile):
|
||||||
return defined, references
|
return defined, references
|
||||||
@ -448,12 +449,6 @@ def parse_kconfig_file(kfile):
|
|||||||
if REGEX_KCONFIG_DEF.match(line):
|
if REGEX_KCONFIG_DEF.match(line):
|
||||||
symbol_def = REGEX_KCONFIG_DEF.findall(line)
|
symbol_def = REGEX_KCONFIG_DEF.findall(line)
|
||||||
defined.append(symbol_def[0])
|
defined.append(symbol_def[0])
|
||||||
skip = False
|
|
||||||
elif REGEX_KCONFIG_HELP.match(line):
|
|
||||||
skip = True
|
|
||||||
elif skip:
|
|
||||||
# ignore content of help messages
|
|
||||||
pass
|
|
||||||
elif REGEX_KCONFIG_STMT.match(line):
|
elif REGEX_KCONFIG_STMT.match(line):
|
||||||
line = REGEX_QUOTES.sub("", line)
|
line = REGEX_QUOTES.sub("", line)
|
||||||
symbols = get_symbols_in_line(line)
|
symbols = get_symbols_in_line(line)
|
||||||
|
@ -13,6 +13,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
_DEFAULT_OUTPUT = 'compile_commands.json'
|
_DEFAULT_OUTPUT = 'compile_commands.json'
|
||||||
_DEFAULT_LOG_LEVEL = 'WARNING'
|
_DEFAULT_LOG_LEVEL = 'WARNING'
|
||||||
|
Reference in New Issue
Block a user