x86/Kconfig: Drop check for '-mabi=ms' for CONFIG_EFI_STUB
Subsystems (2)
PATCH 1/1 x86/Kconfig: Drop check for '-mabi=ms' for CONFIG_EFI_STUB
A recent change in LLVM made CONFIG_EFI_STUB unselectable because it no longer pretends to support '-mabi=ms', breaking the dependency in Kconfig. Lack of CONFIG_EFI_STUB can prevent kernels from booting via EFI in certain circumstances.
This check was added by commit 8f24f8c2fc82 ("efi/libstub: Annotate firmware routines as __efiapi") to ensure that '__attribute__((ms_abi))' was available, as '-mabi=ms' is not actually used in any cflags. According to the GCC documentation, this attribute has been supported since GCC 4.4.7. The kernel currently requires GCC 5.1 so this check is not necessary; even when that change landed in 5.6, the kernel required GCC 4.9 so it was unnecessary then as well. Clang supports '__attribute__((ms_abi))' for all versions that are supported for building the kernel so no additional check is needed. Remove the 'depends on' line altogether to allow CONFIG_EFI_STUB to be selected when CONFIG_EFI is enabled, regardless of compiler.
--- arch/x86/Kconfig | 1 - 1 file changed, 1 deletion(-)
arch/x86/Kconfig +0 -1
@@ -1956,7 +1956,6 @@ config EFI config EFI_STUB bool "EFI stub support" depends on EFI - depends on $(cc-option,-mabi=ms) || X86_32 select RELOCATABLE help This kernel feature allows a bzImage to be loaded directly
base-commit: f76349cf41451c5c42a99f18a9163377e4b364ff
Signature · 1 line
2.37.3
Quoted 18 lines · Nathan Chancellor
A recent change in LLVM made
CONFIG_EFI_STUBunselectable because it no longer pretends to support '-mabi=ms', breaking the dependency inKconfig. Lack ofCONFIG_EFI_STUBcan prevent kernels from booting via EFI in certain circumstances.This check was added by commit
8f24f8c2fc82("efi/libstub: Annotate firmware routines as__efiapi") to ensure that '__attribute__((ms_abi))' was available, as '-mabi=ms' is not actually used in any cflags. According to the GCC documentation, this attribute has been supported since GCC 4.4.7. The kernel currently requires GCC 5.1 so this check is not necessary; even when that change landed in 5.6, the kernel required GCC 4.9 so it was unnecessary then as well. Clang supports '__attribute__((ms_abi))' for all versions that are supported for building the kernel so no additional check is needed. Remove the 'depends on' line altogether to allowCONFIG_EFI_STUBto be selected whenCONFIG_EFIis enabled, regardless of compiler.
Quoted 6 lines
Fixes 8f24f8c2fc82 ("efi/libstub: Annotate firmware routines as __efiapi")Signed-off-by Nathan Chancellor <[email protected]>
Thanks for the patch!
Quoted 21 lines
--- arch/x86/Kconfig | 1 - 1 file changed, 1 deletion(-)arch/x86/Kconfig +0
-1@@ -1956,7 +1956,6 @@ config EFI config EFI_STUB bool "EFI stub support" depends on EFI - depends on $(cc-option,-mabi=ms) || X86_32 select RELOCATABLE help This kernel feature allows a bzImage to be loaded directlybase-commit:
f76349cf41451c5c42a99f18a9163377e4b364ff--
2.37.3
Signature · 2 lines
Thanks, ~Nick Desaulniers
Hi x86 folks,
Would it be possible to pick this up for 6.1 so it can start filtering into the stable trees? I know it came down towards the beginning of the merge window so I understand the silence but I have had a couple of people independently report this problem when they used a newer snapshot of LLVM. This problem is not immediately obvious if you do not have a previous configuration to diff against.
Cheers,
Nathan
Quoted 45 lines · Nathan Chancellor
A recent change in LLVM made
CONFIG_EFI_STUBunselectable because it no longer pretends to support '-mabi=ms', breaking the dependency inKconfig. Lack ofCONFIG_EFI_STUBcan prevent kernels from booting via EFI in certain circumstances.This check was added by commit
8f24f8c2fc82("efi/libstub: Annotate firmware routines as__efiapi") to ensure that '__attribute__((ms_abi))' was available, as '-mabi=ms' is not actually used in any cflags. According to the GCC documentation, this attribute has been supported since GCC 4.4.7. The kernel currently requires GCC 5.1 so this check is not necessary; even when that change landed in 5.6, the kernel required GCC 4.9 so it was unnecessary then as well. Clang supports '__attribute__((ms_abi))' for all versions that are supported for building the kernel so no additional check is needed. Remove the 'depends on' line altogether to allowCONFIG_EFI_STUBto be selected whenCONFIG_EFIis enabled, regardless of compiler.Fixes 8f24f8c2fc82 ("efi/libstub: Annotate firmware routines as __efiapi")Signed-off-by Nathan Chancellor <[email protected]>--- arch/x86/Kconfig | 1 - 1 file changed, 1 deletion(-)arch/x86/Kconfig +0
-1@@ -1956,7 +1956,6 @@ config EFI config EFI_STUB bool "EFI stub support" depends on EFI - depends on $(cc-option,-mabi=ms) || X86_32 select RELOCATABLE help This kernel feature allows a bzImage to be loaded directlybase-commit:
f76349cf41451c5c42a99f18a9163377e4b364ffSignature · 1 line
2.37.3
Quoted 18 lines · Nathan Chancellor
A recent change in LLVM made
CONFIG_EFI_STUBunselectable because it no longer pretends to support '-mabi=ms', breaking the dependency inKconfig. Lack ofCONFIG_EFI_STUBcan prevent kernels from booting via EFI in certain circumstances.This check was added by commit
8f24f8c2fc82("efi/libstub: Annotate firmware routines as__efiapi") to ensure that '__attribute__((ms_abi))' was available, as '-mabi=ms' is not actually used in any cflags. According to the GCC documentation, this attribute has been supported since GCC 4.4.7. The kernel currently requires GCC 5.1 so this check is not necessary; even when that change landed in 5.6, the kernel required GCC 4.9 so it was unnecessary then as well. Clang supports '__attribute__((ms_abi))' for all versions that are supported for building the kernel so no additional check is needed. Remove the 'depends on' line altogether to allowCONFIG_EFI_STUBto be selected whenCONFIG_EFIis enabled, regardless of compiler.
Quoted 6 lines
Fixes 8f24f8c2fc82 ("efi/libstub: Annotate firmware routines as __efiapi")Signed-off-by Nathan Chancellor <[email protected]>
I can take this as a EFI fix as well.
Quoted 21 lines
--- arch/x86/Kconfig | 1 - 1 file changed, 1 deletion(-)arch/x86/Kconfig +0
-1@@ -1956,7 +1956,6 @@ config EFI config EFI_STUB bool "EFI stub support" depends on EFI - depends on $(cc-option,-mabi=ms) || X86_32 select RELOCATABLE help This kernel feature allows a bzImage to be loaded directlybase-commit:
f76349cf41451c5c42a99f18a9163377e4b364ff--
2.37.3