--- /dev/null
+## @file\r
+# Download GCC RISCV64 compiler from RISC-V Organization release site\r
+# Set shell variable GCC5_RISCV64_INSTALL to this folder\r
+#\r
+# This is only downloaded when a build activates scope gcc_riscv64_unknown\r
+#\r
+# Copyright (c) Microsoft Corporation.\r
+# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
+##\r
+{\r
+ "scope": "gcc_riscv64_unknown",\r
+ "type": "web",\r
+ "name": "gcc_riscv64_unknown",\r
+ "source": "https://raw.githubusercontent.com/riscv/riscv-uefi-edk2-docs/master/gcc-riscv-edk2-ci-toolchain/gcc-riscv-9.2.0-2020.04-x86_64_riscv64-unknown-gnu.tar.xz",\r
+ "version": "9.2.0",\r
+ "compression_type": "tar",\r
+ "sha256": "28373643b69f0ce008273c3dc63f172aa1121952f1b9ae94d7485ac94af7f344",\r
+ "internal_path": "/gcc-riscv-9.2.0-2020.04-x86_64_riscv64-unknown-gnu",\r
+ "flags": ["set_shell_var", ],\r
+ "var_name": "GCC5_RISCV64_INSTALL"\r
+}\r
# This plugin works in conjuncture with the tools_def\r
#\r
# Copyright (c) Microsoft Corporation\r
+# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>\r
# SPDX-License-Identifier: BSD-2-Clause-Patent\r
##\r
import os\r
self.Logger.critical("Failed in check arm")\r
return ret\r
\r
+ # Check RISCV64 compiler\r
+ ret = self._check_riscv64()\r
+ if ret != 0:\r
+ self.Logger.critical("Failed in check riscv64")\r
+ return ret\r
+\r
return 0\r
\r
def _check_arm(self):\r
return -2\r
\r
return 0\r
+\r
+ def _check_riscv64(self):\r
+ # now check for install dir. If set then set the Prefix\r
+ install_path = shell_environment.GetEnvironment(\r
+ ).get_shell_var("GCC5_RISCV64_INSTALL")\r
+ if install_path is None:\r
+ return 0\r
+\r
+ # check to see if full path already configured\r
+ if shell_environment.GetEnvironment().get_shell_var("GCC5_RISCV64_PREFIX") is not None:\r
+ self.Logger.info("GCC5_RISCV64_PREFIX is already set.")\r
+\r
+ else:\r
+ # make GCC5_RISCV64_PREFIX to align with tools_def.txt\r
+ prefix = os.path.join(install_path, "bin", "riscv64-unknown-elf-")\r
+ shell_environment.GetEnvironment().set_shell_var("GCC5_RISCV64_PREFIX", prefix)\r
+\r
+ # now confirm it exists\r
+ if not os.path.exists(shell_environment.GetEnvironment().get_shell_var("GCC5_RISCV64_PREFIX") + "gcc"):\r
+ self.Logger.error(\r
+ "Path for GCC5_RISCV64_PREFIX toolchain is invalid")\r
+ return -2\r
+\r
+ # Check if LD_LIBRARY_PATH is set for the libraries of RISC-V GCC toolchain\r
+ if shell_environment.GetEnvironment().get_shell_var("LD_LIBRARY_PATH") is not None:\r
+ self.Logger.info("LD_LIBRARY_PATH is already set.")\r
+\r
+ prefix = os.path.join(install_path, "lib")\r
+ shell_environment.GetEnvironment().set_shell_var("LD_LIBRARY_PATH", prefix)\r
+\r
+ return 0\r