From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::241; helo=mail-it0-x241.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x241.google.com (mail-it0-x241.google.com [IPv6:2607:f8b0:4001:c0b::241]) (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 1082F2063D751 for ; Mon, 21 May 2018 02:32:50 -0700 (PDT) Received: by mail-it0-x241.google.com with SMTP id z6-v6so20306525iti.4 for ; Mon, 21 May 2018 02:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=vaYpiLULCEvaRuJPjpCAcViH36ShIzdsAm3y0VLz55s=; b=gKlcEpdcYmH98j/A2oxrwElRx54tuc+iro/5phxl8QBuAx/bDd4tsvkBuy0WIHc1Mz 9yGdr74AdPnmOtoFeVE4BWtx1knWjZO8/5fSgcqv+c1xPwRvjLImnMVx/Flpw/I6Zppg brWH5HnY+xA5jjmd1e8RiGj0nY6bpqD19xXQI= 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=vaYpiLULCEvaRuJPjpCAcViH36ShIzdsAm3y0VLz55s=; b=h2YGXFaIWzXjwhbXwbEPitDYQf0QfEvMKvhaAt1dve766EZImAj/vxfyhZHYI7YbNs qHsQcr/SUucbGnj3N0icwBM5dvNzQ3FLeJG5oaC+aVqdbNCfBTBk+uVFPnif0OzdVJEA MkrdpOmkp58oP3IGXQ0WU1EbXEehXw3n7f8O5LE283kkLXzJ3V/NVrVTqGCEhOX0F2Xl F0lWwzgaYyxLoPfFsDmCkwQbdKK0qnJXJhw9ZiqPx6zfuypCShiF/xUash9szViM5lZA ic0BG9JL+9g4hafW5PRqOpQiEJQ3ndKS4p+59RnKyyweOCmIvXyosDXElopUo36K4Ofy ErYw== X-Gm-Message-State: ALKqPwfvyLhixj2rcw+AoFOuAKHPvZcc2MsVJT2N9kfvkTjKI4J60dJ/ bYuY9KucRYyRZ4t9678GxTh7DZGGfxR5fmIq3ExpCQ== X-Google-Smtp-Source: AB8JxZp6JSzgM63IWrTyj9ZD3H1adss3wT18c/fTpBYMzLD+bC+fbhGCoL7EXgxWsCJ5kBSqWb7V1gWAxrqUy17a9c0= X-Received: by 2002:a24:5390:: with SMTP id n138-v6mr16376249itb.42.1526895169944; Mon, 21 May 2018 02:32:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.187.134 with HTTP; Mon, 21 May 2018 02:32:49 -0700 (PDT) In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E22C7AD@SHSMSX104.ccr.corp.intel.com> References: <20180518182301.25265-1-lersek@redhat.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E22C7AD@SHSMSX104.ccr.corp.intel.com> From: Ard Biesheuvel Date: Mon, 21 May 2018 11:32:49 +0200 Message-ID: To: "Gao, Liming" Cc: Laszlo Ersek , edk2-devel-01 , "Danilo C. L. de Paula" , Cole Robinson , Gerd Hoffmann , Leif Lindholm , Paolo Bonzini , "Zhu, Yonghong" 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 09:32:51 -0000 Content-Type: text/plain; charset="UTF-8" On 21 May 2018 at 02:37, Gao, Liming wrote: > Laszlo: > Is this change required for IA32 and X64 arch? > The upstream GCC change is limited to AArch64, but I suppose it wouldn't hurt to add this to IA32/X64 as well, given that it currently only reaffirms the default, and will do the right thing if that default ever changes for IA32/X64 as well. >> -----Original Message----- >> From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] >> Sent: Saturday, May 19, 2018 4:21 PM >> To: Laszlo Ersek >> Cc: edk2-devel-01 ; Danilo C. L. de Paula ; Cole Robinson ; >> Gerd Hoffmann ; Leif Lindholm ; Gao, Liming ; Paolo Bonzini >> ; Zhu, Yonghong >> Subject: Re: [PATCH] BaseTools/tools_def: add "-fno-unwind-tables" to GCC_AARCH64_CC_FLAGS >> >> On 18 May 2018 at 20:23, 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. >> > >> > [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 >> >> Reviewed-by: Ard Biesheuvel >> >> > --- >> > >> > 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 >> >