From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from loongson.cn (loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web12.4300.1663148445409483722 for ; Wed, 14 Sep 2022 02:40:47 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: loongson.cn, ip: 114.242.206.163, mailfrom: lichao@loongson.cn) Received: from code-server.gen (unknown [10.2.9.245]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxbWuaoSFjAwEZAA--.50319S2; Wed, 14 Sep 2022 17:40:42 +0800 (CST) From: "Chao Li" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen Subject: [PATCH v2 18/34] BaseTools: Enable LoongArch64 architecture for LoongArch64 EDK2 CI. Date: Wed, 14 Sep 2022 17:40:42 +0800 Message-Id: <20220914094042.3696422-1-lichao@loongson.cn> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8CxbWuaoSFjAwEZAA--.50319S2 X-Coremail-Antispam: 1UD129KBjvJXoWxXF1fZr1kXFyxJryfKw4rZrb_yoWrWF4Upw n7Zwn5GF42qrn7ur93Ka47ur9YvrWkCry7tFWfur4rCrWDZw10gr47try7tFy3A34F9ana 9wsYgw12gF18GaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkYb7Iv0xC_Zr1lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIE14v26F4UJVW0owA2z4x0Y4 vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xv F2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jw0_WrylYx0Ex4A2jsIE14v26r1j6r 4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY02Avz4vE-syl42xK82IY c2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s 026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF 0xvE2Ix0cI8IcVAFwI0_Gr0_Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwCI42 IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280 aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU8Gjg7UUUUU== X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQAJCGMgctwUuAAnsm Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4053 EDK CI for LoongArch64 architecture Enable LoongArch64 architecture for LoongArch64 EDK2 CI testing. Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Chao Li --- ...gcc_loongarch64_unknown_linux_ext_dep.yaml | 22 +++++++++++++ .../LinuxGcc5ToolChain/LinuxGcc5ToolChain.py | 31 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 BaseTools/Bin/gcc_loongarch64_unknown_linux_ext_dep.yaml diff --git a/BaseTools/Bin/gcc_loongarch64_unknown_linux_ext_dep.yaml b/Bas= eTools/Bin/gcc_loongarch64_unknown_linux_ext_dep.yaml new file mode 100644 index 0000000000..ac18438080 --- /dev/null +++ b/BaseTools/Bin/gcc_loongarch64_unknown_linux_ext_dep.yaml @@ -0,0 +1,22 @@ +## @file +# Download GCC LoongArch64 compiler from LoongArch GitHub release site +# Set shell variable GCC5_LOONGARCH64_INSTALL to this folder +# +# This is only downloaded when a build activates scope gcc_loongarch64_unk= nown_linux +# +# Copyright (c) Microsoft Corporation. +# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights = reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## +{ + "scope": "gcc_loongarch64_unknown_linux", + "type": "web", + "name": "gcc_loongarch64_unknown_linux", + "source":"https://github.com/loongson/build-tools/releases/download/2022= .09.06/loongarch64-clfs-6.3-cross-tools-gcc-full.tar.xz", + "version": "13.0.0", + "sha256":"27a43c5bb127794f091d0e75da0003c4d0eec28a958d8f2cc7cd290a6e6133= ab", + "compression_type": "tar", + "internal_path": "/cross-tools/", + "flags": ["set_shell_var", ], + "var_name": "GCC5_LOONGARCH64_INSTALL" +} diff --git a/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py b/Ba= seTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py index f0685d8040..dab7a87997 100644 --- a/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py +++ b/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py @@ -5,6 +5,7 @@ #=0D # Copyright (c) Microsoft Corporation=0D # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All right= s reserved.
=0D +# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights = reserved.
=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D ##=0D import os=0D @@ -43,6 +44,12 @@ class LinuxGcc5ToolChain(IUefiBuildPlugin): self.Logger.critical("Failed in check riscv64")=0D return ret=0D =0D + # Check LoongArch64 compiler=0D + ret =3D self._check_loongarch64()=0D + if ret !=3D 0:=0D + self.Logger.critical("Failed in check loongarch64")=0D + return ret=0D +=0D return 0=0D =0D def _check_arm(self):=0D @@ -121,3 +128,27 @@ class LinuxGcc5ToolChain(IUefiBuildPlugin): shell_environment.GetEnvironment().set_shell_var("LD_LIBRARY_PATH"= , prefix)=0D =0D return 0=0D +=0D + def _check_loongarch64(self):=0D + # check to see if full path already configured=0D + if shell_environment.GetEnvironment().get_shell_var("GCC5_LOONGARC= H64_PREFIX") is not None:=0D + self.Logger.info("GCC5_LOONGARCH64_PREFIX is already set.")=0D +=0D + else:=0D + # now check for install dir. If set then set the Prefix=0D + install_path =3D shell_environment.GetEnvironment(=0D + ).get_shell_var("GCC5_LOONGARCH64_INSTALL")=0D + if install_path is None:=0D + return 0=0D +=0D + # make GCC5_LOONGARCH64_PREFIX to align with tools_def.txt=0D + prefix =3D os.path.join(install_path, "bin", "loongarch64-unkn= own-linux-gnu-")=0D + shell_environment.GetEnvironment().set_shell_var("GCC5_LOONGAR= CH64_PREFIX", prefix)=0D +=0D + # now confirm it exists=0D + if not os.path.exists(shell_environment.GetEnvironment().get_shell= _var("GCC5_LOONGARCH64_PREFIX") + "gcc"):=0D + self.Logger.error(=0D + "Path for GCC5_LOONGARCH64_PREFIX toolchain is invalid")=0D + return -2=0D +=0D + return 0=0D --=20 2.27.0