linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] efi/libstub: Fix build error with libstub
@ 2020-06-10  7:14 Zhenzhong Duan
  2020-06-10  8:59 ` Nathan Chancellor
  0 siblings, 1 reply; 4+ messages in thread
From: Zhenzhong Duan @ 2020-06-10  7:14 UTC (permalink / raw)
  To: linux-kernel, linux-efi; +Cc: ardb, nivedita, keescook, mingo, Zhenzhong Duan

Got below error during build:

  In file included from drivers/firmware/efi/libstub/efi-stub-helper.c:16:0:
  drivers/firmware/efi/libstub/efi-stub-helper.c: In function ‘efi_char16_puts’:
  arch/x86/include/asm/efi.h:355:3: sorry, unimplemented: ms_abi attribute requires -maccumulate-outgoing-args or subtarget optimization implying it
     : __efi64_thunk_map(inst, func, inst, ##__VA_ARGS__))
     ^
  drivers/firmware/efi/libstub/efi-stub-helper.c:37:2: note: in expansion of macro ‘efi_call_proto’
    efi_call_proto(efi_table_attr(efi_system_table, con_out),
    ^
  drivers/firmware/efi/libstub/efi-stub-helper.c:37: confused by earlier errors, bailing out

Fix it by adding -maccumulate-outgoing-args for efi libstub build
as suggested by gcc.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@gmail.com>
---
 drivers/firmware/efi/libstub/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
index cce4a74..25e5d02 100644
--- a/drivers/firmware/efi/libstub/Makefile
+++ b/drivers/firmware/efi/libstub/Makefile
@@ -6,7 +6,7 @@
 # enabled, even if doing so doesn't break the build.
 #
 cflags-$(CONFIG_X86_32)		:= -march=i386
-cflags-$(CONFIG_X86_64)		:= -mcmodel=small
+cflags-$(CONFIG_X86_64)		:= -mcmodel=small -maccumulate-outgoing-args
 cflags-$(CONFIG_X86)		+= -m$(BITS) -D__KERNEL__ \
 				   -fPIC -fno-strict-aliasing -mno-red-zone \
 				   -mno-mmx -mno-sse -fshort-wchar \
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] efi/libstub: Fix build error with libstub
  2020-06-10  7:14 [PATCH] efi/libstub: Fix build error with libstub Zhenzhong Duan
@ 2020-06-10  8:59 ` Nathan Chancellor
  2020-06-10  9:10   ` Ard Biesheuvel
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2020-06-10  8:59 UTC (permalink / raw)
  To: Zhenzhong Duan
  Cc: linux-kernel, linux-efi, ardb, nivedita, keescook, mingo,
	clang-built-linux

On Wed, Jun 10, 2020 at 03:14:46PM +0800, Zhenzhong Duan wrote:
> Got below error during build:
> 
>   In file included from drivers/firmware/efi/libstub/efi-stub-helper.c:16:0:
>   drivers/firmware/efi/libstub/efi-stub-helper.c: In function ‘efi_char16_puts’:
>   arch/x86/include/asm/efi.h:355:3: sorry, unimplemented: ms_abi attribute requires -maccumulate-outgoing-args or subtarget optimization implying it
>      : __efi64_thunk_map(inst, func, inst, ##__VA_ARGS__))
>      ^
>   drivers/firmware/efi/libstub/efi-stub-helper.c:37:2: note: in expansion of macro ‘efi_call_proto’
>     efi_call_proto(efi_table_attr(efi_system_table, con_out),
>     ^
>   drivers/firmware/efi/libstub/efi-stub-helper.c:37: confused by earlier errors, bailing out
> 
> Fix it by adding -maccumulate-outgoing-args for efi libstub build
> as suggested by gcc.
> 
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@gmail.com>
> ---
>  drivers/firmware/efi/libstub/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
> index cce4a74..25e5d02 100644
> --- a/drivers/firmware/efi/libstub/Makefile
> +++ b/drivers/firmware/efi/libstub/Makefile
> @@ -6,7 +6,7 @@
>  # enabled, even if doing so doesn't break the build.
>  #
>  cflags-$(CONFIG_X86_32)		:= -march=i386
> -cflags-$(CONFIG_X86_64)		:= -mcmodel=small
> +cflags-$(CONFIG_X86_64)		:= -mcmodel=small -maccumulate-outgoing-args

This will need a cc-option call if this patch is necessary because clang
does not support this flag.

clang-11: error: unknown argument: '-maccumulate-outgoing-args'

>  cflags-$(CONFIG_X86)		+= -m$(BITS) -D__KERNEL__ \
>  				   -fPIC -fno-strict-aliasing -mno-red-zone \
>  				   -mno-mmx -mno-sse -fshort-wchar \
> -- 
> 1.8.3.1
> 

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] efi/libstub: Fix build error with libstub
  2020-06-10  8:59 ` Nathan Chancellor
@ 2020-06-10  9:10   ` Ard Biesheuvel
  2020-06-10  9:44     ` Zhenzhong Duan
  0 siblings, 1 reply; 4+ messages in thread
From: Ard Biesheuvel @ 2020-06-10  9:10 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Zhenzhong Duan, Linux Kernel Mailing List, linux-efi,
	Arvind Sankar, Kees Cook, Ingo Molnar, clang-built-linux

On Wed, 10 Jun 2020 at 10:59, Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> On Wed, Jun 10, 2020 at 03:14:46PM +0800, Zhenzhong Duan wrote:
> > Got below error during build:
> >
> >   In file included from drivers/firmware/efi/libstub/efi-stub-helper.c:16:0:
> >   drivers/firmware/efi/libstub/efi-stub-helper.c: In function ‘efi_char16_puts’:
> >   arch/x86/include/asm/efi.h:355:3: sorry, unimplemented: ms_abi attribute requires -maccumulate-outgoing-args or subtarget optimization implying it
> >      : __efi64_thunk_map(inst, func, inst, ##__VA_ARGS__))
> >      ^
> >   drivers/firmware/efi/libstub/efi-stub-helper.c:37:2: note: in expansion of macro ‘efi_call_proto’
> >     efi_call_proto(efi_table_attr(efi_system_table, con_out),
> >     ^
> >   drivers/firmware/efi/libstub/efi-stub-helper.c:37: confused by earlier errors, bailing out
> >
> > Fix it by adding -maccumulate-outgoing-args for efi libstub build
> > as suggested by gcc.
> >
> > Signed-off-by: Zhenzhong Duan <zhenzhong.duan@gmail.com>
> > ---
> >  drivers/firmware/efi/libstub/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
> > index cce4a74..25e5d02 100644
> > --- a/drivers/firmware/efi/libstub/Makefile
> > +++ b/drivers/firmware/efi/libstub/Makefile
> > @@ -6,7 +6,7 @@
> >  # enabled, even if doing so doesn't break the build.
> >  #
> >  cflags-$(CONFIG_X86_32)              := -march=i386
> > -cflags-$(CONFIG_X86_64)              := -mcmodel=small
> > +cflags-$(CONFIG_X86_64)              := -mcmodel=small -maccumulate-outgoing-args
>
> This will need a cc-option call if this patch is necessary because clang
> does not support this flag.
>
> clang-11: error: unknown argument: '-maccumulate-outgoing-args'
>

A fix was already sent for this

https://lore.kernel.org/bpf/20200605150638.1011637-1-nivedita@alum.mit.edu/

which does the right thing here.

> >  cflags-$(CONFIG_X86)         += -m$(BITS) -D__KERNEL__ \
> >                                  -fPIC -fno-strict-aliasing -mno-red-zone \
> >                                  -mno-mmx -mno-sse -fshort-wchar \
> > --
> > 1.8.3.1
> >
>
> Cheers,
> Nathan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] efi/libstub: Fix build error with libstub
  2020-06-10  9:10   ` Ard Biesheuvel
@ 2020-06-10  9:44     ` Zhenzhong Duan
  0 siblings, 0 replies; 4+ messages in thread
From: Zhenzhong Duan @ 2020-06-10  9:44 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Nathan Chancellor, Linux Kernel Mailing List, linux-efi,
	Arvind Sankar, Kees Cook, Ingo Molnar, clang-built-linux

On Wed, Jun 10, 2020 at 5:10 PM Ard Biesheuvel <ardb@kernel.org> wrote:
>
> On Wed, 10 Jun 2020 at 10:59, Nathan Chancellor
> <natechancellor@gmail.com> wrote:
> >
> > On Wed, Jun 10, 2020 at 03:14:46PM +0800, Zhenzhong Duan wrote:
> > > Got below error during build:
...
> > > diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
> > > index cce4a74..25e5d02 100644
> > > --- a/drivers/firmware/efi/libstub/Makefile
> > > +++ b/drivers/firmware/efi/libstub/Makefile
> > > @@ -6,7 +6,7 @@
> > >  # enabled, even if doing so doesn't break the build.
> > >  #
> > >  cflags-$(CONFIG_X86_32)              := -march=i386
> > > -cflags-$(CONFIG_X86_64)              := -mcmodel=small
> > > +cflags-$(CONFIG_X86_64)              := -mcmodel=small -maccumulate-outgoing-args
> >
> > This will need a cc-option call if this patch is necessary because clang
> > does not support this flag.
> >
> > clang-11: error: unknown argument: '-maccumulate-outgoing-args'
> >
>
> A fix was already sent for this
>
> https://lore.kernel.org/bpf/20200605150638.1011637-1-nivedita@alum.mit.edu/
>
> which does the right thing here.
Ah, so I'm late again. Not clear if there is easy way to check queued
patches for upstream..

Regards
Zhenzhong

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-10  9:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10  7:14 [PATCH] efi/libstub: Fix build error with libstub Zhenzhong Duan
2020-06-10  8:59 ` Nathan Chancellor
2020-06-10  9:10   ` Ard Biesheuvel
2020-06-10  9:44     ` Zhenzhong Duan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).