From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.2371.1587720247028674094 for ; Fri, 24 Apr 2020 02:24:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=UTN3Y8MX; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: bob.c.feng@intel.com) IronPort-SDR: gIY90s7wpUQJeVexhWB9YxdPZIhCypVmMCGaGVrmjrw9nj1hepSAJ7VuTZ6y61TYr1sXP0oH9+ iL6zySGYrRQg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2020 02:24:06 -0700 IronPort-SDR: utpa5BpMzm8u4TryaKZIQ4t2J6QoGKX7EJWrjNq8GSHZxYnFcHQkw1ojdmYrsRW7ZtOVEtip5x cQXavL6m7tig== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,311,1583222400"; d="scan'208";a="403242037" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 24 Apr 2020 02:24:06 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 24 Apr 2020 02:24:00 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.103) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 24 Apr 2020 02:24:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fbfjdVLb1+TOQHRJkd42yF6y15XLy/lgTbVuA9fNFxyMy2wXBhdEByLM7YZ5mdwJc9om+Jo83E/A1K1IysRQEbbkcGWF7KFCu64KqmBw82nQdnUVo3BYWN/uzh6rVC8bmL9MkwJG9IgO/pjMm88enxMSbx3MPyQE/8RHMSt9lU16nb6sPohQXcaevt803HeIHVgFOzqBOGOSako2LbXidU9eRmLhG+BBTJPeVvcAV01zAZIcpvS2WkdkN8+615QyBhO/pvp6DZ6wfgAJ1GJIoPVPnHcE6XLwLSkj7+2rTrttsX72vNNQyenwwRP6PwwwiThgpBeq4EPk+kgoWzZ8jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=smKrSho6lRoGdPyFrNjl9jHEaJyqCm57h24rr/DTMJk=; b=NZKxwx+7wNnvWOtzN2eVvHSJfk9G3+Ng5cfx4YuymaBzBoYHyoeo1rbR6Y59rOssv3Pl4jGGqfJywctHPVymhQLx4yCrmQRltp3ioFotp9EuKpbLA1fn/+NoKaiKo9o1VCsG2ZdVkUL5H2CqTe5VEi3sA5XE1Br36zTz2e+yES3Hhj8yuL3o1cc1uMi7bWoY6o95n0RvK/fIDwP/H2AMlcKeccUITqj2ZX4hKQN8L8vSIPqN9/9NOAVG5Fytr3lf/Z/gMdKyyRecbwYHW6v6gTobKv+HMGnS+aN9Q6S9YwORNHC6qSSDrBdef9KNRorzhAbhpaFo1EJgEVqE2JCXvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=smKrSho6lRoGdPyFrNjl9jHEaJyqCm57h24rr/DTMJk=; b=UTN3Y8MXUYfl+n97+1ygUOI4OpjY66i7AulDOXl0j0ZOVbe0+YUIWsWXEPaiTGaXxYdfZ34qlLL2cI/q5SMDmp+F/fhoIvta4dvjS23qha6iisKXMRfunD3mZDrF6ndKOgM75JyhQv7UhCKKnFej38tM71oOok4iyyMKge68EoQ= Received: from BN6PR11MB0068.namprd11.prod.outlook.com (2603:10b6:405:69::17) by BN6PR11MB1393.namprd11.prod.outlook.com (2603:10b6:404:3c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Fri, 24 Apr 2020 09:23:57 +0000 Received: from BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::2d53:d47c:1269:d601]) by BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::2d53:d47c:1269:d601%6]) with mapi id 15.20.2937.020; Fri, 24 Apr 2020 09:23:57 +0000 From: "Bob Feng" To: Abner Chang , "devel@edk2.groups.io" CC: Gilbert Chen , Daniel Helmut Schaefer , Leif Lindholm , "Gao, Liming" Subject: Re: [PATCH v4 3/3] BaseTools: BaseTools changes for RISC-V platform. Thread-Topic: [PATCH v4 3/3] BaseTools: BaseTools changes for RISC-V platform. Thread-Index: AQHWGXvrqfBjChfpnk+LndHQaDzARKiH/7Ww Date: Fri, 24 Apr 2020 09:23:56 +0000 Message-ID: References: <20200423135233.7342-1-abner.chang@hpe.com> <20200423135233.7342-4-abner.chang@hpe.com> In-Reply-To: <20200423135233.7342-4-abner.chang@hpe.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=bob.c.feng@intel.com; x-originating-ip: [192.102.204.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ede6e235-61ec-492e-5846-08d7e8313714 x-ms-traffictypediagnostic: BN6PR11MB1393: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 03838E948C x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR11MB0068.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(366004)(136003)(396003)(346002)(376002)(39860400002)(45080400002)(66556008)(86362001)(107886003)(9686003)(55016002)(33656002)(4326008)(66946007)(66446008)(66476007)(76116006)(64756008)(26005)(966005)(186003)(54906003)(316002)(81156014)(52536014)(7696005)(110136005)(296002)(53546011)(8936002)(5660300002)(478600001)(6506007)(2906002)(8676002)(71200400001);DIR:OUT;SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JTRhhPo72MaetE5KT0P+EhmD8c8VBZC6JjmIBcDWDyhYHSYtzQqlNw0wgyfxF4IAfBH/jhkfqf10XNy3CUazGytQS5yfSk0wY7ySsgkZ/KYHixSK+RYUU8Jym+KgdR5WOQdsgbPXPuAcrjXtCn2M/qzQZsYn6uTqTmJvNCBENILLeDGExZSlngITTf5ja9BxE88fJ/Oi72/gokUa1ZpjjOmkuhU51n70HNesF5xSzUD3IkxCx5WQlLbebmOc62zH3JOIpz49PJZKyMJUze03M6j7qs8T78dvC2mtGs1UhvNvLi22Bi+KTdUO4BrZS8AHvFbnomNloQM4l6v6lJRYkb00Qi4110x+2A/7tdMA/S9zG34u4xHhFxjKFF2lsVdXTtxn+oxzJ57frfjORHMl+qWRiRBmUx09GRTd0hZH+9K06bv42++UxKAUYqlK1AHH2Hh4hk3H+DtxMpHlDKQMbSg2HV7JJBZiDJmkUFGFZQ3fN0PR0Wb6/qXysHUwKMziv0CqzMB7EnNIWMwhaRW7gQ== x-ms-exchange-antispam-messagedata: iGbPpASzluci/h0oN6JD4wcJwR3/v+7kDXfxnJAdD5AeD0a7GAELHuWDkr/X1hVlCP02b7um8txxDjWw/T0eNEbFTuTO0EqNKFWC7HcKKkTuoFX7/ZFsdpNM153vCXpcw4mbI8PgxMN4NJ/eEOLnDg== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ede6e235-61ec-492e-5846-08d7e8313714 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Apr 2020 09:23:56.9557 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: iGwlri5A2q4ZZ3aaR4q+FdkzlmKmtY3PSGZ6cY0uRt8wuo7LVwMtmBCCfXUfwwj9TqgF1eQFOgwFEvFbc1mgoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1393 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Abner, I found the BaseTools build failure with GCC5 and this patch break Intel in= ternal CI. Would you please have a check? make[1]: Entering directory '/opt/TCAgent/work/184220821286c462/Edk2/BaseTo= ols/Source/C/Common' gcc -c -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustrySt= andard -I ../Common/ -I .. -I . -I ../Include/X64/ -MD -fshort-wchar -fno-s= trict-aliasing -fwrapv -fno-delete-null-pointer-checks -Wall -Werror -Wno-d= eprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-r= esult -nostdlib -g -O2 BasePeCoff.c -o BasePeCoff.o In file included from BasePeCoff.c:16:0: PeCoffLib.h:44:13: error: expected ')' before '+' token IN VOID *FileHandle, ^ PeCoffLib.h:44:36: error: expected ')' before '&' token PeCoffLib.h:67:3: error: unknown type name 'PE_COFF_LOADER_READ_FILE' UINT32 ImageCodeMemoryType; ^ BasePeCoff.c: In function 'PeCoffLoaderGetPeHeader': BasePeCoff.c:117:12: error: called object is not a function or function poi= nter BasePeCoff.c: In function 'PeCoffLoaderGetImageInfo': BasePeCoff.c:402:18: error: called object is not a function or function poi= nter if (DebugDirectoryEntryRva >=3D SectionHeader.VirtualAddress && ^ BasePeCoff.c:429:20: error: called object is not a function or function poi= nter if (DebugEntry.Type =3D=3D EFI_IMAGE_DEBUG_TYPE_CODEVIEW) { ^ BasePeCoff.c:467:16: error: called object is not a function or function poi= nter if (DebugDirectoryEntryRva >=3D SectionHeader.VirtualAddress && ^ BasePeCoff.c:521:18: error: called object is not a function or function poi= nter if (DebugEntry.Type =3D=3D EFI_IMAGE_DEBUG_TYPE_CODEVIEW) { ^ BasePeCoff.c: In function 'PeCoffLoaderLoadImage': BasePeCoff.c:963:14: error: called object is not a function or function poi= nter ImageContext->PeCoffHeaderOffset + ^ BasePeCoff.c:984:14: error: called object is not a function or function poi= nter BasePeCoff.c:1049:18: error: called object is not a function or function po= inter BasePeCoff.c:1056:18: error: called object is not a function or function po= inter BasePeCoff.c:1183:22: error: called object is not a function or function po= inter // Should we apply fix up to this field according to the size = difference between PE and TE? ^ BasePeCoff.c:1190:22: error: called object is not a function or function po= inter ImageContext->ImageError =3D IMAGE_ERROR_IMAGE_READ; ^ BasePeCoff.c: At top level: cc1: error: unrecognized command line option '-Wno-restrict' [-Werror] cc1: error: unrecognized command line option '-Wno-stringop-truncation' [-W= error] cc1: all warnings being treated as errors ../Makefiles/footer.makefile:21: recipe for target 'BasePeCoff.o' failed make[1]: *** [BasePeCoff.o] Error 1 make[1]: Leaving directory '/opt/TCAgent/work/184220821286c462/Edk2/BaseToo= ls/Source/C/Common' GNUmakefile:77: recipe for target 'Common' failed make: *** [Common] Error 2 make: Leaving directory '/opt/TCAgent/work/184220821286c462/Edk2/BaseTools/= Source/C' Build environment: Linux-4.15.0-76-generic-x86_64-with-Ubuntu-16.04-xenial Build start time: 10:39:01, Apr.23 2020 Thanks, Bob -----Original Message----- From: Abner Chang =20 Sent: Thursday, April 23, 2020 9:53 PM To: devel@edk2.groups.io Cc: abner.chang@hpe.com; Gilbert Chen ; Daniel Helmut= Schaefer ; Leif Lindholm ; Feng, Bob C ; Gao, Liming Subject: [PATCH v4 3/3] BaseTools: BaseTools changes for RISC-V platform. 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..c7e19f4544 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.
# Portions copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.
# Copyright (c) 2015, Hewlett-Packard Development Company, L.P.
-# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
+# (C) Copyright 2020, Hewlett Packard Enterprise Development LP
# Copyright (c) Microsoft Corporation # # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -267,11 +267,12 @@ DEFINE DTC_BIN =3D ENV(DTC_PREFIX)dtc # Intel(r) ACPI Compiler from # https://acpica.org/downloads # GCC5 -Linux,Windows- Requires: -# GCC 5 with LTO support, targeting x86_64-lin= ux-gnu, aarch64-linux-gnu, or arm-linux-gnueabi +# GCC 5 with LTO support, targeting x86_64-lin= ux-gnu, aarch64-linux-gnu, arm-linux-gnueabi or riscv64-linux-gnu # Optional: # Required to build platforms or ACPI tables: # Intel(r) ACPI Compiler from # https://acpica.org/downloads +# # CLANG35 -Linux,Windows- Requires: # Clang v3.5 or later, and GNU binutils target= ing aarch64-linux-gnu or arm-linux-gnueabi # Optional: @@ -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 DEFINE GCC_ARM_RC_FLAGS =3D -I binary -O elf32-littlearm -B= arm --rename-section .data=3D.hii DEFINE GCC_AARCH64_RC_FLAGS =3D -I binary -O elf64-littleaarch64 -B= aarch64 --rename-section .data=3D.hii +DEFINE GCC_RISCV64_RC_FLAGS =3D -I binary -O elf64-littleriscv -B= riscv --rename-section .data=3D.hii =20 # GCC Build Flag for included header file list generation DEFINE GCC_DEPS_FLAGS =3D -MMD -MF $@.deps @@ -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) DEFINE GCC5_ASLCC_FLAGS =3D DEF(GCC49_ASLCC_FLAGS) -fno-lto =20 +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 +DEFINE GCC5_RISCV_ALL_DLINK_COMMON =3D -nostdlib -Wl,-n,-q,= --gc-sections -z common-page-size=3D0x40 +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 +DEFINE GCC5_RISCV_ALL_DLINK2_FLAGS =3D -Wl,--defsym=3DPECOF= F_HEADER_SIZE=3D0x220,--script=3D$(EDK_TOOLS_PATH)/Scripts/GccBase.lds +DEFINE GCC5_RISCV_ALL_ASM_FLAGS =3D -c -x assembler -ima= cros $(DEST_DIR_DEBUG)/AutoGen.h +DEFINE GCC5_RISCV_ALL_CC_FLAGS_WARNING_DISABLE =3D -Wno-tautological-co= mpare -Wno-pointer-compare + +DEFINE GCC5_RISCV_OPENSBI_TYPES =3D -DOPENSBI_EXTERNAL_S= BI_TYPES=3DOpensbiTypes.h + +DEFINE GCC5_RISCV64_ARCH =3D rv64imafdc +DEFINE GCC5_RISCV32_RISCV64_ASLDLINK_FLAGS =3D DEF(GCC5_RISCV_ALL_DLINK_CO= MMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable +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 +DEFINE GCC5_RISCV64_DLINK_FLAGS =3D DEF(GCC5_RISCV_ALL_DLINK_FL= AGS) -Wl,-melf64lriscv,--oformat=3Delf64-littleriscv,--no-relax +DEFINE GCC5_RISCV64_DLINK2_FLAGS =3D DEF(GCC5_RISCV_ALL_DLINK2_F= LAGS) +DEFINE GCC5_RISCV64_ASM_FLAGS =3D DEF(GCC5_RISCV_ALL_ASM_FLAG= S) -march=3DDEF(GCC5_RISCV64_ARCH) -mcmodel=3Dmedany -mabi=3Dlp64 + ##########################################################################= ########## # # GCC 4.8 - This configuration is used to compile under Linux to produce @@ -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 NOOPT_GCC5_AARCH64_DLINK_XIPFLAGS =3D -z common-page-size=3D0x20 -O0 =20 +##########################################################################= ########## +# +# GCC RISC-V This configuration is used to compile under Linux to produce +# PE/COFF binaries using GCC RISC-V tool chain +# +##########################################################################= ########## + +################## +# GCC5 RISCV64 definitions +################## +*_GCC5_RISCV64_OBJCOPY_PATH =3D ENV(GCC5_RISCV64_PREFIX)objcopy +*_GCC5_RISCV64_CC_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc +*_GCC5_RISCV64_SLINK_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc-ar +*_GCC5_RISCV64_DLINK_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc +*_GCC5_RISCV64_ASLDLINK_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc +*_GCC5_RISCV64_ASM_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc +*_GCC5_RISCV64_PP_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc +*_GCC5_RISCV64_VFRPP_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc +*_GCC5_RISCV64_ASLCC_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc +*_GCC5_RISCV64_ASLPP_PATH =3D ENV(GCC5_RISCV64_PREFIX)gcc +*_GCC5_RISCV64_RC_PATH =3D ENV(GCC5_RISCV64_PREFIX)objcopy + +*_GCC5_RISCV64_ASLCC_FLAGS =3D DEF(GCC_ASLCC_FLAGS) +*_GCC5_RISCV64_ASLDLINK_FLAGS =3D DEF(GCC5_RISCV32_RISCV64_ASLDLINK_= FLAGS) +*_GCC5_RISCV64_ASM_FLAGS =3D DEF(GCC5_RISCV64_ASM_FLAGS) +*_GCC5_RISCV64_CC_FLAGS =3D DEF(GCC5_RISCV64_CC_FLAGS) -save-t= emps +*_GCC5_RISCV64_DLINK_FLAGS =3D DEF(GCC5_RISCV64_DLINK_FLAGS) +*_GCC5_RISCV64_DLINK2_FLAGS =3D DEF(GCC5_RISCV64_DLINK2_FLAGS) +*_GCC5_RISCV64_RC_FLAGS =3D DEF(GCC_RISCV64_RC_FLAGS) +*_GCC5_RISCV64_OBJCOPY_FLAGS =3D + ##########################################################################= ########## # # CLANG35 - This configuration is used to compile under Linux to produce --=20 2.25.0