From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::234; helo=mail-it0-x234.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 85D0F2035A7AF for ; Tue, 21 Nov 2017 04:02:23 -0800 (PST) Received: by mail-it0-x234.google.com with SMTP id b5so1689189itc.3 for ; Tue, 21 Nov 2017 04:06:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1O43vlwY2T6v3Mh0fDTJGxQ/GDyhdCy6lECJ/sTk5Lg=; b=IkgLvMriNB7lZR2EhUMwVUFI725Jy6+VBG3UR8KCuONS8FSbF0BxsR6VlGCDjiGxHm C/J9Rw/dnlnzSzM2N71VJ5Y+C+zUOxQbEHcDMVG614ulKGMJMcsKCZOmzex9nW9WMH6n YP4KNNYLfIM+/XAngTwyjMCwhzkWYJ67wz7Q3we9tVdguiGjOMZM4SwTb0rURh8Zqj3a RDrCiRgxlhL64QLxPUR1Umw04Wmj/CDlCvTBApjJL6z9ZtmOvYcE6P7dKVUon1KsyGMg e/MuzUNbFPyuFMExfqv+PWuGDAPIakzOIYouL01ADN0wJqplFw1kaMxtZMRWxGCbo2iD rMfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1O43vlwY2T6v3Mh0fDTJGxQ/GDyhdCy6lECJ/sTk5Lg=; b=TV1EJy4cRqnoysnmosbxY39k2ZmCGswyDJXT6pFx0Y6zYRv6NTZ3lppJx7jmXigMR5 LwwTofW1hkDFI9kM0QLmrxGmCx97fZn8J0jEnHJ5UUj3GCuU6me6god8F6CyZbTPPsLE DCi+Kyb5yEc3aZCQHAvM3GKCOBj6dUD3FShXwPf8R688dP48OysYMJbuqzPTBJIJN4zH MB3pgAF7Qb4XNk47ajtDOpnqx0j7r9O/XjPcy8fCl+lzoodhRz+pu1UsmJDFB4D24o33 WldhiGJPGc5WV1zjrZlMtIXlHukITPx+zjNnXswquHvffWOT8NtGHKnkUxpT3NH93gN4 A73Q== X-Gm-Message-State: AJaThX6gWDPMHEWSVjB2hy0xtSyhcZ+uC8hOm/g+A2JyfsAOyd3d0GEl Fpr5d+F7Z6T6wjS5D3RJoVKyncb9eO9A/Wk5kj+iIKoz3Xc= X-Google-Smtp-Source: AGs4zMbPON6I58A6rGNr9dE7tH1Nioz5kFSuUWPud4+A56kSUatzzKSlDspYXVqs6Ymy3a16LMpuZdIbyEecYHDSgV4= X-Received: by 10.36.66.18 with SMTP id i18mr1623391itb.148.1511265997919; Tue, 21 Nov 2017 04:06:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.132.164 with HTTP; Tue, 21 Nov 2017 04:06:37 -0800 (PST) In-Reply-To: References: <20171101150125.13679-1-ard.biesheuvel@linaro.org> <4A89E2EF3DFEDB4C8BFDE51014F606A14E176A26@SHSMSX104.ccr.corp.intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E17F48B@SHSMSX104.ccr.corp.intel.com> From: Marcin Wojtas Date: Tue, 21 Nov 2017 13:06:37 +0100 Message-ID: To: Ard Biesheuvel Cc: "Gao, Liming" , "edk2-devel@lists.01.org" , "daniel.thompson@linaro.org" , "leif.lindholm@linaro.org" Subject: Re: [PATCH] BaseTools/tools_def AARCH64 ARM: disable PIE linking for .aslc sources 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: Tue, 21 Nov 2017 12:02:23 -0000 Content-Type: text/plain; charset="UTF-8" Hi Ard, 2017-11-16 16:45 GMT+01:00 Ard Biesheuvel : > On 16 November 2017 at 15:31, Gao, Liming wrote: >> Ard: >> Does this error only happen on ACPI table compiling? But, I see -no-pie is also in normal DLINK flag. Why is the driver not compiled failed? >> > > The main difference is that the ACPI tables don't tolerate any padding > at the start of the binary image. This is different for ELF binaries > that are converted to PE/COFF, given that the entry point is exposed > in the header, so the padding is just ignored. However, we should > still try to omit those sections if we can. > > > >>> -----Original Message----- >>> From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] >>> Sent: Thursday, November 16, 2017 11:09 PM >>> To: Marcin Wojtas >>> Cc: Gao, Liming ; edk2-devel@lists.01.org; daniel.thompson@linaro.org; leif.lindholm@linaro.org >>> Subject: Re: [edk2] [PATCH] BaseTools/tools_def AARCH64 ARM: disable PIE linking for .aslc sources >>> >>> On 16 November 2017 at 15:07, Marcin Wojtas wrote: >>> > Hi Ard, >>> > >>> > 2017-11-16 15:48 GMT+01:00 Ard Biesheuvel : >>> >> On 16 November 2017 at 14:38, Marcin Wojtas wrote: >>> >>> Hi Ard, >>> >>> >>> >>> With both PIE disabling patches for AARCH64, when compiling ACPI tables with >>> >>> gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- >>> >>> I get following errors: >>> >>> [...] >>> >>> aarch64-linux-gnu-gcc: error: unrecognized command line option '-no-pie' >>> >>> Do I understand correctly, that I should either revert those patches >>> >>> or upgrade to the newer toolchain? >>> >>> >>> >> >>> >> Ugh. >>> >> >>> >> I thought GCC 5 and later implemented -no-pie, but apparently not. >>> >> >>> >> Does this fix your build? I will need to check whether it fixes the >>> >> original issue, but hopefully your toolchain doesn't choke on this: >>> >> >>> >> diff --git a/BaseTools/Conf/tools_def.template >>> >> b/BaseTools/Conf/tools_def.template >>> >> index aebd7d558633..111fe8da7773 100755 >>> >> --- a/BaseTools/Conf/tools_def.template >>> >> +++ b/BaseTools/Conf/tools_def.template >>> >> @@ -4496,10 +4496,10 @@ DEFINE GCC5_AARCH64_CC_FLAGS = >>> >> DEF(GCC49_AARCH64_CC_FLAGS) >>> >> DEFINE GCC5_AARCH64_CC_XIPFLAGS = DEF(GCC49_AARCH64_CC_XIPFLAGS) >>> >> DEFINE GCC5_ARM_DLINK_FLAGS = DEF(GCC49_ARM_DLINK_FLAGS) -no-pie >>> >> DEFINE GCC5_ARM_DLINK2_FLAGS = DEF(GCC49_ARM_DLINK2_FLAGS) -Wno-error >>> >> -DEFINE GCC5_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS) -no-pie >>> >> +DEFINE GCC5_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS) >>> >> -Wl,-no-pie >>> >> DEFINE GCC5_AARCH64_DLINK2_FLAGS = >>> >> DEF(GCC49_AARCH64_DLINK2_FLAGS) -Wno-error >>> >> DEFINE GCC5_ARM_ASLDLINK_FLAGS = DEF(GCC49_ARM_ASLDLINK_FLAGS) -no-pie >>> >> -DEFINE GCC5_AARCH64_ASLDLINK_FLAGS = >>> >> DEF(GCC49_AARCH64_ASLDLINK_FLAGS) -no-pie >>> >> +DEFINE GCC5_AARCH64_ASLDLINK_FLAGS = >>> >> DEF(GCC49_AARCH64_ASLDLINK_FLAGS) -Wl,-no-pie >>> >> >>> >> #################################################################################### >>> >> # >>> >> >>> > >>> > Unfortunately no change, still: >>> > aarch64-linux-gnu-gcc: error: unrecognized command line option '-no-pie' >>> > In order to make sure, I double checked twice cleaninig everything and >>> > rebuilding from scratch. >>> > >>> >>> Thanks, but it doesn't matter anyway: it doesn't fix the original >>> issues on affected toolchains. >>> >>> It appears the only way we can deal with this is introducing GCC6 and >>> move the workaround there. >>> Do you think it would be reasonable to revert: 3380a59 - BaseTools/tools_def AARCH64 ARM: disable PIE linking for .aslc sources 1894a7c - BaseTools/tools_def AARCH64 ARM: disable PIE linking on the EDK2 master branch, so that the users are not affected before the actual workaround for problematic builds is moved to GCC6? Best regards, Marcin