From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 08DDE7803CE for ; Mon, 31 Jul 2023 11:28:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=qbQvPjsE7i+kFP108GLDTcJLIvHCvf8tgfu4LkuTeFU=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-Received:X-Received:X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:X-Received:Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:X-Gm-Message-State:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1690802909; v=1; b=l9z9kSBNathOh846yt+Phg7yf38+WRpU/Qh0WoD5Flj5me6o754MGpBbTyXFfChRqW1BRVAH H5NincVAYmiupm+Q9NF1FHRgWGJ1oWsou+gmUgDG5Cs3k3rImTKvfSB93f5hrqhqhSKP8ozUJ50 BusKEcAOBfjj5IxNQ2gxaDUo= X-Received: by 127.0.0.2 with SMTP id KNdVYY7687511x4NLggpOZXG; Mon, 31 Jul 2023 04:28:29 -0700 X-Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mx.groups.io with SMTP id smtpd.web11.5255.1690802908455157875 for ; Mon, 31 Jul 2023 04:28:28 -0700 X-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B2E215C0162; Mon, 31 Jul 2023 07:28:25 -0400 (EDT) X-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 31 Jul 2023 07:28:25 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrjeeggddujecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomheptfgvsggv tggtrgcuvehrrghnuceorhgvsggvtggtrgessghsughiohdrtghomheqnecuggftrfgrth htvghrnhepveffgfdtffejfedujeelfedujeejteduvdfhgeduhfdutdelfefgudeujeet veeunecuffhomhgrihhnpehtihgrnhhotghorhgvrdhorhhgnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprhgvsggvtggtrgessghsughiohdr tghomh X-ME-Proxy: Feedback-ID: i5b994698:Fastmail X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 31 Jul 2023 07:28:24 -0400 (EDT) Message-ID: Date: Mon, 31 Jul 2023 05:28:15 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [edk2-devel] [PATCH v2 3/4] BaseTools/tools_def: Add CLANGDWARF support for RISC-V To: Sunil V L , devel@edk2.groups.io Cc: Liming Gao , Bob Feng , Yuwei Chen , Ard Biesheuvel , Ard Biesheuvel References: <20230711154335.586343-1-sunilvl@ventanamicro.com> <20230711154335.586343-4-sunilvl@ventanamicro.com> From: "Rebecca Cran" In-Reply-To: <20230711154335.586343-4-sunilvl@ventanamicro.com> Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rebecca@bsdio.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: WtS63YCREWMIsQIhOOPqHwOAx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=l9z9kSBN; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Reviewed-by: Rebecca Cran On 7/11/23 09:43, Sunil V L wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4478 > > Add tools_def definitions to support CLANGDWARF toolchain > for RISC-V. This uses clang and the llvm LLD linker. This > helps people by not requiring to install multiple > cross compilers for different architectures. > > Cc: Rebecca Cran > Cc: Liming Gao > Cc: Bob Feng > Cc: Yuwei Chen > Cc: Ard Biesheuvel > > Signed-off-by: Sunil V L > Acked-by: Ard Biesheuvel > --- > BaseTools/Conf/tools_def.template | 53 +++++++++++++++++++++++++++++++ > 1 file changed, 53 insertions(+) > > diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def= .template > index 90f4105506e5..1bf62362b611 100755 > --- a/BaseTools/Conf/tools_def.template > +++ b/BaseTools/Conf/tools_def.template > @@ -745,6 +745,7 @@ DEFINE GCC_LOONGARCH64_CC_FLAGS =3D DEF(GCC_ALL_CC= _FLAGS) -mabi=3Dlp64d -fno-asyn > DEFINE GCC_ARM_CC_XIPFLAGS =3D -mno-unaligned-access > DEFINE GCC_AARCH64_CC_FLAGS =3D DEF(GCC_ALL_CC_FLAGS) -mlittle-e= ndian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -= fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tab= les -fno-pic -fno-pie -ffixed-x18 > DEFINE GCC_AARCH64_CC_XIPFLAGS =3D -mstrict-align -mgeneral-regs-on= ly > +DEFINE GCC_RISCV64_CC_XIPFLAGS =3D -mstrict-align -mgeneral-regs-onl= y > DEFINE GCC_DLINK_FLAGS_COMMON =3D -nostdlib --pie > DEFINE GCC_DLINK2_FLAGS_COMMON =3D -Wl,--script=3D$(EDK_TOOLS_PATH)= /Scripts/GccBase.lds > DEFINE GCC_IA32_X64_DLINK_COMMON =3D DEF(GCC_DLINK_FLAGS_COMMON) --gc= -sections > @@ -2023,6 +2024,58 @@ DEFINE CLANGDWARF_AARCH64_DLINK_FLAGS =3D DEF(CLA= NGDWARF_AARCH64_TARGET) DEF(GCC_ > RELEASE_CLANGDWARF_AARCH64_CC_FLAGS =3D DEF(CLANGDWARF_AARCH64_CC_FL= AGS) $(PLATFORM_FLAGS) -flto -O3 > RELEASE_CLANGDWARF_AARCH64_DLINK_FLAGS =3D DEF(CLANGDWARF_AARCH64_DLINK= _FLAGS) -flto -Wl,-O3 -fuse-ld=3Dlld -L$(WORKSPACE)/ArmPkg/Library/GccLto -= llto-aarch64 -Wl,-plugin-opt=3D-pass-through=3D-llto-aarch64 -Wl,--no-pie,-= -no-relax > =20 > +################## > +# CLANGDWARF RISCV64 definitions > +################## > +DEFINE CLANGDWARF_RISCV64_TARGET =3D -target riscv64-linux-gnu > +DEFINE CLANGDWARF_RISCV64_CC_COMMON =3D DEF(GCC5_RISCV_ALL_CC_FLAGS) DEF= (GCC5_RISCV_ALL_CC_FLAGS_WARNING_DISABLE) DEF(GCC5_RISCV_OPENSBI_TYPES) -ma= rch=3DDEF(GCC5_RISCV64_ARCH) -fno-builtin -fno-builtin-memcpy -fno-stack-pr= otector -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tables -Wn= o-unused-but-set-variable -fpack-struct=3D8 -mcmodel=3Dmedany -mabi=3Dlp64 = -mno-relax > +DEFINE CLANGDWARF_RISCV64_CC_FLAGS =3D DEF(CLANGDWARF_RISCV64_CC_COMMON= ) DEF(CLANGDWARF_RISCV64_TARGET) DEF(CLANGDWARF_WARNING_OVERRIDES) > + > +# This is similar to GCC flags but without -n > +DEFINE CLANGDWARF_RISCV64_ALL_DLINK_COMMON =3D -nostdlib -Wl,-q,--gc-se= ctions -z common-page-size=3D0x40 > +DEFINE CLANGDWARF_RISCV64_ALL_DLINK_FLAGS =3D DEF(CLANGDWARF_RISCV64_A= LL_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -= Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map > +DEFINE CLANGDWARF_RISCV64_DLINK_FLAGS =3D DEF(CLANGDWARF_RISCV64_T= ARGET) DEF(CLANGDWARF_RISCV64_ALL_DLINK_FLAGS) -Wl,-melf64lriscv,--oformat= =3Delf64-littleriscv,--no-relax > + > +*_CLANGDWARF_RISCV64_PP_FLAGS =3D DEF(GCC_PP_FLAGS) > +*_CLANGDWARF_RISCV64_ASLCC_FLAGS =3D DEF(GCC_ASLCC_FLAGS) > +*_CLANGDWARF_RISCV64_APP_FLAGS =3D > +*_CLANGDWARF_RISCV64_ASL_FLAGS =3D DEF(IASL_FLAGS) > +*_CLANGDWARF_RISCV64_ASL_OUTFLAGS =3D DEF(IASL_OUTFLAGS) > +*_CLANGDWARF_RISCV64_DTCPP_FLAGS =3D DEF(GCC_DTCPP_FLAGS) > +*_CLANGDWARF_RISCV64_DEPS_FLAGS =3D DEF(GCC_DEPS_FLAGS) > + > +*_CLANGDWARF_RISCV64_CC_PATH =3D ENV(CLANGDWARF_BIN)clang > +*_CLANGDWARF_RISCV64_ASM_PATH =3D ENV(CLANGDWARF_BIN)clang > +*_CLANGDWARF_RISCV64_PP_PATH =3D ENV(CLANGDWARF_BIN)clang > +*_CLANGDWARF_RISCV64_VFRPP_PATH =3D ENV(CLANGDWARF_BIN)clang > +*_CLANGDWARF_RISCV64_ASLCC_PATH =3D ENV(CLANGDWARF_BIN)clang > +*_CLANGDWARF_RISCV64_ASLPP_PATH =3D ENV(CLANGDWARF_BIN)clang > +*_CLANGDWARF_RISCV64_DLINK_PATH =3D ENV(CLANGDWARF_BIN)clang > +*_CLANGDWARF_RISCV64_ASLDLINK_PATH =3D ENV(CLANGDWARF_BIN)clang > + > +*_CLANGDWARF_RISCV64_SLINK_PATH =3D ENV(CLANGDWARF_BIN)llvm-ar > +*_CLANGDWARF_RISCV64_RC_PATH =3D ENV(CLANGDWARF_BIN)llvm-objcopy > + > +*_CLANGDWARF_RISCV64_ASLCC_FLAGS =3D DEF(GCC_ASLCC_FLAGS) -fno-lto > +*_CLANGDWARF_RISCV64_ASLDLINK_FLAGS =3D DEF(CLANGDWARF_RISCV64_TARGET) D= EF(GCC5_RISCV32_RISCV64_ASLDLINK_FLAGS) > +*_CLANGDWARF_RISCV64_ASM_FLAGS =3D DEF(GCC_ASM_FLAGS) DEF(CLANGDWAR= F_RISCV64_TARGET) $(PLATFORM_FLAGS) -Qunused-arguments -mabi=3Dlp64 -mno-re= lax > +*_CLANGDWARF_RISCV64_DLINK_FLAGS =3D DEF(CLANGDWARF_RISCV64_TARGET) D= EF(GCC5_RISCV64_DLINK_FLAGS) > +*_CLANGDWARF_RISCV64_DLINK_XIPFLAGS =3D -z common-page-size=3D0x20 > +*_CLANGDWARF_RISCV64_DLINK2_FLAGS =3D DEF(GCC_DLINK2_FLAGS_COMMON) -Wl= ,--defsym=3DPECOFF_HEADER_SIZE=3D0x240 > +*_CLANGDWARF_RISCV64_PLATFORM_FLAGS =3D > +*_CLANGDWARF_RISCV64_PP_FLAGS =3D DEF(GCC_PP_FLAGS) DEF(CLANGDWARF= _RISCV64_TARGET) $(PLATFORM_FLAGS) > +*_CLANGDWARF_RISCV64_RC_FLAGS =3D DEF(GCC_RISCV64_RC_FLAGS) > +*_CLANGDWARF_RISCV64_VFRPP_FLAGS =3D DEF(GCC_VFRPP_FLAGS) DEF(CLANGDW= ARF_RISCV64_TARGET) $(PLATFORM_FLAGS) > +*_CLANGDWARF_RISCV64_ASLPP_FLAGS =3D DEF(GCC_ASLPP_FLAGS) DEF(CLANGDW= ARF_RISCV64_TARGET) > +*_CLANGDWARF_RISCV64_CC_XIPFLAGS =3D DEF(GCC_RISCV64_CC_XIPFLAGS) > + > + DEBUG_CLANGDWARF_RISCV64_CC_FLAGS =3D DEF(CLANGDWARF_RISCV64_CC_FLA= GS) $(PLATFORM_FLAGS) -flto -O1 > + DEBUG_CLANGDWARF_RISCV64_DLINK_FLAGS =3D DEF(CLANGDWARF_RISCV64_DLINK_= FLAGS) -flto -Wl,-O1 -fuse-ld=3Dlld -Wl,--no-pie,--no-relax > + NOOPT_CLANGDWARF_RISCV64_CC_FLAGS =3D DEF(CLANGDWARF_RISCV64_CC_FLA= GS) $(PLATFORM_FLAGS) -O0 > + NOOPT_CLANGDWARF_RISCV64_DLINK_FLAGS =3D DEF(CLANGDWARF_RISCV64_DLINK_= FLAGS) -fuse-ld=3Dlld -Wl,--no-pie,--no-relax > +RELEASE_CLANGDWARF_RISCV64_CC_FLAGS =3D DEF(CLANGDWARF_RISCV64_CC_FLA= GS) $(PLATFORM_FLAGS) -flto -O3 > +RELEASE_CLANGDWARF_RISCV64_DLINK_FLAGS =3D DEF(CLANGDWARF_RISCV64_DLINK_= FLAGS) -flto -Wl,-O3 -fuse-ld=3Dlld -Wl,--no-pie,--no-relax > + > # > # > # XCODE5 support -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107400): https://edk2.groups.io/g/devel/message/107400 Mute This Topic: https://groups.io/mt/100081396/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-