[Buildroot] [PATCH] boot/at91bootstrap: disable PIE and stack-protector build flags

Peter Korsgaard peter at korsgaard.com
Fri Oct 13 10:24:13 UTC 2023


>>>>> "Thomas" == Thomas Petazzoni via buildroot <buildroot at buildroot.org> writes:

 > Hello Köry,
 > On Tue,  4 Oct 2022 14:52:41 +0200
 > Köry Maincent via buildroot <buildroot at buildroot.org> wrote:

 >> From: Kory Maincent <kory.maincent at 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 at 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.

Committed to 2023.02.x and 2023.08.x, thanks.

-- 
Bye, Peter Korsgaard



More information about the buildroot mailing list