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.web12.1827.1587436720336548914 for ; Mon, 20 Apr 2020 19:38:40 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0380a9ba4c=abner.chang@hpe.com) Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03L2ce1M026764; Tue, 21 Apr 2020 02:38:40 GMT Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) by mx0b-002e3701.pphosted.com with ESMTP id 30gbcfd3wa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Apr 2020 02:38:40 +0000 Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3425.houston.hpe.com (Postfix) with ESMTP id 3D3EEB8; Tue, 21 Apr 2020 02:38:39 +0000 (UTC) Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id A2A2B4E; Tue, 21 Apr 2020 02:38:37 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Gilbert Chen , Daniel Helmut Schaefer , Leif Lindholm , Bob Feng , Liming Gao Subject: [PATCH v3 3/3] BaseTools: BaseTools changes for RISC-V platform. Date: Tue, 21 Apr 2020 10:00:17 +0800 Message-Id: <20200421020017.16072-4-abner.chang@hpe.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200421020017.16072-1-abner.chang@hpe.com> References: <20200421020017.16072-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.676 definitions=2020-04-20_09:2020-04-20,2020-04-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 mlxlogscore=752 clxscore=1015 mlxscore=0 suspectscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 spamscore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004210018 Content-Transfer-Encoding: quoted-printable Tools definitions template file changes for building EDK2 RISC-V platform. Signed-off-by: Abner Chang Co-authored-by: Gilbert Chen Co-authored-by: Daniel Helmut Schaefer Reviewed-by: Leif Lindholm Cc: Bob Feng Cc: Liming Gao Cc: Leif Lindholm Cc: Gilbert Chen --- BaseTools/Conf/tools_def.template | 53 +++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.t= emplate index 88d7ab8cab..be09a2a8f7 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -3,7 +3,7 @@ # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
= =0D # Portions copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.
=0D # Copyright (c) 2015, Hewlett-Packard Development Company, L.P.
=0D -# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
=0D +# (C) Copyright 2020, Hewlett Packard Enterprise Development LP
=0D # Copyright (c) Microsoft Corporation=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D @@ -267,11 +267,12 @@ DEFINE DTC_BIN =3D ENV(DTC_PREFIX)dtc # Intel(r) ACPI Compiler from=0D # https://acpica.org/downloads=0D # GCC5 -Linux,Windows- Requires:=0D -# GCC 5 with LTO support, targeting x86_64-lin= ux-gnu, aarch64-linux-gnu, or arm-linux-gnueabi=0D +# GCC 5 with LTO support, targeting x86_64-lin= ux-gnu, aarch64-linux-gnu, arm-linux-gnueabi or riscv64-linux-gnu=0D # Optional:=0D # Required to build platforms or ACPI tables:= =0D # Intel(r) ACPI Compiler from=0D # https://acpica.org/downloads=0D +#=0D # CLANG35 -Linux,Windows- Requires:=0D # Clang v3.5 or later, and GNU binutils target= ing aarch64-linux-gnu or arm-linux-gnueabi=0D # Optional:=0D @@ -1946,6 +1947,7 @@ DEFINE GCC_IA32_RC_FLAGS =3D -I binary -O e= lf32-i386 -B i386 DEFINE GCC_X64_RC_FLAGS =3D -I binary -O elf64-x86-64 -B= i386 --rename-section .data=3D.hii=0D DEFINE GCC_ARM_RC_FLAGS =3D -I binary -O elf32-littlearm -B= arm --rename-section .data=3D.hii=0D DEFINE GCC_AARCH64_RC_FLAGS =3D -I binary -O elf64-littleaarch64 -B= aarch64 --rename-section .data=3D.hii=0D +DEFINE GCC_RISCV64_RC_FLAGS =3D -I binary -O elf64-littleriscv -B= riscv --rename-section .data=3D.hii=0D =0D # GCC Build Flag for included header file list generation=0D DEFINE GCC_DEPS_FLAGS =3D -MMD -MF $@.deps=0D @@ -2020,6 +2022,22 @@ DEFINE GCC5_ARM_ASLDLINK_FLAGS =3D DEF(GCC49_A= RM_ASLDLINK_FLAGS) DEFINE GCC5_AARCH64_ASLDLINK_FLAGS =3D DEF(GCC49_AARCH64_ASLDLINK_FLAGS)= =0D DEFINE GCC5_ASLCC_FLAGS =3D DEF(GCC49_ASLCC_FLAGS) -fno-lto=0D =0D +DEFINE GCC5_RISCV_ALL_CC_FLAGS =3D -g -fshort-wchar -fn= o-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdat= a-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=3D$(BASE_NAME= )Strings -msmall-data-limit=3D0=0D +DEFINE GCC5_RISCV_ALL_DLINK_COMMON =3D -nostdlib -Wl,-n,-q,= --gc-sections -z common-page-size=3D0x40=0D +DEFINE GCC5_RISCV_ALL_DLINK_FLAGS =3D DEF(GCC5_RISCV_ALL_D= LINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-= Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map=0D +DEFINE GCC5_RISCV_ALL_DLINK2_FLAGS =3D -Wl,--defsym=3DPECOF= F_HEADER_SIZE=3D0x220,--script=3D$(EDK_TOOLS_PATH)/Scripts/GccBase.lds=0D +DEFINE GCC5_RISCV_ALL_ASM_FLAGS =3D -c -x assembler -ima= cros $(DEST_DIR_DEBUG)/AutoGen.h=0D +DEFINE GCC5_RISCV_ALL_CC_FLAGS_WARNING_DISABLE =3D -Wno-tautological-co= mpare -Wno-pointer-compare=0D +=0D +DEFINE GCC5_RISCV_OPENSBI_TYPES =3D -DOPENSBI_EXTERNAL_S= BI_TYPES=3DOpensbiTypes.h=0D +=0D +DEFINE GCC5_RISCV64_ARCH =3D rv64imafdc=0D +DEFINE GCC5_RISCV32_RISCV64_ASLDLINK_FLAGS =3D DEF(GCC5_RISCV_ALL_DLINK_CO= MMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable=0D +DEFINE GCC5_RISCV64_CC_FLAGS =3D DEF(GCC5_RISCV_ALL_CC_FLAGS= ) DEF(GCC5_RISCV_ALL_CC_FLAGS_WARNING_DISABLE) DEF(GCC5_RISCV_OPENSBI_TYPES= ) -march=3DDEF(GCC5_RISCV64_ARCH) -fno-builtin -fno-builtin-memcpy -fno-sta= ck-protector -Wno-address -fno-asynchronous-unwind-tables -Wno-unused-but-s= et-variable -fpack-struct=3D8 -mcmodel=3Dmedany -mabi=3Dlp64 -mno-relax=0D +DEFINE GCC5_RISCV64_DLINK_FLAGS =3D DEF(GCC5_RISCV_ALL_DLINK_FL= AGS) -Wl,-melf64lriscv,--oformat=3Delf64-littleriscv,--no-relax=0D +DEFINE GCC5_RISCV64_DLINK2_FLAGS =3D DEF(GCC5_RISCV_ALL_DLINK2_F= LAGS)=0D +DEFINE GCC5_ASM_FLAGS =3D DEF(GCC5_RISCV_ALL_ASM_FLAG= S) -march=3DDEF(GCC5_RISCV64_ARCH) -mcmodel=3Dmedany -mabi=3Dlp64=0D +=0D ##########################################################################= ##########=0D #=0D # GCC 4.8 - This configuration is used to compile under Linux to produce=0D @@ -2464,6 +2482,37 @@ RELEASE_GCC5_AARCH64_DLINK_XIPFLAGS =3D -z common-pa= ge-size=3D0x20 NOOPT_GCC5_AARCH64_DLINK_FLAGS =3D DEF(GCC5_AARCH64_DLINK_FLAGS) -O0=0D NOOPT_GCC5_AARCH64_DLINK_XIPFLAGS =3D -z common-page-size=3D0x20 -O0=0D =0D +##########################################################################= ##########=0D +#=0D +# GCC RISC-V This configuration is used to compile under Linux to produce= =0D +# PE/COFF binaries using GCC RISC-V tool chain=0D +#=0D +##########################################################################= ##########=0D +=0D +##################=0D +# GCC5 RISCV64 definitions=0D +##################=0D +*_GCC5_RISCV64_OBJCOPY_PATH =3D ENV(GCC5_RISCV64_PREFIX)objcopy=0D +*_GCC5_RISCV64_CC_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc=0D +*_GCC5_RISCV64_SLINK_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc-ar=0D +*_GCC5_RISCV64_DLINK_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc=0D +*_GCC5_RISCV64_ASLDLINK_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc=0D +*_GCC5_RISCV64_ASM_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc=0D +*_GCC5_RISCV64_PP_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc=0D +*_GCC5_RISCV64_VFRPP_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc=0D +*_GCC5_RISCV64_ASLCC_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc=0D +*_GCC5_RISCV64_ASLPP_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc=0D +*_GCC5_RISCV64_RC_PATH =3D ENV(GCC5_RISCV64_PREFIX)objcopy=0D +=0D +*_GCC5_RISCV64_ASLCC_FLAGS =3D DEF(GCC_ASLCC_FLAGS)=0D +*_GCC5_RISCV64_ASLDLINK_FLAGS =3D DEF(GCC5_RISCV32_RISCV64_ASLDLINK_= FLAGS)=0D +*_GCC5_RISCV64_ASM_FLAGS =3D DEF(GCC5_ASM_FLAGS)=0D +*_GCC5_RISCV64_CC_FLAGS =3D DEF(GCC5_RISCV64_CC_FLAGS) -save-t= emps=0D +*_GCC5_RISCV64_DLINK_FLAGS =3D DEF(GCC5_RISCV64_DLINK_FLAGS)=0D +*_GCC5_RISCV64_DLINK2_FLAGS =3D DEF(GCC5_RISCV64_DLINK2_FLAGS)=0D +*_GCC5_RISCV64_RC_FLAGS =3D DEF(GCC_RISCV64_RC_FLAGS)=0D +*_GCC5_RISCV64_OBJCOPY_FLAGS =3D=0D +=0D ##########################################################################= ##########=0D #=0D # CLANG35 - This configuration is used to compile under Linux to produce= =0D --=20 2.25.0