From: dann frazier <dannf@debian.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
Leif Lindholm <leif.lindholm@linaro.org>
Subject: Re: [PATCH] BaseTools/GCC ARM/AARCH64: Force disable PIE
Date: Wed, 24 May 2017 08:07:48 -0700 [thread overview]
Message-ID: <20170524150748.czs5an7dweogqxmx@xps13.dannf> (raw)
In-Reply-To: <CAKv+Gu8rpwv70wgu40zHApDXNtVqX6xtq2nCG93Hr3jpxHDJEg@mail.gmail.com>
On Thu, May 18, 2017 at 10:52:24PM +0100, Ard Biesheuvel wrote:
> On 18 May 2017 at 22:05, dann frazier <dannf@debian.org> wrote:
> > After Debian's toolchain switched to PIE by default, our edk2 builds began
> > to fail to build (GCC49 w/ gcc 6.3). This patch fixes the build by forcing
> > off PIE for both ARM and AARCH64 builds.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: dann frazier <dannf@debian.org>
> > ---
> > BaseTools/Conf/tools_def.template | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
> > index 427ef1bb3a..cf35cb1353 100755
> > --- a/BaseTools/Conf/tools_def.template
> > +++ b/BaseTools/Conf/tools_def.template
> > @@ -4339,9 +4339,9 @@ DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-stri
> > DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
> > DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
> > DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency
> > -DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft
> > +DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft -fno-pie -no-pie
> > DEFINE GCC_ARM_CC_XIPFLAGS = -mno-unaligned-access
> > -DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-pic
> > +DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-pic -fno-pie -no-pie
>
> Please remove the -no-pie from the shared CC_FLAGS: my 4.9 toolchain
> does not appear to support it.
-no-pie appears to have been added as a replacement/alias for -static
in the 5.x series, when the PIE default-enabled option was added. I've
verified that using -static also fixes the build with 6.x, and doesn't
break the build with Linaro's 4.9, so I'll plan to use that option in
v2.
> > DEFINE GCC_AARCH64_CC_XIPFLAGS = -mstrict-align
> > DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie
> > DEFINE GCC_DLINK2_FLAGS_COMMON = -Wl,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
> >
>
> Please cc Liming and Yonghong when sending out your v2.
Sure thing, thanks for considering this.
-dann
prev parent reply other threads:[~2017-05-24 15:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-18 21:05 [PATCH] BaseTools/GCC ARM/AARCH64: Force disable PIE dann frazier
2017-05-18 21:52 ` Ard Biesheuvel
2017-05-24 15:07 ` dann frazier [this message]
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-list 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=20170524150748.czs5an7dweogqxmx@xps13.dannf \
--to=devel@edk2.groups.io \
/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