From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andre Przywara <andre.przywara@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
Jaxson Han <jaxson.han@arm.com>,
linux-arm-kernel@lists.infradead.org,
Robin Murphy <Robin.Murphy@arm.com>
Subject: Re: [PATCH v3] Makefile: Tell compiler to generate bare-metal code
Date: Mon, 17 Jan 2022 17:49:43 +0000 [thread overview]
Message-ID: <YeWsN+/IFkOJCK/S@shell.armlinux.org.uk> (raw)
In-Reply-To: <20220117153348.2513798-1-andre.przywara@arm.com>
On Mon, Jan 17, 2022 at 03:33:48PM +0000, Andre Przywara wrote:
> Our GCC invocation does not provide many parameters, which lets the
> toolchain fill in its own default setup.
> In case of a native build or when using a full-featured cross-compiler,
> this probably means Linux userland, which is not what we want for a
> bare-metal application like boot-wrapper.
>
> Tell the compiler to forget about those standard settings, and only use
> what we explicitly ask for. In particular that means to not use toolchain
> provided libraries, since they might pull in more code than we want, and
> might not run well in the boot-wrapper environment.
>
> Disable the stack protector, as this adds code that relies on userland:
> "If a guard check fails, an error message is printed and the program
> exits." (from the gcc manpage).
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
> Hi,
>
> compared to [PATCH v2 3/9] this drops the more contentious options (for
> now, at least), and focuses on what's really needed. Including
> -fno-stack-protector, as the need for this showed up in the cleanup series
> already.
There is history here. -ffreestanding has been tried before. See:
https://patchwork.kernel.org/project/linux-kbuild/patch/20200817220212.338670-5-ndesaulniers@google.com/
Have the issues in that thread been addressed?
If not, -ffreestanding does not belong in the top-level makefile.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-01-17 17:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-17 15:33 [PATCH v3] Makefile: Tell compiler to generate bare-metal code Andre Przywara
2022-01-17 16:47 ` Mark Rutland
2022-01-17 16:53 ` Andre Przywara
2022-01-17 17:24 ` Mark Rutland
2022-01-17 17:49 ` Russell King (Oracle) [this message]
2022-01-17 18:04 ` Russell King (Oracle)
2022-01-17 18:25 ` Andre Przywara
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=YeWsN+/IFkOJCK/S@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=Robin.Murphy@arm.com \
--cc=andre.przywara@arm.com \
--cc=jaxson.han@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.