From nobody Fri Nov 1 16:25:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1512560367567799.7198037242497; Wed, 6 Dec 2017 03:39:27 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5C1BF2217CE40; Wed, 6 Dec 2017 03:34:54 -0800 (PST) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::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 2ED7B2217CE24 for ; Wed, 6 Dec 2017 03:34:53 -0800 (PST) Received: by mail-wm0-x244.google.com with SMTP id y82so22728081wmg.1 for ; Wed, 06 Dec 2017 03:39:25 -0800 (PST) Received: from localhost.localdomain ([105.150.171.234]) by smtp.gmail.com with ESMTPSA id c82sm2755207wme.4.2017.12.06.03.39.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Dec 2017 03:39:22 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::244; helo=mail-wm0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=NH3FPBVkk3uvq+Rw4+sdrol7cjy12sX3IuqKDwRCd8I=; b=bEh+37+/15s8QJfBWq+s2HEK6UZTKXdt8yV811BB66GjItEoN5JySOv9fZv1tQZfGD OeXs/Nmm3gbf4Bl5NIiyjBTK0Raet+HB2FnScoj42lYEViP9QQ2kcH3LNDfqYjNtOr2g WFwbqGz038K73KQo5XVwz1+VrUIQS6D6Gr2Rs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=NH3FPBVkk3uvq+Rw4+sdrol7cjy12sX3IuqKDwRCd8I=; b=ebam5DKH+Zzj8RTcEkaErTdlhfSAjsiFaziCUNbttaYFvm8TsJ4fKxYuSbOv9ploIR GSbzCArXF7vqE/Tmj3cujRMeakeI5oCtdoatwxfe/9NDYH4RT+20cTsJ+VhLJvze/GQf MnwQOejbUvdnAIyXXn21/4vShztcuaXpUgktEgbW8Gp5UQQxvAbPpZbyIfQxIEqSkb4x DFTFq6Imqaa7jQbG+RTEx65+H+zjY8e5Vln20jkpFL5N1VPlnMuWEKlShjUJ0q3uwHIB VzbTIQqKsc0uqNld76ifnMTSxXj65YCtzd6RldwYDxDRCnpxYL7jZlZOq5civIhqr77Y bUNw== X-Gm-Message-State: AKGB3mJNRL2toVQRELZ3F6eVFFaCQqcj1lRydKvJ7BZyCAilg6x88aGQ mCcAKKgTCsA/lke+fh2Q1513tqFjjqw= X-Google-Smtp-Source: AGs4zMb1qXWAp3unKeLVGjANeDslJZ6UBvFhvo4ySxce9qbhVZHVK5bwnt42XXLv0RAKGuDat4rNzQ== X-Received: by 10.28.67.68 with SMTP id q65mr8246123wma.26.1512560363369; Wed, 06 Dec 2017 03:39:23 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Wed, 6 Dec 2017 11:39:17 +0000 Message-Id: <20171206113917.6166-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [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: , Cc: Ard Biesheuvel , liming.gao@intel.com, leif.lindholm@linaro.org, lersek@redhat.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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_def.t= emplate 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)dtc # Intel(r) ACPI Compiler from # https://acpica.org/downloads # CLANG38 -Linux- Requires: -# Clang v3.8, LLVMgold plugin and GNU binutils= 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 binutils= 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-linux-g= nueabi # Optional: # Required to build platforms or ACPI tables: # Intel(r) ACPI Compiler from @@ -5652,6 +5652,7 @@ RELEASE_CLANG35_AARCH64_CC_FLAGS =3D DEF(CLANG35_AARC= H64_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) =20 *_CLANG38_*_APP_FLAGS =3D *_CLANG38_*_ASL_FLAGS =3D DEF(IASL_FLAGS) @@ -5663,7 +5664,8 @@ DEFINE CLANG38_X64_PREFIX =3D ENV(CLANG38_B= IN) DEFINE CLANG38_IA32_TARGET =3D -target i686-pc-linux-gnu DEFINE CLANG38_X64_TARGET =3D -target x86_64-pc-linux-gnu =20 -DEFINE CLANG38_ALL_CC_FLAGS =3D DEF(GCC44_ALL_CC_FLAGS) -Wno-empty= -body -fno-stack-protector -mms-bitfields -Wno-address -Wno-shift-negative-= value -Wno-parentheses-equality -Wno-unknown-pragmas -Wno-tautological-cons= tant-out-of-range-compare -Wno-incompatible-library-redeclaration -fno-asyn= chronous-unwind-tables -mno-sse -mno-mmx -msoft-float -mno-implicit-float = -ftrap-function=3Dundefined_behavior_has_been_optimized_away_by_clang -funs= igned-char -fno-ms-extensions -Wno-null-dereference -Wno-tautological-compa= re -Wno-unknown-warning-option -Wno-varargs +DEFINE CLANG38_WARNING_OVERRIDES =3D -Wno-parentheses-equality -Wno-tau= tological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empt= y-body -Wno-varargs +DEFINE CLANG38_ALL_CC_FLAGS =3D DEF(GCC44_ALL_CC_FLAGS) DEF(CLANG3= 8_WARNING_OVERRIDES) -fno-stack-protector -mms-bitfields -Wno-address -Wno-= shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-redecla= ration -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -msoft-float -mno-= implicit-float -ftrap-function=3Dundefined_behavior_has_been_optimized_awa= y_by_clang -funsigned-char -fno-ms-extensions -Wno-null-dereference -Wno-un= known-warning-option =20 ########################### # CLANG38 IA32 definitions @@ -5739,6 +5741,96 @@ NOOPT_CLANG38_X64_CC_FLAGS =3D DEF(CLANG38_A= LL_CC_FLAGS) -m64 "-DEFIAPI=3D__ NOOPT_CLANG38_X64_DLINK_FLAGS =3D DEF(GCC5_IA32_X64_DLINK_FLAGS) -Wl,= -O0 -Wl,-melf_x86_64 -Wl,--oformat=3Delf64-x86-64 -Wl,-pie -mcmodel=3Dsmall NOOPT_CLANG38_X64_DLINK2_FLAGS =3D DEF(GCC5_X64_DLINK2_FLAGS) -O0 =20 +################## +# CLANG38 ARM definitions +################## +DEFINE CLANG38_ARM_TARGET =3D -target arm-linux-gnueabihf +DEFINE CLANG38_ARM_CC_FLAGS =3D DEF(GCC_ARM_CC_FLAGS) DEF(CLANG38_ARM= _TARGET) DEF(CLANG38_WARNING_OVERRIDES) -mno-movt +DEFINE CLANG38_ARM_DLINK_FLAGS =3D DEF(CLANG38_ARM_TARGET) DEF(GCC_ARM_D= LINK_FLAGS) + +*_CLANG38_ARM_PP_FLAGS =3D DEF(GCC_PP_FLAGS) +*_CLANG38_ARM_ASLCC_FLAGS =3D DEF(GCC_ASLCC_FLAGS) +*_CLANG38_ARM_APP_FLAGS =3D +*_CLANG38_ARM_ASL_FLAGS =3D DEF(IASL_FLAGS) +*_CLANG38_ARM_ASL_OUTFLAGS =3D DEF(IASL_OUTFLAGS) +*_CLANG38_ARM_DTCPP_FLAGS =3D DEF(GCC_DTCPP_FLAGS) + +*_CLANG38_ARM_CC_PATH =3D ENV(CLANG38_BIN)clang +*_CLANG38_ARM_ASM_PATH =3D ENV(CLANG38_BIN)clang +*_CLANG38_ARM_PP_PATH =3D ENV(CLANG38_BIN)clang +*_CLANG38_ARM_VFRPP_PATH =3D ENV(CLANG38_BIN)clang +*_CLANG38_ARM_ASLCC_PATH =3D ENV(CLANG38_BIN)clang +*_CLANG38_ARM_ASLPP_PATH =3D ENV(CLANG38_BIN)clang +*_CLANG38_ARM_DLINK_PATH =3D ENV(CLANG38_BIN)clang +*_CLANG38_ARM_ASLDLINK_PATH =3D ENV(CLANG38_BIN)clang + +*_CLANG38_ARM_SLINK_PATH =3D ENV(CLANG38_BIN)llvm-ar +*_CLANG38_ARM_RC_PATH =3D ENV(CLANG38_ARM_PREFIX)objcopy + +*_CLANG38_ARM_ASLCC_FLAGS =3D DEF(GCC_ASLCC_FLAGS) +*_CLANG38_ARM_ASLDLINK_FLAGS =3D DEF(CLANG38_ARM_TARGET) DEF(GCC_ARM_A= SLDLINK_FLAGS) +*_CLANG38_ARM_ASM_FLAGS =3D DEF(GCC_ASM_FLAGS) DEF(CLANG38_ARM_TA= RGET) $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -Qunused-arguments +*_CLANG38_ARM_DLINK2_FLAGS =3D DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--de= fsym=3DPECOFF_HEADER_SIZE=3D0x220 +*_CLANG38_ARM_PLATFORM_FLAGS =3D -march=3Darmv7-a +*_CLANG38_ARM_PP_FLAGS =3D DEF(GCC_PP_FLAGS) DEF(CLANG38_ARM_TAR= GET) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) +*_CLANG38_ARM_RC_FLAGS =3D DEF(GCC_ARM_RC_FLAGS) +*_CLANG38_ARM_VFRPP_FLAGS =3D DEF(GCC_VFRPP_FLAGS) DEF(CLANG38_ARM_= TARGET) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) +*_CLANG38_ARM_ASLPP_FLAGS =3D DEF(GCC_ASLPP_FLAGS) DEF(CLANG38_ARM_= TARGET) +*_CLANG38_ARM_CC_XIPFLAGS =3D DEF(GCC_ARM_CC_XIPFLAGS) + + DEBUG_CLANG38_ARM_CC_FLAGS =3D DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FL= AGS) $(PLATFORM_FLAGS) -O3 + DEBUG_CLANG38_ARM_DLINK_FLAGS =3D DEF(CLANG38_ARM_DLINK_FLAGS) -flto -W= l,-O3 + NOOPT_CLANG38_ARM_CC_FLAGS =3D DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FL= AGS) $(PLATFORM_FLAGS) -O0 + NOOPT_CLANG38_ARM_DLINK_FLAGS =3D DEF(CLANG38_ARM_DLINK_FLAGS) +RELEASE_CLANG38_ARM_CC_FLAGS =3D DEF(CLANG38_ARM_CC_FLAGS) $(ARCHCC_FL= AGS) $(PLATFORM_FLAGS) -O3 +RELEASE_CLANG38_ARM_DLINK_FLAGS =3D DEF(CLANG38_ARM_DLINK_FLAGS) -flto -W= l,-O3 + +################## +# CLANG38 AARCH64 definitions +################## +DEFINE CLANG38_AARCH64_TARGET =3D -target aarch64-linux-gnu +DEFINE CLANG38_AARCH64_CC_FLAGS =3D DEF(GCC_AARCH64_CC_FLAGS) DEF(CLANG38= _AARCH64_TARGET) -mcmodel=3Dsmall DEF(CLANG38_WARNING_OVERRIDES) +DEFINE CLANG38_AARCH64_DLINK_FLAGS =3D DEF(CLANG38_AARCH64_TARGET) DEF(GC= C_AARCH64_DLINK_FLAGS) -z common-page-size=3D0x1000 + +*_CLANG38_AARCH64_PP_FLAGS =3D DEF(GCC_PP_FLAGS) +*_CLANG38_AARCH64_ASLCC_FLAGS =3D DEF(GCC_ASLCC_FLAGS) +*_CLANG38_AARCH64_APP_FLAGS =3D +*_CLANG38_AARCH64_ASL_FLAGS =3D DEF(IASL_FLAGS) +*_CLANG38_AARCH64_ASL_OUTFLAGS =3D DEF(IASL_OUTFLAGS) +*_CLANG38_AARCH64_DTCPP_FLAGS =3D DEF(GCC_DTCPP_FLAGS) + +*_CLANG38_AARCH64_CC_PATH =3D ENV(CLANG38_BIN)clang +*_CLANG38_AARCH64_ASM_PATH =3D ENV(CLANG38_BIN)clang +*_CLANG38_AARCH64_PP_PATH =3D ENV(CLANG38_BIN)clang +*_CLANG38_AARCH64_VFRPP_PATH =3D ENV(CLANG38_BIN)clang +*_CLANG38_AARCH64_ASLCC_PATH =3D ENV(CLANG38_BIN)clang +*_CLANG38_AARCH64_ASLPP_PATH =3D ENV(CLANG38_BIN)clang +*_CLANG38_AARCH64_DLINK_PATH =3D ENV(CLANG38_BIN)clang +*_CLANG38_AARCH64_ASLDLINK_PATH =3D ENV(CLANG38_BIN)clang + +*_CLANG38_AARCH64_SLINK_PATH =3D ENV(CLANG38_BIN)llvm-ar +*_CLANG38_AARCH64_RC_PATH =3D ENV(CLANG38_AARCH64_PREFIX)objcopy + +*_CLANG38_AARCH64_ASLCC_FLAGS =3D DEF(GCC_ASLCC_FLAGS) +*_CLANG38_AARCH64_ASLDLINK_FLAGS =3D DEF(CLANG38_AARCH64_TARGET) DEF(GCC_A= ARCH64_ASLDLINK_FLAGS) +*_CLANG38_AARCH64_ASM_FLAGS =3D DEF(GCC_ASM_FLAGS) DEF(CLANG38_AARCH6= 4_TARGET) $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -Qunused-arguments +*_CLANG38_AARCH64_DLINK_FLAGS =3D DEF(CLANG38_AARCH64_TARGET) DEF(GCC_A= ARCH64_DLINK_FLAGS) -z common-page-size=3D0x1000 +*_CLANG38_AARCH64_DLINK_XIPFLAGS =3D -z common-page-size=3D0x20 +*_CLANG38_AARCH64_DLINK2_FLAGS =3D DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--de= fsym=3DPECOFF_HEADER_SIZE=3D0x228 +*_CLANG38_AARCH64_PLATFORM_FLAGS =3D +*_CLANG38_AARCH64_PP_FLAGS =3D DEF(GCC_PP_FLAGS) DEF(CLANG38_AARCH64= _TARGET) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) +*_CLANG38_AARCH64_RC_FLAGS =3D DEF(GCC_AARCH64_RC_FLAGS) +*_CLANG38_AARCH64_VFRPP_FLAGS =3D DEF(GCC_VFRPP_FLAGS) DEF(CLANG38_AARC= H64_TARGET) $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) +*_CLANG38_AARCH64_ASLPP_FLAGS =3D DEF(GCC_ASLPP_FLAGS) DEF(CLANG38_AARC= H64_TARGET) +*_CLANG38_AARCH64_CC_XIPFLAGS =3D DEF(GCC_AARCH64_CC_XIPFLAGS) + + DEBUG_CLANG38_AARCH64_CC_FLAGS =3D DEF(CLANG38_AARCH64_CC_FLAGS) $(AR= CHCC_FLAGS) $(PLATFORM_FLAGS) -O3 + DEBUG_CLANG38_AARCH64_DLINK_FLAGS =3D DEF(CLANG38_AARCH64_DLINK_FLAGS) -= flto -Wl,-O3 + NOOPT_CLANG38_AARCH64_CC_FLAGS =3D DEF(CLANG38_AARCH64_CC_FLAGS) $(AR= CHCC_FLAGS) $(PLATFORM_FLAGS) -O0 + NOOPT_CLANG38_AARCH64_DLINK_FLAGS =3D DEF(CLANG38_AARCH64_DLINK_FLAGS) +RELEASE_CLANG38_AARCH64_CC_FLAGS =3D DEF(CLANG38_AARCH64_CC_FLAGS) $(AR= CHCC_FLAGS) $(PLATFORM_FLAGS) -O3 +RELEASE_CLANG38_AARCH64_DLINK_FLAGS =3D DEF(CLANG38_AARCH64_DLINK_FLAGS) -= flto -Wl,-O3 + ##########################################################################= ########## # # Cygwin GCC And Intel ACPI Compiler --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel