From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from walk.intel-email.com (walk.intel-email.com [101.227.64.242]) by mx.groups.io with SMTP id smtpd.web12.6851.1663223339367411398 for ; Wed, 14 Sep 2022 23:29:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@byosoft.com.cn header.s=cloud-union header.b=gcgVgDKH; spf=pass (domain: byosoft.com.cn, ip: 101.227.64.242, mailfrom: gaoliming@byosoft.com.cn) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 560C5CD1F65E for ; Thu, 15 Sep 2022 14:28:56 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=byosoft.com.cn; s=cloud-union; t=1663223336; bh=WopH0J7yurVIrst7L+DRGmVbIG5edUnbZ3vcFnZH4as=; h=From:To:Cc:References:In-Reply-To:Subject:Date; b=gcgVgDKHMLwQlkOEDINJpZYXT07R3CUhI+KeoH+4n2lWdDmNSZ+CvaSemfeqTw35m Ac2NytijF+vJ1ye6hnOtkNMM7DtirMxPNdzyglJ4VRUgNba0mla+zj1P/DXlwDprrx pbU4qO3Kbkg/wltHfFlqiV95JZwvi8tTHrf0dsVE= Received: from localhost (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 52249CD1F637 for ; Thu, 15 Sep 2022 14:28:56 +0800 (CST) X-Virus-Scanned: by SpamTitan at intel-email.com Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 080F3CD1F62A for ; Thu, 15 Sep 2022 14:28:56 +0800 (CST) Authentication-Results: walk.intel-email.com; none Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by walk.intel-email.com (Postfix) with SMTP id 8C947CD1F74B for ; Thu, 15 Sep 2022 14:28:53 +0800 (CST) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Thu, 15 Sep 2022 14:28:51 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Chao Li'" , Cc: "'Bob Feng'" , "'Yuwei Chen'" , "'Dongyan Qian'" , "'Baoqi Zhang'" References: <20220914094028.3696286-1-lichao@loongson.cn> In-Reply-To: <20220914094028.3696286-1-lichao@loongson.cn> Subject: =?UTF-8?B?5Zue5aSNOiBbUEFUQ0ggdjIgMTYvMzRdIEJhc2VUb29sczogQmFzZVRvb2xzIGNoYW5nZXMgZm9yIExvb25nQXJjaCBwbGF0Zm9ybS4=?= Date: Thu, 15 Sep 2022 14:28:53 +0800 Message-ID: <003a01d8c8cc$6cf133e0$46d39ba0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQKdbxWQfHn74SpvwMidRS/So6n9jaxWul9A Sender: "gaoliming" Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Chao: This change is to update GCC5 tool chain to support LoongArch. So, the commit message title should be updated for GCC5 tool chain.=20 The code change is good to me. Reviewed-by: Liming Gao = Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: Chao Li > =B7=A2=CB=CD=CA=B1=BC=E4: 2022=C4=EA9=D4=C214=C8=D5 17:40 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Bob Feng ; Liming Gao > ; Yuwei Chen ; > Dongyan Qian ; Baoqi Zhang > > =D6=F7=CC=E2: [PATCH v2 16/34] BaseTools: BaseTools changes for = LoongArch > platform. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4053 >=20 > BaseTools define template files changes for building EDK2 LoongArch > platform. >=20 > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen >=20 > Signed-off-by: Chao Li > Co-authored-by: Dongyan Qian > Co-authored-by: Baoqi Zhang > --- > BaseTools/Conf/tools_def.template | 54 > +++++++++++++++++++++++++++---- > 1 file changed, 48 insertions(+), 6 deletions(-) >=20 > diff --git a/BaseTools/Conf/tools_def.template > b/BaseTools/Conf/tools_def.template > index 5ed19810b7..9ceadeaa59 100755 > --- a/BaseTools/Conf/tools_def.template > +++ b/BaseTools/Conf/tools_def.template > @@ -4,6 +4,7 @@ > # Portions copyright (c) 2011 - 2019, ARM Ltd. All rights = reserved.
>=20 > # Copyright (c) 2015, Hewlett-Packard Development Company, L.P.
>=20 > # (C) Copyright 2020, Hewlett Packard Enterprise Development LP
>=20 > +# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights > reserved.
>=20 > # Copyright (c) Microsoft Corporation >=20 > # >=20 > # SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -267,7 +268,7 @@ DEFINE DTC_BIN =3D > ENV(DTC_PREFIX)dtc > # Intel(r) ACPI Compiler from >=20 > # https://acpica.org/downloads >=20 > # GCC5 -Linux,Windows- Requires: >=20 > -# GCC 5 with LTO support, targeting > x86_64-linux-gnu, aarch64-linux-gnu, arm-linux-gnueabi or riscv64-linux-gnu >=20 > +# GCC 5 with LTO support, targeting > x86_64-linux-gnu, aarch64-linux-gnu, arm-linux-gnueabi, = riscv64-linux-gnu or > loongarch64-linux-gnu >=20 > # Optional: >=20 > # Required to build platforms or ACPI > tables: >=20 > # Intel(r) ACPI Compiler from >=20 > @@ -1852,6 +1853,7 @@ DEFINE GCC_ALL_CC_FLAGS =3D -g > -Os -fshort-wchar -fno-builtin -fno-stri > DEFINE GCC_IA32_CC_FLAGS =3D DEF(GCC_ALL_CC_FLAGS) > -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition = -O2 > -mno-stack-arg-probe >=20 > DEFINE GCC_X64_CC_FLAGS =3D DEF(GCC_ALL_CC_FLAGS) > -mno-red-zone -Wno-address -mno-stack-arg-probe >=20 > DEFINE GCC_ARM_CC_FLAGS =3D DEF(GCC_ALL_CC_FLAGS) > -mlittle-endian -mabi=3Daapcs -fno-short-enums -funsigned-char > -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address > -mthumb -mfloat-abi=3Dsoft -fno-pic -fno-pie >=20 > +DEFINE GCC_LOONGARCH64_CC_FLAGS =3D DEF(GCC_ALL_CC_FLAGS) > -mabi=3Dlp64d -fno-asynchronous-unwind-tables -fno-plt -Wno-address > -fno-short-enums -fsigned-char -ffunction-sections -fdata-sections >=20 > DEFINE GCC_ARM_CC_XIPFLAGS =3D -mno-unaligned-access >=20 > DEFINE GCC_AARCH64_CC_FLAGS =3D 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 >=20 > DEFINE GCC_AARCH64_CC_XIPFLAGS =3D -mstrict-align > -mgeneral-regs-only >=20 > @@ -1859,12 +1861,15 @@ DEFINE GCC_DLINK_FLAGS_COMMON =3D > -nostdlib --pie > DEFINE GCC_DLINK2_FLAGS_COMMON =3D > -Wl,--script=3D$(EDK_TOOLS_PATH)/Scripts/GccBase.lds >=20 > DEFINE GCC_IA32_X64_DLINK_COMMON =3D > DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections >=20 > DEFINE GCC_ARM_AARCH64_DLINK_COMMON=3D -Wl,--emit-relocs > -nostdlib -Wl,--gc-sections -u $(IMAGE_ENTRY_POINT) > -Wl,-e,$(IMAGE_ENTRY_POINT),-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME). > map >=20 > +DEFINE GCC_LOONGARCH64_DLINK_COMMON=3D -Wl,--emit-relocs > -nostdlib -Wl,--gc-sections -u $(IMAGE_ENTRY_POINT) > -Wl,-e,$(IMAGE_ENTRY_POINT),-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME). > map >=20 > DEFINE GCC_ARM_DLINK_FLAGS =3D > DEF(GCC_ARM_AARCH64_DLINK_COMMON) -z common-page-size=3D0x20 > -Wl,--pic-veneer >=20 > DEFINE GCC_AARCH64_DLINK_FLAGS =3D > DEF(GCC_ARM_AARCH64_DLINK_COMMON) -z common-page-size=3D0x20 >=20 > +DEFINE GCC_LOONGARCH64_DLINK_FLAGS =3D > DEF(GCC_LOONGARCH64_DLINK_COMMON) -z common-page-size=3D0x20 >=20 > DEFINE GCC_ARM_AARCH64_ASLDLINK_FLAGS =3D > -Wl,--defsym=3DPECOFF_HEADER_SIZE=3D0 DEF(GCC_DLINK2_FLAGS_COMMON) > -z common-page-size=3D0x20 >=20 > DEFINE GCC_IA32_X64_ASLDLINK_FLAGS =3D > DEF(GCC_IA32_X64_DLINK_COMMON) --entry _ReferenceAcpiTable -u > $(IMAGE_ENTRY_POINT) >=20 > DEFINE GCC_ARM_ASLDLINK_FLAGS =3D DEF(GCC_ARM_DLINK_FLAGS) > -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) > DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS) >=20 > DEFINE GCC_AARCH64_ASLDLINK_FLAGS =3D > DEF(GCC_AARCH64_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u > $(IMAGE_ENTRY_POINT) DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS) >=20 > +DEFINE GCC_LOONGARCH64_ASLDLINK_FLAGS =3D > DEF(GCC_LOONGARCH64_DLINK_FLAGS) --entry ReferenceAcpiTable -u > $(IMAGE_ENTRY_POINT) >=20 > DEFINE GCC_IA32_X64_DLINK_FLAGS =3D > DEF(GCC_IA32_X64_DLINK_COMMON) --entry _$(IMAGE_ENTRY_POINT) > --file-alignment 0x20 --section-alignment 0x20 -Map > $(DEST_DIR_DEBUG)/$(BASE_NAME).map >=20 > DEFINE GCC_ASM_FLAGS =3D -c -x assembler -imacros > AutoGen.h >=20 > DEFINE GCC_PP_FLAGS =3D -E -x assembler-with-cpp > -include AutoGen.h >=20 > @@ -1873,11 +1878,12 @@ DEFINE GCC_ASLPP_FLAGS =3D -x > c -E -include AutoGen.h > DEFINE GCC_ASLCC_FLAGS =3D -x c >=20 > DEFINE GCC_WINDRES_FLAGS =3D -J rc -O coff >=20 > DEFINE GCC_DTCPP_FLAGS =3D -E -x assembler-with-cpp > -imacros AutoGen.h -nostdinc -undef >=20 > -DEFINE GCC_IA32_RC_FLAGS =3D -I binary -O elf32-i386 > -B i386 --rename-section .data=3D.hii >=20 > -DEFINE GCC_X64_RC_FLAGS =3D -I binary -O elf64-x86-64 > -B i386 --rename-section .data=3D.hii >=20 > -DEFINE GCC_ARM_RC_FLAGS =3D -I binary -O elf32-littlearm > -B arm --rename-section .data=3D.hii >=20 > -DEFINE GCC_AARCH64_RC_FLAGS =3D -I binary -O = elf64-littleaarch64 > -B aarch64 --rename-section .data=3D.hii >=20 > -DEFINE GCC_RISCV64_RC_FLAGS =3D -I binary -O elf64-littleriscv > -B riscv --rename-section .data=3D.hii >=20 > +DEFINE GCC_IA32_RC_FLAGS =3D -I binary -O elf32-i386 > -B i386 --rename-section .data=3D.hii >=20 > +DEFINE GCC_X64_RC_FLAGS =3D -I binary -O elf64-x86-64 > -B i386 --rename-section .data=3D.hii >=20 > +DEFINE GCC_ARM_RC_FLAGS =3D -I binary -O elf32-littlearm > -B arm --rename-section .data=3D.hii >=20 > +DEFINE GCC_AARCH64_RC_FLAGS =3D -I binary -O > elf64-littleaarch64 -B aarch64 --rename-section .data=3D.hii >=20 > +DEFINE GCC_RISCV64_RC_FLAGS =3D -I binary -O elf64-littleriscv > -B riscv --rename-section .data=3D.hii >=20 > +DEFINE GCC_LOONGARCH64_RC_FLAGS =3D -I binary -O elf64-loongarch > -B loongarch64 --rename-section .data=3D.hii >=20 >=20 >=20 > # GCC Build Flag for included header file list generation >=20 > DEFINE GCC_DEPS_FLAGS =3D -MMD -MF $@.deps >=20 > @@ -1967,6 +1973,14 @@ DEFINE GCC5_RISCV64_CC_FLAGS > =3D DEF(GCC5_RISCV_ALL_CC_FLAGS) DEF(GC > DEFINE GCC5_RISCV64_DLINK_FLAGS =3D > DEF(GCC5_RISCV_ALL_DLINK_FLAGS) > -Wl,-melf64lriscv,--oformat=3Delf64-littleriscv,--no-relax >=20 > DEFINE GCC5_RISCV64_DLINK2_FLAGS =3D > DEF(GCC5_RISCV_ALL_DLINK2_FLAGS) >=20 > DEFINE GCC5_RISCV64_ASM_FLAGS =3D > DEF(GCC5_RISCV_ALL_ASM_FLAGS) -march=3DDEF(GCC5_RISCV64_ARCH) > -mcmodel=3Dmedany -mabi=3Dlp64 >=20 > + >=20 > +DEFINE GCC5_LOONGARCH64_CC_FLAGS =3D > DEF(GCC_LOONGARCH64_CC_FLAGS) -march=3Dloongarch64 -mno-memcpy > -Werror -Wno-maybe-uninitialized -Wno-stringop-overflow > -Wno-pointer-to-int-cast -no-pie -fno-stack-protector = -mno-explicit-relocs >=20 > +DEFINE GCC5_LOONGARCH64_DLINK_FLAGS =3D > DEF(GCC_LOONGARCH64_DLINK_FLAGS) >=20 > +DEFINE GCC5_LOONGARCH64_DLINK2_FLAGS =3D > DEF(GCC_DLINK2_FLAGS_COMMON) > -Wl,--defsym=3DPECOFF_HEADER_SIZE=3D0x228 >=20 > +DEFINE GCC5_LOONGARCH64_ASLDLINK_FLAGS =3D > DEF(GCC_LOONGARCH64_ASLDLINK_FLAGS) >=20 > +DEFINE GCC5_LOONGARCH64_ASM_FLAGS =3D -x > assembler-with-cpp -mabi=3Dlp64d -march=3Dloongarch64 -fno-builtin -c = -Wall > -mno-explicit-relocs >=20 > +DEFINE GCC5_LOONGARCH64_PP_FLAGS =3D -mabi=3Dlp64d > -march=3Dloongarch64 DEF(GCC_PP_FLAGS) >=20 > + >=20 > DEFINE GCC_PP_FLAGS =3D -E -x > assembler-with-cpp -include AutoGen.h DEF(GCC5_RISCV_OPENSBI_TYPES) >=20 >=20 >=20 >=20 > ############################################################## > ###################### >=20 > @@ -2445,6 +2459,34 @@ RELEASE_GCC5_AARCH64_DLINK_XIPFLAGS =3D -z > common-page-size=3D0x20 > *_GCC5_RISCV64_OBJCOPY_FLAGS =3D >=20 > *_GCC5_RISCV64_DTCPP_FLAGS =3D DEF(GCC_DTCPP_FLAGS) >=20 >=20 >=20 > +################## >=20 > +# GCC5 LOONGARCH64 definitions >=20 > +################## >=20 > +*_GCC5_LOONGARCH64_OBJCOPY_PATH =3D > ENV(GCC5_LOONGARCH64_PREFIX)objcopy >=20 > +*_GCC5_LOONGARCH64_CC_PATH =3D > ENV(GCC5_LOONGARCH64_PREFIX)gcc >=20 > +*_GCC5_LOONGARCH64_SLINK_PATH =3D > ENV(GCC5_LOONGARCH64_PREFIX)gcc-ar >=20 > +*_GCC5_LOONGARCH64_DLINK_PATH =3D > ENV(GCC5_LOONGARCH64_PREFIX)gcc >=20 > +*_GCC5_LOONGARCH64_ASLDLINK_PATH =3D > ENV(GCC5_LOONGARCH64_PREFIX)gcc >=20 > +*_GCC5_LOONGARCH64_ASM_PATH =3D > ENV(GCC5_LOONGARCH64_PREFIX)gcc >=20 > +*_GCC5_LOONGARCH64_PP_PATH =3D > ENV(GCC5_LOONGARCH64_PREFIX)gcc >=20 > +*_GCC5_LOONGARCH64_VFRPP_PATH =3D > ENV(GCC5_LOONGARCH64_PREFIX)gcc >=20 > +*_GCC5_LOONGARCH64_ASLCC_PATH =3D > ENV(GCC5_LOONGARCH64_PREFIX)gcc >=20 > +*_GCC5_LOONGARCH64_ASLPP_PATH =3D > ENV(GCC5_LOONGARCH64_PREFIX)gcc >=20 > +*_GCC5_LOONGARCH64_RC_PATH =3D > ENV(GCC5_LOONGARCH64_PREFIX)objcopy >=20 > + >=20 > +*_GCC5_LOONGARCH64_ASLCC_FLAGS =3D > DEF(GCC_ASLCC_FLAGS) >=20 > +*_GCC5_LOONGARCH64_ASLDLINK_FLAGS =3D > DEF(GCC5_LOONGARCH64_ASLDLINK_FLAGS) >=20 > +*_GCC5_LOONGARCH64_ASM_FLAGS =3D > DEF(GCC5_LOONGARCH64_ASM_FLAGS) >=20 > +*_GCC5_LOONGARCH64_DLINK_FLAGS =3D > DEF(GCC5_LOONGARCH64_DLINK_FLAGS) >=20 > +*_GCC5_LOONGARCH64_DLINK2_FLAGS =3D > DEF(GCC5_LOONGARCH64_DLINK2_FLAGS) >=20 > +*_GCC5_LOONGARCH64_RC_FLAGS =3D > DEF(GCC_LOONGARCH64_RC_FLAGS) >=20 > +*_GCC5_LOONGARCH64_OBJCOPY_FLAGS =3D >=20 > +*_GCC5_LOONGARCH64_NASM_FLAGS =3D -f elf32 >=20 > +*_GCC5_LOONGARCH64_PP_FLAGS =3D > DEF(GCC5_LOONGARCH64_PP_FLAGS) >=20 > + >=20 > +DEBUG_GCC5_LOONGARCH64_CC_FLAGS =3D > DEF(GCC5_LOONGARCH64_CC_FLAGS) >=20 > +RELEASE_GCC5_LOONGARCH64_CC_FLAGS =3D > DEF(GCC5_LOONGARCH64_CC_FLAGS) -Wno-unused-but-set-variable > -Wno-unused-variable >=20 > + >=20 >=20 > ############################################################## > ###################### >=20 > # >=20 > # CLANG35 - This configuration is used to compile under Linux to produce >=20 > -- > 2.27.0