On Sat, 6 Nov 2021 at 12:35, Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote: > > On Sat, Nov 6, 2021 at 12:34 PM Seed Of Onan <seedofonan@xxxxxxxxx> wrote: > > > > Note that everything else about configuring, building, and executing the kernel that results works great. > > > > The trouble appears to be because of the dependency test under CONFIG_EFI_STUB has $(cc-option,-mabi=ms) and (looking at that macro's definition in scripts/Kconfig.include) CLANG_FLAGS doesn't have -m64 (but certainly it is getting onto the command line of each invocation of gcc some other way) and gcc errors when combining -mabi=ms with (in this case defaulted) -mx32. > > > > I'm figuring that although it could be done in principle, the gcc folks would object to establishing a meaning to the -mabi=ms calling convention for x32 primarily because Microsoft doesn't support that and the "ms" here stands for "Microsoft", I presume. > > > > In any case, what do you think? Shouldn't the cc-option macro be more complete -- if "-m64" is being added because the build config system knows that it is needed, then it should be included in the command line used by cc-option macro? Perhaps the "-m64" happens to be in the same environment variable as the "-mabi=ms" part, in which case couldn't instead one just change the dependency test to be like $(cc-option,-m64 -mabi=ms)? > > > > Or am I missing the mark and there's a better fix in another place? > > > > Please help. Thank you, > > -Gary > > > > > > I was not invoked in anyway in the following commit. > > commit 8f24f8c2fc82f701866419dcb594e2cc1d3f46ba > Author: Ard Biesheuvel <ardb@xxxxxxxxxx> > Date: Tue Dec 24 16:10:12 2019 +0100 > > efi/libstub: Annotate firmware routines as __efiapi > > > > I added Ard to Cc. > > > > At least, please describe your problem properly. > What error did you get? How to reproduce it? > IIUC, the issue is in config EFI_STUB bool "EFI stub support" depends on EFI && !X86_USE_3DNOW depends on $(cc-option,-mabi=ms) || X86_32 where the cc-option check is failing due to the use of -mx32 for the core kernel, whereas the EFI stub will be built with -m64 regardless. Given that __attribute__((ms_abi)) should be supported on any GCC versions 4.8 or newer, I think we can just drop this depends line entirely. Would that solve your issue?