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.web09.10488.1582952380854486573 for ; Fri, 28 Feb 2020 20:59:40 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0328563951=abner.chang@hpe.com) Received: from pps.filterd (m0148663.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01T4raCx021028; Sat, 29 Feb 2020 04:59:40 GMT Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0a-002e3701.pphosted.com with ESMTP id 2yfg5mr9n6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 29 Feb 2020 04:59:40 +0000 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id AAAC562; Sat, 29 Feb 2020 04:59:39 +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 DE64336; Sat, 29 Feb 2020 04:59:36 +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-staging/RISC-V-V2: CI Config PATCH v1 4/6] BaseTools: Enable RISC-V architecture for RISC-V EDK2 CI. Date: Sat, 29 Feb 2020 12:23:03 +0800 Message-Id: <20200229042305.1794-5-abner.chang@hpe.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200229042305.1794-1-abner.chang@hpe.com> References: <20200229042305.1794-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-02-28_09:2020-02-28,2020-02-28 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 adultscore=0 mlxlogscore=999 clxscore=1015 mlxscore=0 suspectscore=6 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002290034 Content-Transfer-Encoding: quoted-printable BZ:2562 - 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 | 21 +++++++++++++ .../LinuxGcc5ToolChain/LinuxGcc5ToolChain.py | 31 +++++++++++++++++++ 2 files changed, 52 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..9e989392f0 --- /dev/null +++ b/BaseTools/Bin/gcc_riscv64_unknown_ext_dep.yaml @@ -0,0 +1,21 @@ +## @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": "file:///home/abner/gcc-riscv-9.2.0-2020.02-x86_64_riscv64-unk= nown-gnu.tar.xz",=0D + "version": "9.2.0",=0D + "compression_type": "tar",=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