Kbuild updates for v4.20 (2nd)

- clean-up leftovers in Kconfig files
 
 - remove stale oldnoconfig and silentoldconfig targets
 
 - remove unneeded cc-fullversion and cc-name variables
 
 - improve merge_config script to allow overriding option prefix
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJb3VOnAAoJED2LAQed4NsGivsP/1AJVqIrfPFP0ESn0o9RCA8a
 8tBVsdc/c9lE7XX48NSVYt0hmRIfh003t0B5R9jM2MAKaa2rsz6gGwyZZ68oV/aI
 jr56STToJ3WLbNQ8zIc3hkZdM+45FbDNEnwZLNpKaHZtufGZtHYXIAhWYAOU8xWJ
 qon8H5aeTbA1n02WDUYg4C/PO3KzMngv7E3RcuokZUzUOqwwCdSrDmfVY3pGR07G
 hX0UU8DxV0iZFwuy0B0mVWP0CUsLlaAVvU8Rj9aQrbmWTTt5TW03ZQW/3NCME1EJ
 0mJw70nDO5n5nVKEc2O9OBD1kMhchagTIJT9dtPzt4CWDB54ptvPta/2Y5w6n8Qu
 oqMaM99hxjD0ogSWV3uG2YnmAiQoN600EvAmbzzf7U4WbybmrUJJCpbOvmBa7aCl
 10Mz45xTQYOMLnfMJB8czOuW5YxnCcTe+3K+bk4nPsWB3rGQbQmdZqkhG3sp/MuB
 dANaj2QqkcF5HZpKMDIqrx9GyGNOkD/E48eRyfyjUtIx0O9WH5wMNuvJbomUmH2S
 m1oEsFOxw0KM+06pH933fNxziUxUHcded2fC3Caz17yLuTuPnRBoh2dME8w3Csub
 X6MHaG4Q+1hOfHrvk8zo/06gYgOZacl4MeF0Gq0VzZHu9FZELZ29ff/MsLT98ynN
 3MvlO1dI3Ht4uJes6kFO
 =pZIk
 -----END PGP SIGNATURE-----

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

Pull Kbuild updates from Masahiro Yamada:

 - clean-up leftovers in Kconfig files

 - remove stale oldnoconfig and silentoldconfig targets

 - remove unneeded cc-fullversion and cc-name variables

 - improve merge_config script to allow overriding option prefix

* tag 'kbuild-v4.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kbuild: remove cc-name variable
  kbuild: replace cc-name test with CONFIG_CC_IS_CLANG
  merge_config.sh: Allow to define config prefix
  kbuild: remove unused cc-fullversion variable
  kconfig: remove silentoldconfig target
  kconfig: remove oldnoconfig target
  powerpc: PCI_MSI needs PCI
  powerpc: remove CONFIG_MCA leftovers
  powerpc: remove CONFIG_PCI_QSPAN
  scsi: aha152x: rename the PCMCIA define
This commit is contained in:
Linus Torvalds 2018-11-03 10:47:33 -07:00
commit 9a12efc5e0
17 changed files with 28 additions and 78 deletions

View File

@ -537,21 +537,6 @@ more details, with real examples.
The third parameter may be a text as in this example, but it may also The third parameter may be a text as in this example, but it may also
be an expanded variable or a macro. be an expanded variable or a macro.
cc-fullversion
cc-fullversion is useful when the exact version of gcc is needed.
One typical use-case is when a specific GCC version is broken.
cc-fullversion points out a more specific version than cc-version does.
Example:
#arch/powerpc/Makefile
$(Q)if test "$(cc-fullversion)" = "040200" ; then \
echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
false ; \
fi
In this example for a specific GCC version the build will error out
explaining to the user why it stops.
cc-cross-prefix cc-cross-prefix
cc-cross-prefix is used to check if there exists a $(CC) in path with cc-cross-prefix is used to check if there exists a $(CC) in path with
one of the listed prefixes. The first prefix where there exist a one of the listed prefixes. The first prefix where there exist a

View File

@ -20,7 +20,7 @@ Enabling the driver
The driver is enabled via the standard kernel configuration system, The driver is enabled via the standard kernel configuration system,
using the make command:: using the make command::
make oldconfig/silentoldconfig/menuconfig/etc. make oldconfig/menuconfig/etc.
The driver is located in the menu structure at: The driver is located in the menu structure at:

View File

@ -485,7 +485,7 @@ ifneq ($(KBUILD_SRC),)
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree) $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
endif endif
ifeq ($(cc-name),clang) ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
ifneq ($(CROSS_COMPILE),) ifneq ($(CROSS_COMPILE),)
CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%)) CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD))) GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))
@ -702,7 +702,7 @@ stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG) := -fstack-protector-strong
KBUILD_CFLAGS += $(stackp-flags-y) KBUILD_CFLAGS += $(stackp-flags-y)
ifeq ($(cc-name),clang) ifdef CONFIG_CC_IS_CLANG
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
KBUILD_CFLAGS += $(call cc-disable-warning, gnu) KBUILD_CFLAGS += $(call cc-disable-warning, gnu)

View File

@ -128,7 +128,7 @@ cflags-y += -ffreestanding
# clang's output will be based upon the build machine. So for clang we simply # clang's output will be based upon the build machine. So for clang we simply
# unconditionally specify -EB or -EL as appropriate. # unconditionally specify -EB or -EL as appropriate.
# #
ifeq ($(cc-name),clang) ifdef CONFIG_CC_IS_CLANG
cflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB cflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB
cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -EL cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -EL
else else

View File

@ -10,7 +10,7 @@ ccflags-vdso := \
$(filter -march=%,$(KBUILD_CFLAGS)) \ $(filter -march=%,$(KBUILD_CFLAGS)) \
-D__VDSO__ -D__VDSO__
ifeq ($(cc-name),clang) ifdef CONFIG_CC_IS_CLANG
ccflags-vdso += $(filter --target=%,$(KBUILD_CFLAGS)) ccflags-vdso += $(filter --target=%,$(KBUILD_CFLAGS))
endif endif

View File

@ -930,10 +930,6 @@ config FSL_GTM
help help
Freescale General-purpose Timers support Freescale General-purpose Timers support
# Yes MCA RS/6000s exist but Linux-PPC does not currently support any
config MCA
bool
# Platforms that what PCI turned unconditionally just do select PCI # Platforms that what PCI turned unconditionally just do select PCI
# in their config node. Platforms that want to choose at config # in their config node. Platforms that want to choose at config
# time should select PPC_PCI_CHOICE # time should select PPC_PCI_CHOICE
@ -944,7 +940,6 @@ config PCI
bool "PCI support" if PPC_PCI_CHOICE bool "PCI support" if PPC_PCI_CHOICE
default y if !40x && !CPM2 && !PPC_8xx && !PPC_83xx \ default y if !40x && !CPM2 && !PPC_8xx && !PPC_83xx \
&& !PPC_85xx && !PPC_86xx && !GAMECUBE_COMMON && !PPC_85xx && !PPC_86xx && !GAMECUBE_COMMON
default PCI_QSPAN if PPC_8xx
select GENERIC_PCI_IOMAP select GENERIC_PCI_IOMAP
help help
Find out whether your system includes a PCI bus. PCI is the name of Find out whether your system includes a PCI bus. PCI is the name of
@ -958,14 +953,6 @@ config PCI_DOMAINS
config PCI_SYSCALL config PCI_SYSCALL
def_bool PCI def_bool PCI
config PCI_QSPAN
bool "QSpan PCI"
depends on PPC_8xx
select PPC_I8259
help
Say Y here if you have a system based on a Motorola 8xx-series
embedded processor with a QSPAN PCI interface, otherwise say N.
config PCI_8260 config PCI_8260
bool bool
depends on PCI && 8260 depends on PCI && 8260

View File

@ -96,7 +96,7 @@ aflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1)
aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mabi=elfv2 aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mabi=elfv2
endif endif
ifneq ($(cc-name),clang) ifndef CONFIG_CC_IS_CLANG
cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mno-strict-align cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mno-strict-align
endif endif
@ -175,7 +175,7 @@ endif
# Work around gcc code-gen bugs with -pg / -fno-omit-frame-pointer in gcc <= 4.8 # Work around gcc code-gen bugs with -pg / -fno-omit-frame-pointer in gcc <= 4.8
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44199 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44199
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52828 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52828
ifneq ($(cc-name),clang) ifndef CONFIG_CC_IS_CLANG
CC_FLAGS_FTRACE += $(call cc-ifversion, -lt, 0409, -mno-sched-epilog) CC_FLAGS_FTRACE += $(call cc-ifversion, -lt, 0409, -mno-sched-epilog)
endif endif
endif endif

View File

@ -29,6 +29,7 @@ config KILAUEA
select 405EX select 405EX
select PPC40x_SIMPLE select PPC40x_SIMPLE
select PPC4xx_PCI_EXPRESS select PPC4xx_PCI_EXPRESS
select PCI
select PCI_MSI select PCI_MSI
select PPC4xx_MSI select PPC4xx_MSI
help help

View File

@ -21,6 +21,7 @@ config BLUESTONE
depends on 44x depends on 44x
select PPC44x_SIMPLE select PPC44x_SIMPLE
select APM821xx select APM821xx
select PCI
select PCI_MSI select PCI_MSI
select PPC4xx_MSI select PPC4xx_MSI
select PPC4xx_PCI_EXPRESS select PPC4xx_PCI_EXPRESS
@ -200,6 +201,7 @@ config AKEBONO
select SWIOTLB select SWIOTLB
select 476FPE select 476FPE
select PPC4xx_PCI_EXPRESS select PPC4xx_PCI_EXPRESS
select PCI
select PCI_MSI select PCI_MSI
select PPC4xx_HSTA_MSI select PPC4xx_HSTA_MSI
select I2C select I2C

View File

@ -538,7 +538,7 @@ config SCSI_HPTIOP
config SCSI_BUSLOGIC config SCSI_BUSLOGIC
tristate "BusLogic SCSI support" tristate "BusLogic SCSI support"
depends on (PCI || ISA || MCA) && SCSI && ISA_DMA_API && VIRT_TO_BUS depends on (PCI || ISA) && SCSI && ISA_DMA_API && VIRT_TO_BUS
---help--- ---help---
This is support for BusLogic MultiMaster and FlashPoint SCSI Host This is support for BusLogic MultiMaster and FlashPoint SCSI Host
Adapters. Consult the SCSI-HOWTO, available from Adapters. Consult the SCSI-HOWTO, available from
@ -1175,12 +1175,12 @@ config SCSI_LPFC_DEBUG_FS
config SCSI_SIM710 config SCSI_SIM710
tristate "Simple 53c710 SCSI support (Compaq, NCR machines)" tristate "Simple 53c710 SCSI support (Compaq, NCR machines)"
depends on (EISA || MCA) && SCSI depends on EISA && SCSI
select SCSI_SPI_ATTRS select SCSI_SPI_ATTRS
---help--- ---help---
This driver is for NCR53c710 based SCSI host adapters. This driver is for NCR53c710 based SCSI host adapters.
It currently supports Compaq EISA cards and NCR MCA cards It currently supports Compaq EISA cards.
config SCSI_DC395x config SCSI_DC395x
tristate "Tekram DC395(U/UW/F) and DC315(U) SCSI support" tristate "Tekram DC395(U/UW/F) and DC315(U) SCSI support"

View File

@ -269,7 +269,7 @@ static LIST_HEAD(aha152x_host_list);
/* DEFINES */ /* DEFINES */
/* For PCMCIA cards, always use AUTOCONF */ /* For PCMCIA cards, always use AUTOCONF */
#if defined(PCMCIA) || defined(MODULE) #if defined(AHA152X_PCMCIA) || defined(MODULE)
#if !defined(AUTOCONF) #if !defined(AUTOCONF)
#define AUTOCONF #define AUTOCONF
#endif #endif
@ -297,7 +297,7 @@ CMD_INC_RESID(struct scsi_cmnd *cmd, int inc)
#define DELAY_DEFAULT 1000 #define DELAY_DEFAULT 1000
#if defined(PCMCIA) #if defined(AHA152X_PCMCIA)
#define IRQ_MIN 0 #define IRQ_MIN 0
#define IRQ_MAX 16 #define IRQ_MAX 16
#else #else
@ -328,7 +328,7 @@ MODULE_AUTHOR("Jürgen Fischer");
MODULE_DESCRIPTION(AHA152X_REVID); MODULE_DESCRIPTION(AHA152X_REVID);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
#if !defined(PCMCIA) #if !defined(AHA152X_PCMCIA)
#if defined(MODULE) #if defined(MODULE)
static int io[] = {0, 0}; static int io[] = {0, 0};
module_param_hw_array(io, int, ioport, NULL, 0); module_param_hw_array(io, int, ioport, NULL, 0);
@ -391,7 +391,7 @@ static struct isapnp_device_id id_table[] = {
MODULE_DEVICE_TABLE(isapnp, id_table); MODULE_DEVICE_TABLE(isapnp, id_table);
#endif /* ISAPNP */ #endif /* ISAPNP */
#endif /* !PCMCIA */ #endif /* !AHA152X_PCMCIA */
static struct scsi_host_template aha152x_driver_template; static struct scsi_host_template aha152x_driver_template;
@ -863,7 +863,7 @@ void aha152x_release(struct Scsi_Host *shpnt)
if (shpnt->irq) if (shpnt->irq)
free_irq(shpnt->irq, shpnt); free_irq(shpnt->irq, shpnt);
#if !defined(PCMCIA) #if !defined(AHA152X_PCMCIA)
if (shpnt->io_port) if (shpnt->io_port)
release_region(shpnt->io_port, IO_RANGE); release_region(shpnt->io_port, IO_RANGE);
#endif #endif
@ -2924,7 +2924,7 @@ static struct scsi_host_template aha152x_driver_template = {
.slave_alloc = aha152x_adjust_queue, .slave_alloc = aha152x_adjust_queue,
}; };
#if !defined(PCMCIA) #if !defined(AHA152X_PCMCIA)
static int setup_count; static int setup_count;
static struct aha152x_setup setup[2]; static struct aha152x_setup setup[2];
@ -3392,4 +3392,4 @@ static int __init aha152x_setup(char *str)
__setup("aha152x=", aha152x_setup); __setup("aha152x=", aha152x_setup);
#endif #endif
#endif /* !PCMCIA */ #endif /* !AHA152X_PCMCIA */

View File

@ -1,3 +1,3 @@
#define PCMCIA 1 #define AHA152X_PCMCIA 1
#define AHA152X_STAT 1 #define AHA152X_STAT 1
#include "aha152x.c" #include "aha152x.c"

View File

@ -140,17 +140,9 @@ cc-option-yn = $(call try-run,\
cc-disable-warning = $(call try-run,\ cc-disable-warning = $(call try-run,\
$(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
# cc-name
# Expands to either gcc or clang
cc-name = $(shell $(CC) -v 2>&1 | grep -q "clang version" && echo clang || echo gcc)
# cc-version # cc-version
cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
# cc-fullversion
cc-fullversion = $(shell $(CONFIG_SHELL) \
$(srctree)/scripts/gcc-version.sh -p $(CC))
# cc-ifversion # cc-ifversion
# Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
cc-ifversion = $(shell [ $(cc-version) $(1) $(2) ] && echo $(3) || echo $(4)) cc-ifversion = $(shell [ $(cc-version) $(1) $(2) ] && echo $(3) || echo $(4))

View File

@ -65,7 +65,7 @@ endif
KBUILD_CFLAGS += $(warning) KBUILD_CFLAGS += $(warning)
else else
ifeq ($(cc-name),clang) ifdef CONFIG_CC_IS_CLANG
KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides) KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-value) KBUILD_CFLAGS += $(call cc-disable-warning, unused-value)
KBUILD_CFLAGS += $(call cc-disable-warning, format) KBUILD_CFLAGS += $(call cc-disable-warning, format)

View File

@ -68,21 +68,7 @@ PHONY += $(simple-targets)
$(simple-targets): $(obj)/conf $(simple-targets): $(obj)/conf
$< $(silent) --$@ $(Kconfig) $< $(silent) --$@ $(Kconfig)
PHONY += oldnoconfig silentoldconfig savedefconfig defconfig PHONY += savedefconfig defconfig
# oldnoconfig is an alias of olddefconfig, because people already are dependent
# on its behavior (sets new symbols to their default value but not 'n') with the
# counter-intuitive name.
oldnoconfig: olddefconfig
@echo " WARNING: \"oldnoconfig\" target will be removed after Linux 4.19"
@echo " Please use \"olddefconfig\" instead, which is an alias."
# We do not expect manual invokcation of "silentoldcofig" (or "syncconfig").
silentoldconfig: syncconfig
@echo " WARNING: \"silentoldconfig\" has been renamed to \"syncconfig\""
@echo " and is now an internal implementation detail."
@echo " What you want is probably \"oldconfig\"."
@echo " \"silentoldconfig\" will be removed after Linux 4.19"
savedefconfig: $(obj)/conf savedefconfig: $(obj)/conf
$< $(silent) --$@=defconfig $(Kconfig) $< $(silent) --$@=defconfig $(Kconfig)

View File

@ -460,12 +460,6 @@ static struct option long_opts[] = {
{"randconfig", no_argument, NULL, randconfig}, {"randconfig", no_argument, NULL, randconfig},
{"listnewconfig", no_argument, NULL, listnewconfig}, {"listnewconfig", no_argument, NULL, listnewconfig},
{"olddefconfig", no_argument, NULL, olddefconfig}, {"olddefconfig", no_argument, NULL, olddefconfig},
/*
* oldnoconfig is an alias of olddefconfig, because people already
* are dependent on its behavior(sets new symbols to their default
* value but not 'n') with the counter-intuitive name.
*/
{"oldnoconfig", no_argument, NULL, olddefconfig},
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
@ -480,7 +474,6 @@ static void conf_usage(const char *progname)
printf(" --syncconfig Similar to oldconfig but generates configuration in\n" printf(" --syncconfig Similar to oldconfig but generates configuration in\n"
" include/{generated/,config/}\n"); " include/{generated/,config/}\n");
printf(" --olddefconfig Same as oldconfig but sets new symbols to their default value\n"); printf(" --olddefconfig Same as oldconfig but sets new symbols to their default value\n");
printf(" --oldnoconfig An alias of olddefconfig\n");
printf(" --defconfig <file> New config with default defined in <file>\n"); printf(" --defconfig <file> New config with default defined in <file>\n");
printf(" --savedefconfig <file> Save the minimal current configuration to <file>\n"); printf(" --savedefconfig <file> Save the minimal current configuration to <file>\n");
printf(" --allnoconfig New config where all options are answered with no\n"); printf(" --allnoconfig New config where all options are answered with no\n");

View File

@ -33,12 +33,15 @@ usage() {
echo " -n use allnoconfig instead of alldefconfig" echo " -n use allnoconfig instead of alldefconfig"
echo " -r list redundant entries when merging fragments" echo " -r list redundant entries when merging fragments"
echo " -O dir to put generated output files. Consider setting \$KCONFIG_CONFIG instead." echo " -O dir to put generated output files. Consider setting \$KCONFIG_CONFIG instead."
echo
echo "Used prefix: '$CONFIG_PREFIX'. You can redefine it with \$CONFIG_ environment variable."
} }
RUNMAKE=true RUNMAKE=true
ALLTARGET=alldefconfig ALLTARGET=alldefconfig
WARNREDUN=false WARNREDUN=false
OUTPUT=. OUTPUT=.
CONFIG_PREFIX=${CONFIG_-CONFIG_}
while true; do while true; do
case $1 in case $1 in
@ -99,7 +102,8 @@ if [ ! -r "$INITFILE" ]; then
fi fi
MERGE_LIST=$* MERGE_LIST=$*
SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p" SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(${CONFIG_PREFIX}[a-zA-Z0-9_]*\)[= ].*/\2/p"
TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX) TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
echo "Using $INITFILE as base" echo "Using $INITFILE as base"