--- /dev/null
+## @file\r
+# Download GCC LoongArch64 compiler from LoongArch GitHub release site\r
+# Set shell variable GCC5_LOONGARCH64_INSTALL to this folder\r
+#\r
+# This is only downloaded when a build activates scope gcc_loongarch64_unknown_linux\r
+#\r
+# Copyright (c) Microsoft Corporation.\r
+# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
+##\r
+{\r
+ "scope": "gcc_loongarch64_unknown_linux",\r
+ "type": "web",\r
+ "name": "gcc_loongarch64_unknown_linux",\r
+ "source":"https://github.com/loongson/build-tools/releases/download/2022.09.06/loongarch64-clfs-6.3-cross-tools-gcc-full.tar.xz",\r
+ "version": "13.0.0",\r
+ "sha256":"27a43c5bb127794f091d0e75da0003c4d0eec28a958d8f2cc7cd290a6e6133ab",\r
+ "compression_type": "tar",\r
+ "internal_path": "/cross-tools/",\r
+ "flags": ["set_shell_var", ],\r
+ "var_name": "GCC5_LOONGARCH64_INSTALL"\r
+}\r
#\r
# Copyright (c) Microsoft Corporation\r
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>\r
+# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>\r
# SPDX-License-Identifier: BSD-2-Clause-Patent\r
##\r
import os\r
self.Logger.critical("Failed in check riscv64")\r
return ret\r
\r
+ # Check LoongArch64 compiler\r
+ ret = self._check_loongarch64()\r
+ if ret != 0:\r
+ self.Logger.critical("Failed in check loongarch64")\r
+ return ret\r
+\r
return 0\r
\r
def _check_arm(self):\r
shell_environment.GetEnvironment().set_shell_var("LD_LIBRARY_PATH", prefix)\r
\r
return 0\r
+\r
+ def _check_loongarch64(self):\r
+ # check to see if full path already configured\r
+ if shell_environment.GetEnvironment().get_shell_var("GCC5_LOONGARCH64_PREFIX") is not None:\r
+ self.Logger.info("GCC5_LOONGARCH64_PREFIX is already set.")\r
+\r
+ else:\r
+ # now check for install dir. If set then set the Prefix\r
+ install_path = shell_environment.GetEnvironment(\r
+ ).get_shell_var("GCC5_LOONGARCH64_INSTALL")\r
+ if install_path is None:\r
+ return 0\r
+\r
+ # make GCC5_LOONGARCH64_PREFIX to align with tools_def.txt\r
+ prefix = os.path.join(install_path, "bin", "loongarch64-unknown-linux-gnu-")\r
+ shell_environment.GetEnvironment().set_shell_var("GCC5_LOONGARCH64_PREFIX", prefix)\r
+\r
+ # now confirm it exists\r
+ if not os.path.exists(shell_environment.GetEnvironment().get_shell_var("GCC5_LOONGARCH64_PREFIX") + "gcc"):\r
+ self.Logger.error(\r
+ "Path for GCC5_LOONGARCH64_PREFIX toolchain is invalid")\r
+ return -2\r
+\r
+ return 0\r