Re: Given an x32 userspace with a gcc to match (ie defaults to -mx32) then CONFIG_EFI_STUB is unavailable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 7 Nov 2021 at 08:58, Ard Biesheuvel <ardb@xxxxxxxxxx> wrote:
>
> On Sun, 7 Nov 2021 at 05:24, Seed Of Onan <seedofonan@xxxxxxxxx> wrote:
> >
> > > IIUC, the issue is in
> > > config EFI_STUB
> > >  :
> > >    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.
> > Yes, except, the kernel can't be built with -mx32, only -m32 or -m64. The -m64 option gets added to the compile flags in arch/x86/Makefile on 64bit builds.
> >
>
> Right, so it is just the compiler default
>
> > > 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?
> > Yes it would, but it sure seems to me to be the wrong way -- gcc is not the only compiler, and the ms calling convention isn't required to build the kernel otherwise, is it?
> >
>
> I don't follow. All compilers that we support implement this so why test for it?
>
> > I found in scripts/Kconfig.include a variable that is "-m64 if the compiler supports it, or an empty string otherwise":
> >     depends on $(cc-option,$(m64-flag) -mabi=ms) || X86_32
> >
> > I don't get the "|| X86_32" part -- can it really be that when building an x86_32 kernel, there is no concern about the support for the calling convention needed by the efi stub? But whatever.
>
> Of course we care about the calling convention. Why would you think
> that we don't?

Note that 32-bit UEFI code uses __attribute__((regparm(0))) as the
calling convention not ms_abi



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux