From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from complete.lackof.org (complete.lackof.org [198.49.126.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 86C9E2095A34C for ; Wed, 24 May 2017 08:07:50 -0700 (PDT) Received: from localhost (ip-64-134-234-31.public.wayport.net [64.134.234.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by complete.lackof.org (Postfix) with ESMTPSA id 8205933E0283; Wed, 24 May 2017 09:07:49 -0600 (MDT) Date: Wed, 24 May 2017 08:07:48 -0700 From: dann frazier To: Ard Biesheuvel Cc: "edk2-devel@lists.01.org" , Leif Lindholm Message-ID: <20170524150748.czs5an7dweogqxmx@xps13.dannf> References: <20170518210532.kfdccrlch2s5427b@xps13.dannf> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170306 (1.8.0) X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on complete.lackof.org Subject: Re: [PATCH] BaseTools/GCC ARM/AARCH64: Force disable PIE X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 May 2017 15:07:50 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, May 18, 2017 at 10:52:24PM +0100, Ard Biesheuvel wrote: > On 18 May 2017 at 22:05, dann frazier 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 > > --- > > 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