From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::244; helo=mail-wr0-x244.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) (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 3FA48209603E8 for ; Mon, 21 May 2018 03:30:32 -0700 (PDT) Received: by mail-wr0-x244.google.com with SMTP id v60-v6so15464963wrc.7 for ; Mon, 21 May 2018 03:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=j9u9LjqXCXWyM2rJKrRD24kkmhaoLU2CRt8nQEvjzh8=; b=C4uSvh+fdibt7gQjvjXBYLT274sjJyNxe5X0o5BO/x/WkbijnZYjqnobv05Rhf/8RN ljbeCYDQ2k6Yevl+bbYIsKcv0S+pJHa4UObLkA6llYn473pXJ8iaSwuzx15qsCCu6y3m iN0nqtMMcF0lqSlvgVlBGuU7GKPMMBlGdHZBU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=j9u9LjqXCXWyM2rJKrRD24kkmhaoLU2CRt8nQEvjzh8=; b=VFLAUc/xxf0sip6l8wQm5F3XXrl91KwKJL/JRHVYXhhlZm5E7rOBOWn64whu+HgVSB t4ST1CYGQGYsqPyedM8Wmo9ZSUBrsdcQ6pb+Xh4vQrcMOuiQgcUiRBFAzsmrSS0I6Aws DurLJX2tPBuSAxLpB/xqtnGRp/7z+aLopSWXyqEYiwKiCDL+TEMOuWwFyKRSZS4JV2fP 0T9FguqUqgxK81gpQ4zptDrFiEwt66K8D9/RCYLRbF76mTGtf6cVA7/r5yHfGm+LjdDd gvzAEVt8jFHlwSOtA6QHTs5iHo9KmL6G125WiSg2LR0Vqj/LKvrxwPEZi2zHvUASLxp+ AyvA== X-Gm-Message-State: ALKqPwc7/gdQKA0nwG7BTrAhPZTfElxHVHg+ZuZ9U/K9kDZebi0R6jXf IF2TSEknJ4c2PZxVLEbL9NRtcw== X-Google-Smtp-Source: AB8JxZr7uNkx6E2OX6QE1C52cjsT4A1hMJ7uXNlHj8rU2BO/7svAvlcFJWdrdJFp9uLWWrnW77wllA== X-Received: by 2002:adf:f801:: with SMTP id s1-v6mr10340769wrp.63.1526898631583; Mon, 21 May 2018 03:30:31 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id o9-v6sm13684877wrn.74.2018.05.21.03.30.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 May 2018 03:30:30 -0700 (PDT) Date: Mon, 21 May 2018 11:30:27 +0100 From: Leif Lindholm To: Laszlo Ersek Cc: edk2-devel-01 , "Danilo C. L. de Paula" , Ard Biesheuvel , Cole Robinson , Gerd Hoffmann , Liming Gao , Paolo Bonzini , Yonghong Zhu , pjones@redhat.com Message-ID: <20180521103027.ck3xbokxx4bjekjf@bivouac.eciton.net> References: <20180518182301.25265-1-lersek@redhat.com> MIME-Version: 1.0 In-Reply-To: <20180518182301.25265-1-lersek@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) 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: Mon, 21 May 2018 10:30:33 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. / Leif > [1] https://github.com/tianocore/edk2/commit/28e80befa4fe > [2] https://github.com/tianocore/edk2/commit/26ecc55c027d > [3] https://github.com/tianocore/edk2/commit/6f756db5ea05 > [4] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9cbee213b579 > [5] http://mid.mail-archive.com/7b28c03a-c032-6cec-c127-1c12cbe98eeb@foss.arm.com > [6] https://gcc.gnu.org/onlinedocs/gcc-4.4.7/gcc/Code-Gen-Options.html > > Cc: "Danilo C. L. de Paula" > Cc: Ard Biesheuvel > Cc: Cole Robinson > Cc: Gerd Hoffmann > Cc: Leif Lindholm > Cc: Liming Gao > Cc: Paolo Bonzini > Cc: Yonghong Zhu > Reported-by: "Danilo C. L. de Paula" > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Laszlo Ersek > --- > > Notes: > Repo: https://github.com/lersek/edk2.git > Branch: aarch64_no_unwind_tables > > BaseTools/Conf/tools_def.template | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template > index 03d700018550..9429033fe2e3 100755 > --- a/BaseTools/Conf/tools_def.template > +++ b/BaseTools/Conf/tools_def.template > @@ -4537,7 +4537,7 @@ DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-ad > 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 -fno-pic -fno-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 -fno-pie -ffixed-x18 > +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-unwind-tables -fno-pic -fno-pie -ffixed-x18 > DEFINE GCC_AARCH64_CC_XIPFLAGS = -mstrict-align -mgeneral-regs-only > DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie > DEFINE GCC_DLINK2_FLAGS_COMMON = -Wl,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds > -- > 2.14.1.3.gb7cf6e02401b >