Kconfig: regularize selection of CONFIG_BINFMT_ELF
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 3 Dec 2020 04:56:34 +0000 (23:56 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 6 Jan 2021 13:42:49 +0000 (08:42 -0500)
with mips converted to use of fs/config_binfmt_elf.c, there's no
need to keep selects of that thing all over arch/* - we can simply
turn into def_bool y if COMPAT && BINFMT_ELF (in fs/Kconfig.binfmt)
and get rid of all selects.

Several architectures got those selects wrong (e.g. you could
end up with sparc64 sans BINFMT_ELF, with select violating
dependencies, etc.)

Randy Dunlap has spotted some of those; IMO this is simpler than
his fix, but it depends upon the stuff that would need to be
backported, so we might end up using his variant for -stable.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/arm64/Kconfig
arch/mips/Kconfig
arch/parisc/Kconfig
arch/powerpc/Kconfig
arch/s390/Kconfig
arch/sparc/Kconfig
arch/x86/Kconfig
fs/Kconfig.binfmt

index 05e1735..ed48fd4 100644 (file)
@@ -1215,7 +1215,6 @@ config ARM64_TAGGED_ADDR_ABI
 menuconfig COMPAT
        bool "Kernel support for 32-bit EL0"
        depends on ARM64_4K_PAGES || EXPERT
-       select COMPAT_BINFMT_ELF if BINFMT_ELF
        select HAVE_UID16
        select OLD_SIGSUSPEND3
        select COMPAT_OLD_SIGACTION
index a46423f..f29ec95 100644 (file)
@@ -3278,7 +3278,6 @@ config MIPS32_O32
        select ARCH_WANT_OLD_COMPAT_IPC
        select COMPAT
        select MIPS32_COMPAT
-       select COMPAT_BINFMT_ELF
        select SYSVIPC_COMPAT if SYSVIPC
        help
          Select this option if you want to run o32 binaries.  These are pure
@@ -3292,7 +3291,6 @@ config MIPS32_N32
        depends on 64BIT
        select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
        select COMPAT
-       select COMPAT_BINFMT_ELF
        select MIPS32_COMPAT
        select SYSVIPC_COMPAT if SYSVIPC
        help
index 78b1762..26daf57 100644 (file)
@@ -336,7 +336,6 @@ source "kernel/Kconfig.hz"
 config COMPAT
        def_bool y
        depends on 64BIT
-       select COMPAT_BINFMT_ELF if BINFMT_ELF
 
 config SYSVIPC_COMPAT
        def_bool y
index 107bb43..d26a89c 100644 (file)
@@ -282,7 +282,6 @@ config COMPAT
        bool "Enable support for 32bit binaries"
        depends on PPC64
        default y if !CPU_LITTLE_ENDIAN
-       select COMPAT_BINFMT_ELF
        select ARCH_WANT_OLD_COMPAT_IPC
        select COMPAT_OLD_SIGACTION
 
index e84bdd1..73b61fe 100644 (file)
@@ -423,7 +423,6 @@ config 64BIT
 config COMPAT
        def_bool y
        prompt "Kernel support for 31 bit emulation"
-       select COMPAT_BINFMT_ELF if BINFMT_ELF
        select ARCH_WANT_OLD_COMPAT_IPC
        select COMPAT_OLD_SIGACTION
        select HAVE_UID16
index c9c34dc..1a2b564 100644 (file)
@@ -494,7 +494,6 @@ config COMPAT
        bool
        depends on SPARC64
        default y
-       select COMPAT_BINFMT_ELF
        select HAVE_UID16
        select ARCH_WANT_OLD_COMPAT_IPC
        select COMPAT_OLD_SIGACTION
index a2182d2..6d130d1 100644 (file)
@@ -2899,7 +2899,6 @@ config COMPAT_32
 config COMPAT
        def_bool y
        depends on IA32_EMULATION || X86_X32
-       select COMPAT_BINFMT_ELF if BINFMT_ELF
 
 if COMPAT
 config COMPAT_FOR_U64_ALIGNMENT
index 885da6d..b32f5df 100644 (file)
@@ -29,7 +29,7 @@ config BINFMT_ELF
          latest version).
 
 config COMPAT_BINFMT_ELF
-       bool
+       def_bool y
        depends on COMPAT && BINFMT_ELF
        select ELFCORE