From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web10.53957.1583749810199793873 for ; Mon, 09 Mar 2020 03:30:10 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=033792669b=abner.chang@hpe.com) Received: from pps.filterd (m0150242.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 029AN0qp015172; Mon, 9 Mar 2020 10:30:10 GMT Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0a-002e3701.pphosted.com with ESMTP id 2ynhh51anf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Mar 2020 10:30:09 +0000 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id 5784DA1; Mon, 9 Mar 2020 10:30:09 +0000 (UTC) Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id A214F36; Mon, 9 Mar 2020 10:30:06 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Bret Barkelew , Sean Brogan , Bob Feng , Leif Lindholm , Michael D Kinney , Liming Gao , Gilbert Chen , Daniel Helmut Schaefer Subject: [edk2/master PATCH RISC-V CI v2 3/5] BaseTools: Enable RISC-V architecture for RISC-V EDK2 CI. Date: Mon, 9 Mar 2020 17:53:16 +0800 Message-Id: <20200309095318.7331-4-abner.chang@hpe.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200309095318.7331-1-abner.chang@hpe.com> References: <20200309095318.7331-1-abner.chang@hpe.com> X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-03-09_02:2020-03-08,2020-03-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 mlxlogscore=999 impostorscore=0 phishscore=0 mlxscore=0 priorityscore=1501 bulkscore=0 spamscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003090074 Content-Transfer-Encoding: quoted-printable BZ:2562: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2562 EDK CI for RISC-V architecture Enable RISC-V architecture for RISC-V EDK2 CI testing. Signed-off-by: Abner Chang Cc: Bret Barkelew Cc: Sean Brogan Cc: Bob Feng Cc: Leif Lindholm Cc: Michael D Kinney Cc: Liming Gao Cc: Gilbert Chen Cc: Daniel Helmut Schaefer Signed-off-by: Abner Chang --- .../Bin/gcc_riscv64_unknown_ext_dep.yaml | 22 +++++++++++++ .../LinuxGcc5ToolChain/LinuxGcc5ToolChain.py | 31 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 BaseTools/Bin/gcc_riscv64_unknown_ext_dep.yaml diff --git a/BaseTools/Bin/gcc_riscv64_unknown_ext_dep.yaml b/BaseTools/Bin= /gcc_riscv64_unknown_ext_dep.yaml new file mode 100644 index 0000000000..a3ec2d9bdb --- /dev/null +++ b/BaseTools/Bin/gcc_riscv64_unknown_ext_dep.yaml @@ -0,0 +1,22 @@ +## @file=0D +# Download GCC RISCV64 compiler from RISC-V Organization release site=0D +# Set shell variable GCC5_RISCV64_INSTALL to this folder=0D +#=0D +# This is only downloaded when a build activates scope gcc_riscv64_unknown= =0D +#=0D +# Copyright (c) Microsoft Corporation.=0D +# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All right= s reserved.
=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +##=0D +{=0D + "scope": "gcc_riscv64_unknown",=0D + "type": "web",=0D + "name": "gcc_riscv64_unknown",=0D + "source": "https://media.githubusercontent.com/media/riscv/riscv-uefi-ed= k2-docs/master/gcc-riscv-edk2-ci-toolchain/gcc-riscv-9.2.0-2020.02-x86_64_r= iscv64-unknown-gnu.tar.xz",=0D + "version": "9.2.0",=0D + "compression_type": "tar",=0D + "sha256": "63d10b24bf31992841ff3c1b675cec6464dff2cfa97b241c572d7681f6259= 88a",=0D + "internal_path": "/gcc-riscv-9.2.0-2020.02-x86_64_riscv64-unknown-gnu",= =0D + "flags": ["set_shell_var", ],=0D + "var_name": "GCC5_RISCV64_INSTALL"=0D +}=0D diff --git a/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py b/Ba= seTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py index c31641e931..502d2c21d2 100644 --- a/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py +++ b/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py @@ -4,6 +4,7 @@ # This plugin works in conjuncture with the tools_def=0D #=0D # Copyright (c) Microsoft Corporation=0D +# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All right= s reserved.
=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D ##=0D import os=0D @@ -36,6 +37,12 @@ class LinuxGcc5ToolChain(IUefiBuildPlugin): self.Logger.critical("Failed in check arm")=0D return ret=0D =0D + # Check RISCV64 compiler=0D + ret =3D self._check_riscv64()=0D + if ret !=3D 0:=0D + self.Logger.critical("Failed in check riscv64")=0D + return ret=0D +=0D return 0=0D =0D def _check_arm(self):=0D @@ -83,3 +90,27 @@ class LinuxGcc5ToolChain(IUefiBuildPlugin): return -2=0D =0D return 0=0D +=0D + def _check_riscv64(self):=0D + # check to see if full path already configured=0D + if shell_environment.GetEnvironment().get_shell_var("GCC5_RISCV64_= PREFIX") is not None:=0D + self.Logger.info("GCC5_RISCV64_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_RISCV64_INSTALL")=0D + if install_path is None:=0D + return 0=0D +=0D + # make GCC5_RISCV64_PREFIX to align with tools_def.txt=0D + prefix =3D os.path.join(install_path, "bin", "riscv64-unknown-= elf-")=0D + shell_environment.GetEnvironment().set_shell_var("GCC5_RISCV64= _PREFIX", prefix)=0D +=0D + # now confirm it exists=0D + if not os.path.exists(shell_environment.GetEnvironment().get_shell= _var("GCC5_RISCV64_PREFIX") + "gcc"):=0D + self.Logger.error(=0D + "Path for GCC5_RISCV64_PREFIX toolchain is invalid")=0D + return -2=0D +=0D + return 0=0D --=20 2.25.0