From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: "Köry Maincent via buildroot" <buildroot@buildroot.org>
Cc: "Köry Maincent" <kory.maincent@bootlin.com>
Subject: Re: [Buildroot] [PATCH] boot/at91bootstrap: disable PIE and stack-protector build flags
Date: Sun, 1 Oct 2023 11:04:22 +0200 [thread overview]
Message-ID: <20231001110422.0810c899@windsurf> (raw)
In-Reply-To: <20221004125242.136925-1-kory.maincent@bootlin.com>
Hello Köry,
On Tue, 4 Oct 2022 14:52:41 +0200
Köry Maincent via buildroot <buildroot@buildroot.org> wrote:
> From: Kory Maincent <kory.maincent@bootlin.com>
>
> The toolchain wrapper add automatically Position Independent Execution
> and stack protector flags in the build process when selected in the
> configuration. at91bootstrap does not support these, therefore I added a
> patch to disable them in the Makefiles
>
> Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
> ---
> ...ck-protector-and-the-PIE-build-flags.patch | 502 ++++++++++++++++++
> 1 file changed, 502 insertions(+)
> create mode 100644 boot/at91bootstrap/0004-ensure-the-stack-protector-and-the-PIE-build-flags.patch
Thanks for the patch. However, the at91bootstrap patch was highly
repetitive, and we have no chance of merging it upstream since upstream
is essentially dead. So instead, I committed this:
+# The at91bootstrap Makefile doesn't support customizing
+# CFLAGS/LDFLAGS, so we cheat and pass our custom flags through CC and
+# LD.
define AT91BOOTSTRAP_BUILD_CMDS
- $(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) -C $(@D)/$(AT91BOOTSTRAP_MAKE_SUBDIR)
+ $(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) \
+ CC="$(TARGET_CC) -fno-stack-protector" \
+ LD="$(TARGET_CC) -fno-PIE" \
+ -C $(@D)/$(AT91BOOTSTRAP_MAKE_SUBDIR)
endef
which achieves exactly the same, but is more concise.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2023-10-01 9:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-04 12:52 [Buildroot] [PATCH] boot/at91bootstrap: disable PIE and stack-protector build flags Köry Maincent via buildroot
2023-10-01 9:04 ` Thomas Petazzoni via buildroot [this message]
2023-10-13 10:24 ` Peter Korsgaard
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=20231001110422.0810c899@windsurf \
--to=buildroot@buildroot.org \
--cc=kory.maincent@bootlin.com \
--cc=thomas.petazzoni@bootlin.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