From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 92C432063D761 for ; Wed, 23 May 2018 08:18:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 43ABA40704B0; Wed, 23 May 2018 15:18:45 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-208.rdu2.redhat.com [10.10.120.208]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8577111AF11; Wed, 23 May 2018 15:18:43 +0000 (UTC) To: "Gao, Liming" , Leif Lindholm Cc: Ard Biesheuvel , edk2-devel-01 , "pjones@redhat.com" , Cole Robinson , Paolo Bonzini , "Danilo C. L. de Paula" References: <20180518182301.25265-1-lersek@redhat.com> <20180521103027.ck3xbokxx4bjekjf@bivouac.eciton.net> <72553c05-9ae1-51c4-3728-067a875c2bf0@redhat.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E22F7AA@SHSMSX104.ccr.corp.intel.com> From: Laszlo Ersek Message-ID: <3b6df1e5-07ff-35bb-ed60-b5550b56d464@redhat.com> Date: Wed, 23 May 2018 17:18:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E22F7AA@SHSMSX104.ccr.corp.intel.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 23 May 2018 15:18:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 23 May 2018 15:18:45 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: Re: [PATCH] BaseTools/tools_def: add "-fno-unwind-tables" to GCC_AARCH64_CC_FLAGS X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2018 15:18:46 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 05/23/18 16:21, Gao, Liming wrote: > Laszlo: > I agree to add this change first in tools_def.txt. Then, update IA32/X64 arch when there is a real request. For long term, I prefer to file a BZ for GccBase.lds / tools_def.template, to discard or strip .eh_frame under GCC. > > Reviewed-by: Liming Gao Thanks! I've pushed this patch now as commit cbf00651eda6, and filed . Cheers, Laszlo >> -----Original Message----- >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Laszlo Ersek >> Sent: Tuesday, May 22, 2018 5:30 PM >> To: Leif Lindholm >> Cc: Ard Biesheuvel ; edk2-devel-01 ; Gao, Liming ; >> pjones@redhat.com; Cole Robinson ; Paolo Bonzini ; Danilo C. L. de Paula >> >> Subject: Re: [edk2] [PATCH] BaseTools/tools_def: add "-fno-unwind-tables" to GCC_AARCH64_CC_FLAGS >> >> On 05/21/18 12:30, Leif Lindholm wrote: >>> On Fri, May 18, 2018 at 08:23:01PM +0200, Laszlo Ersek wrote: >>>> The ElfConvert routines in GenFw don't handle the ".eh_frame" ELF section >>>> emitted by gcc. For this reason, Leif disabled the generation of that >>>> section for AARCH64 with "-fno-asynchronous-unwind-tables" in commit >>>> 28e80befa4fe [1], and Ard did the same for IA32 and X64 in commit >>>> 26ecc55c027d [2]. (The CLANG38 toolchain received the same flag at its >>>> inception, in commit 6f756db5ea05 [3].) >>>> >>>> However, ".eh_frame" is back now; in upstream gcc commit 9cbee213b579 [4] >>>> (part of tag "gcc-8_1_0-release"), both "-fasynchronous-unwind-tables" and >>>> "-funwind-tables" were made the default for AARCH64. (The patch author >>>> described the effects on the gcc mailing list [5].) We have to counter the >>>> latter flag with "-fno-unwind-tables", otherwise GenFw chokes on >>>> ".eh_frame" again (triggered for example on Fedora 28). >>>> >>>> "-f[no-]unwind-tables" goes back to at least gcc-4.4 [6], so it's safe to >>>> add to GCC_AARCH64_CC_FLAGS. >>> >>> I'm not against this patch (which fixes a real problem), but would >>> it be possible to take the opposite approach, as Peter Jones did for >>> GRUB when the same issue hit there?: >>> >>> http://lists.gnu.org/archive/html/grub-devel/2018-02/msg00095.html >>> >>> I.e., rather than keep adding flags when new "special" sections are >>> added by toolchains, explicitly filter those out as part of the link >>> step. >> >> I guess this could be implemented in two places in BaseTools: >> >> (1) In GenFw / ElfConvert. I'm afraid that's beyond my binutils-fu at >> the moment. >> >> (2) In "BaseTools/Scripts/GccBase.lds". This is similarly beyond my >> binutils-fu, but at least I can make more comments on it: >> >> We already discard a good number of sections, but we keep (and realign) >> "eh_frame". From Ard's commit message 26ecc55c027d, I believe the idea >> here was to "retain the .eh_frame data for external debugging", and then >> strip it with "objcopy -R .eh_frame" finally (see >> [Dynamic-Library-File], in >> "BaseTools/Conf/build_rule.template"). >> >> However, in practice we stub out objcopy (see under "GCC Common" in >> "BaseTools/Conf/tools_def.template"), and then we must prevent the >> generation of .eh_frame in the first place. >> >> Rather than adding "-fno-unwind-tables", I considered moving .eh_frame >> to /DISCARD/, or else turning $(OBJCOPY) into the real thing. However, >> that would affect more targets than just AARCH64/GCC, and I really >> didn't (don't) remember why we have this redundancy with "objcopy -R >> .eh_frame" vs. "-no-fasynchronous-unwind-tables". The latest practice >> seemed to be "add more -fno-..." (see the commits I referenced above), >> so I went with that. >> >> >> I suggest we push this patch now, plus I could: >> >> - submit a followup for IA32/X64, if that's deemed best, >> - file a BZ for GenFw / ElfConvert about the programmatic relocation >> filtering, >> - file a BZ for GccBase.lds / tools_def.template, to discard or strip >> .eh_frame under GCC. >> >> Thanks >> Laszlo >> _______________________________________________ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel >