From: Andrey Ignatov <rdna@fb.com>
To: Arvind Sankar <nivedita@alum.mit.edu>
Cc: Ard Biesheuvel <ardb@kernel.org>, <linux-efi@vger.kernel.org>,
<bpf@vger.kernel.org>
Subject: Re: [PATCH] efi/x86: Fix build with gcc 4
Date: Fri, 5 Jun 2020 09:09:46 -0700 [thread overview]
Message-ID: <20200605160946.GA46739@rdna-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <20200605150638.1011637-1-nivedita@alum.mit.edu>
Arvind Sankar <nivedita@alum.mit.edu> [Fri, 2020-06-05 08:06 -0700]:
> Commit
> bbf8e8b0fe04 ("efi/libstub: Optimize for size instead of speed")
>
> changed the optimization level for the EFI stub to -Os from -O2.
>
> Andrey Ignatov reports that this breaks the build with gcc 4.8.5.
>
> Testing on godbolt.org, the combination of -Os,
> -fno-asynchronous-unwind-tables, and ms_abi functions doesn't work,
> failing with the error:
> sorry, unimplemented: ms_abi attribute requires
> -maccumulate-outgoing-args or subtarget optimization implying it
>
> This does appear to work with gcc 4.9 onwards.
>
> Add -maccumulate-outgoing-args explicitly to unbreak the build with
> pre-4.9 versions of gcc.
>
> Reported-by: Andrey Ignatov <rdna@fb.com>
> Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Thanks. I confirmed it fixes the problem on my setup with gcc 4.8.5 and
also works as before with clang 9.0.20190721.
> ---
> drivers/firmware/efi/libstub/Makefile | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
> index cce4a7436052..d67418de768c 100644
> --- a/drivers/firmware/efi/libstub/Makefile
> +++ b/drivers/firmware/efi/libstub/Makefile
> @@ -6,7 +6,8 @@
> # 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 \
> + $(call cc-option,-maccumulate-outgoing-args)
> cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ \
> -fPIC -fno-strict-aliasing -mno-red-zone \
> -mno-mmx -mno-sse -fshort-wchar \
> --
> 2.26.2
>
--
Andrey Ignatov
next prev parent reply other threads:[~2020-06-05 16:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200518190716.751506-1-nivedita@alum.mit.edu>
[not found] ` <20200518190716.751506-6-nivedita@alum.mit.edu>
2020-06-05 0:31 ` [PATCH 05/24] efi/libstub: Optimize for size instead of speed Andrey Ignatov
2020-06-05 6:33 ` Ard Biesheuvel
2020-06-05 13:14 ` Arvind Sankar
2020-06-05 13:32 ` Arvind Sankar
2020-06-05 14:53 ` Ard Biesheuvel
2020-06-05 15:10 ` Arvind Sankar
2020-06-05 15:11 ` Ard Biesheuvel
2020-06-05 15:06 ` [PATCH] efi/x86: Fix build with gcc 4 Arvind Sankar
2020-06-05 16:09 ` Andrey Ignatov [this message]
2020-06-15 9:43 ` Ard Biesheuvel
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=20200605160946.GA46739@rdna-mbp.dhcp.thefacebook.com \
--to=rdna@fb.com \
--cc=ardb@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=nivedita@alum.mit.edu \
/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).