linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Zhenzhong Duan <zhenzhong.duan@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org,
	ardb@kernel.org, nivedita@alum.mit.edu, keescook@chromium.org,
	mingo@kernel.org, clang-built-linux@googlegroups.com
Subject: Re: [PATCH] efi/libstub: Fix build error with libstub
Date: Wed, 10 Jun 2020 01:59:32 -0700	[thread overview]
Message-ID: <20200610085932.GA461993@ubuntu-n2-xlarge-x86> (raw)
In-Reply-To: <20200610071446.3737-1-zhenzhong.duan@gmail.com>

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

  reply	other threads:[~2020-06-10  8:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10  7:14 [PATCH] efi/libstub: Fix build error with libstub Zhenzhong Duan
2020-06-10  8:59 ` Nathan Chancellor [this message]
2020-06-10  9:10   ` Ard Biesheuvel
2020-06-10  9:44     ` Zhenzhong Duan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200610085932.GA461993@ubuntu-n2-xlarge-x86 \
    --to=natechancellor@gmail.com \
    --cc=ardb@kernel.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=keescook@chromium.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=nivedita@alum.mit.edu \
    --cc=zhenzhong.duan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).