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::242; helo=mail-it0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (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 6BDE22217CE2E for ; Wed, 6 Dec 2017 06:11:58 -0800 (PST) Received: by mail-it0-x242.google.com with SMTP id f190so7155624ita.5 for ; Wed, 06 Dec 2017 06:16:31 -0800 (PST) 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:content-transfer-encoding; bh=nushZL6eT2+3HDtJCv1mDLyJg/8qjCezGSGLoy2VhJU=; b=L1ZdcTAINC48RZVEuqzkYmPFhnFlul1YVVw6X1/LuBpfWTNpfwDoKAb0/R7M3DYjqQ o0TASZq/OXaFJ5tPwJfbNkpXe0EE9HbU0dRch3Ob7Mk4MjPNTOXDjkU5UKxhL4UNLd3z yGo4Kwya2YTXHNbpz1mHPfzziy/zm1hTGkgvE= 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:content-transfer-encoding; bh=nushZL6eT2+3HDtJCv1mDLyJg/8qjCezGSGLoy2VhJU=; b=mB8e/JE/En3Mzw52RN2OHGXDfbcl8IKRWorCz+XlEFM6ZwZdQSh/kOIdPFzGk/Yq/i 4moM0m4gxikbVEFvlRoFWuo0d2QZzHtnUgGAnitFQPHsDd7CQRYnSMrM+YtKWRBiArQb zWz2DCVzwQp4qq5KP3C/CN6zxn0zqnzvQwDV9eTyi/m7vWxvnog5RQtcRF/PHRG5HQbN Th/dYbKoIJrP8p7d+raUURDZW8vq884DAwJmQuCxJYglK28hDei0M+KYydhJF7lyqRVK swJTRUISKvz7lDA3WTpj1CSsu8LsxO2vzoLcptO6YrEqKA92n3X1HzzMsc+dzjcgt4b9 C4rA== X-Gm-Message-State: AKGB3mKFbxen/Sge8JLAcPjUqHsjeM4nMTXdfl1ykxSVt5Egg3u8iruC 9AcZZdjzf4AqnU/SEPaky0Sb1YNpEbTswOlfZzKzEA== X-Google-Smtp-Source: AGs4zMbz2BZ9bEQF7uTHQVhxgUoQNXeVWjPnZQLtl9FpnqOuu2TMW5iAvQAhZgWacGUphUwqtMcKZk3TVazNZT5iKzU= X-Received: by 10.36.31.212 with SMTP id d203mr13221587itd.48.1512569790228; Wed, 06 Dec 2017 06:16:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.104.16 with HTTP; Wed, 6 Dec 2017 06:16:29 -0800 (PST) In-Reply-To: References: <20171206113917.6166-1-ard.biesheuvel@linaro.org> From: Ard Biesheuvel Date: Wed, 6 Dec 2017 14:16:29 +0000 Message-ID: To: Laszlo Ersek Cc: "edk2-devel@lists.01.org" , Leif Lindholm , "Gao, Liming" , "Zhu, Yonghong" , "Shi, Steven" , Evan Lloyd Subject: Re: [PATCH] BaseTools/tools_def: add CLANG38 LTO versions for AARCH64 and ARM 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, 06 Dec 2017 14:11:59 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 6 December 2017 at 14:12, Laszlo Ersek wrote: > On 12/06/17 12:39, Ard Biesheuvel wrote: >> Extend the CLANG38 toolchain definition so it can be used for >> ARM and AARCH64 as well. Note that this requires llvm-ar and >> the LLVMgold.so linker plugin. >> >> In preparation of doing the same for GCC5, this toolchain version >> also departs from the custom of using -O0 for DEBUG builds, which >> makes them needlessly slow. Instead, let's add a NOOPT flavor as >> well, and enable optimization for DEBUG like the other architectures >> do. (Note that this will require some trivial changes to the platform >> description files) >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Ard Biesheuvel >> --- >> BaseTools/Conf/tools_def.template | 98 +++++++++++++++++++- >> 1 file changed, 95 insertions(+), 3 deletions(-) >> >> diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_de= f.template >> index 91b135c2e569..6ee720d7586e 100755 >> --- a/BaseTools/Conf/tools_def.template >> +++ b/BaseTools/Conf/tools_def.template >> @@ -399,8 +399,8 @@ DEFINE DTC_BIN =3D ENV(DTC_PREFIX)dt= c >> # Intel(r) ACPI Compiler from >> # https://acpica.org/downloads >> # CLANG38 -Linux- Requires: >> -# Clang v3.8, LLVMgold plugin and GNU binut= ils 2.26 targeting x86_64-linux-gnu >> -# Clang v3.9 or later, LLVMgold plugin and = GNU binutils 2.28 targeting x86_64-linux-gnu >> +# Clang v3.8, LLVMgold plugin and GNU binut= ils 2.26 targeting x86_64-linux-gnu, aarch64-linux-gnu or arm-linux-gnueabi >> +# Clang v3.9 or later, LLVMgold plugin and = GNU binutils 2.28 targeting x86_64-linux-gnu, aarch64-linux-gnu or arm-linu= x-gnueabi >> # Optional: >> # Required to build platforms or ACPI table= s: >> # Intel(r) ACPI Compiler from >> @@ -5652,6 +5652,7 @@ RELEASE_CLANG35_AARCH64_CC_FLAGS =3D DEF(CLANG35_A= ARCH64_CC_FLAGS) $(ARCHCC_FLAGS) >> *_CLANG38_*_MAKE_PATH =3D make >> *_CLANG38_*_*_DLL =3D ENV(CLANG38_DLL) >> *_CLANG38_*_ASL_PATH =3D DEF(UNIX_IASL_BIN) >> +*_CLANG38_*_DTC_PATH =3D DEF(DTC_BIN) >> >> *_CLANG38_*_APP_FLAGS =3D >> *_CLANG38_*_ASL_FLAGS =3D DEF(IASL_FLAGS) >> @@ -5663,7 +5664,8 @@ DEFINE CLANG38_X64_PREFIX =3D ENV(CLANG3= 8_BIN) >> DEFINE CLANG38_IA32_TARGET =3D -target i686-pc-linux-gnu >> DEFINE CLANG38_X64_TARGET =3D -target x86_64-pc-linux-gnu >> >> -DEFINE CLANG38_ALL_CC_FLAGS =3D DEF(GCC44_ALL_CC_FLAGS) -Wno-em= pty-body -fno-stack-protector -mms-bitfields -Wno-address -Wno-shift-negati= ve-value -Wno-parentheses-equality -Wno-unknown-pragmas -Wno-tautological-c= onstant-out-of-range-compare -Wno-incompatible-library-redeclaration -fno-a= synchronous-unwind-tables -mno-sse -mno-mmx -msoft-float -mno-implicit-floa= t -ftrap-function=3Dundefined_behavior_has_been_optimized_away_by_clang -f= unsigned-char -fno-ms-extensions -Wno-null-dereference -Wno-tautological-co= mpare -Wno-unknown-warning-option -Wno-varargs >> +DEFINE CLANG38_WARNING_OVERRIDES =3D -Wno-parentheses-equality -Wno-= tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-e= mpty-body -Wno-varargs >> +DEFINE CLANG38_ALL_CC_FLAGS =3D DEF(GCC44_ALL_CC_FLAGS) DEF(CLA= NG38_WARNING_OVERRIDES) -fno-stack-protector -mms-bitfields -Wno-address -W= no-shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-rede= claration -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -msoft-float -m= no-implicit-float -ftrap-function=3Dundefined_behavior_has_been_optimized_= away_by_clang -funsigned-char -fno-ms-extensions -Wno-null-dereference -Wno= -unknown-warning-option > > At a quite superficial look, the patch seems OK to me. I'm just curious > about one thing: what decides if a -Wno... option goes into > CLANG38_WARNING_OVERRIDES? You left some -Wno... options out of it (kept > them explicitly in the CLANG38_ALL_CC_FLAGS define). > I split off some warning overrides that are shared between all architectures, and left the x86 only ones in CLANG38_ALL_CC_FLAGS > ... It seems like the CLANG38_ALL_CC_FLAGS is not used for the ARM / > AARCH64 toolchains. "ALL" becomes sort of a misnomer then. Is that OK? > Yes. In tools_def land, ALL still means 'both IA32 and X64', and I have wasted too many cycles on trying to refactor the GCC toolchains to care about it.