From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by mx.groups.io with SMTP id smtpd.web11.35563.1688981375642929558 for ; Mon, 10 Jul 2023 02:29:35 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=BE3L7YBd; spf=pass (domain: ventanamicro.com, ip: 209.85.215.181, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-5577900c06bso3322709a12.2 for ; Mon, 10 Jul 2023 02:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1688981375; x=1691573375; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=mcJbmkN6vOG5kZZp096Wn0QlMvTJANvFM3KYy7jmgEA=; b=BE3L7YBdDv+jLa8S2Vy7SP+Bm3jNRgmioWZjLTLZ+c+bAq6UrTwNSM9zmWXihJhnTP 2xCPjgf1EzF7j9v1Qka2er8jdL0K35uc1v0mliRD+1mxmVIxRz6tj/GhQWppF3e/uNdx +YHQZqNlFmTLrypbnltzUsdB8DNKEdXBfM7wNSQtKhd/8rfr6RBvvB2Zs/VNb+N5ohDY LwNj/t+vsWqUXbvHMqjujUa3nombGRYwxm3gobZtaqcjo8VFmczPu9roztsWquBHfI3u oD6g/82mPFR/xNkLmrvXjrLImyaYhFXgeruMyzmeJR+3huEnqHPxXdRyXpLKR8nX6EHk l68A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688981375; x=1691573375; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mcJbmkN6vOG5kZZp096Wn0QlMvTJANvFM3KYy7jmgEA=; b=Jv3+pEJaiwV1KAiVXlLqRrp056Q4/CVGzNm+Vt149+DaQWayL17PeELP0uI1Ln9FUO N8Dq2lG95YJ5zxSBjoKweOQfuNxxCmdDJ8NprnGeUyD74oo15VRsX4Run/Vj3bgLCfHa 2NgG0CSy9m9NcC9is1MgMh9y8tNb7jd4dEXI+KS8UC8pFxNjfk2/f3O6oNzRLvyfa6lO DjtVuxM7Lf6d6yAJHrLBmF3vW5R5i8ahVYmMQUeyNNM6yDhJnoepR7DivTGrsAdUk6Os GDTc4cdIvkcz+lJMp8nYkzK+TwEB1oArJyu6MH9iISMglq8OxPeIVkYuSG9/mbyuxsYQ 9G2g== X-Gm-Message-State: ABy/qLZymmkC69GBjYpwKkOtesK8d9j9Xy0BSKAtyLfdZySxoC+o1lOB KFyIqvhuzvHksc8BA11YhtmgqNG/aF1P+aO7uH8= X-Google-Smtp-Source: APBJJlGAKnke/8hsOXec8UcG9sZMYN0qpUrIASWnaq7txzPhOpQscdbJ2RMObIy8OCnkWsLKBhp6xA== X-Received: by 2002:a17:90b:23c7:b0:263:7d57:16e9 with SMTP id md7-20020a17090b23c700b002637d5716e9mr13007150pjb.21.1688981374890; Mon, 10 Jul 2023 02:29:34 -0700 (PDT) Return-Path: Received: from sunil-laptop ([106.51.184.72]) by smtp.gmail.com with ESMTPSA id r4-20020a17090a5c8400b0025eaeaae318sm5783886pji.7.2023.07.10.02.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 02:29:34 -0700 (PDT) Date: Mon, 10 Jul 2023 14:59:29 +0530 From: "Sunil V L" To: devel@edk2.groups.io, gaoliming@byosoft.com.cn Cc: 'Rebecca Cran' , 'Bob Feng' , 'Yuwei Chen' , 'Ard Biesheuvel' Subject: =?UTF-8?B?UmU6IFtlZGsyLWRldmVsXSDlm57lpI06IFtQQVRDSCAzLzRdIEJhc2VUb29scy90b29sc19kZWY6IEFkZCBDTEFOR0RXQVJGIHN1cHBvcnQgZm9yIFJJU0MtVg==?= Message-ID: References: <20230703080831.51075-1-sunilvl@ventanamicro.com> <20230703080831.51075-4-sunilvl@ventanamicro.com> <009301d9b2d1$28d69200$7a83b600$@byosoft.com.cn> MIME-Version: 1.0 In-Reply-To: <009301d9b2d1$28d69200$7a83b600$@byosoft.com.cn> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi Liming, On Mon, Jul 10, 2023 at 09:52:18AM +0800, gaoliming via groups.io wrote: > Sunil: > I add my comments below. > > > -----邮件原件----- > > 发件人: Sunil V L > > 发送时间: 2023年7月3日 16:09 > > 收件人: devel@edk2.groups.io > > 抄送: Sunil V L ; Rebecca Cran > > ; Liming Gao ; Bob Feng > > ; Yuwei Chen ; Ard > > Biesheuvel > > 主题: [PATCH 3/4] BaseTools/tools_def: Add CLANGDWARF support for > > RISC-V > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4478 > > > > 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 > > --- > > BaseTools/Conf/tools_def.template | 52 > > +++++++++++++++++++++++++++++++ > > 1 file changed, 52 insertions(+) > > > > diff --git a/BaseTools/Conf/tools_def.template > > b/BaseTools/Conf/tools_def.template > > index 90f4105506e5..47d8c379d9f2 100755 > > --- a/BaseTools/Conf/tools_def.template > > +++ b/BaseTools/Conf/tools_def.template > > @@ -745,6 +745,7 @@ DEFINE GCC_LOONGARCH64_CC_FLAGS = > > DEF(GCC_ALL_CC_FLAGS) -mabi=lp64d -fno-asyn > > DEFINE GCC_ARM_CC_XIPFLAGS = -mno-unaligned-access > > DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) > > -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char > > -ffunction-sections -fdata-sections -Wno-address > > -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-pic -fno-pie > > -ffixed-x18 > > DEFINE GCC_AARCH64_CC_XIPFLAGS = -mstrict-align > > -mgeneral-regs-only > > +DEFINE GCC_RISCV64_CC_XIPFLAGS = -mstrict-align > > -mgeneral-regs-only > > DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie > > DEFINE GCC_DLINK2_FLAGS_COMMON = > > -Wl,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds > > DEFINE GCC_IA32_X64_DLINK_COMMON = > > DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections > > @@ -2023,6 +2024,57 @@ DEFINE CLANGDWARF_AARCH64_DLINK_FLAGS > > = DEF(CLANGDWARF_AARCH64_TARGET) DEF(GCC_ > > RELEASE_CLANGDWARF_AARCH64_CC_FLAGS = > > DEF(CLANGDWARF_AARCH64_CC_FLAGS) $(PLATFORM_FLAGS) -flto -O3 > > RELEASE_CLANGDWARF_AARCH64_DLINK_FLAGS = > > DEF(CLANGDWARF_AARCH64_DLINK_FLAGS) -flto -Wl,-O3 -fuse-ld=lld > > -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 > > -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wl,--no-pie,--no-relax > > > > +################## > > +# CLANGDWARF RISCV64 definitions > > +################## > > +DEFINE CLANGDWARF_RISCV64_TARGET = -target riscv64-linux-gnu > > +DEFINE CLANGDWARF_RISCV64_CC_FLAGS = > > DEF(GCC5_RISCV64_CC_FLAGS) DEF(CLANGDWARF_RISCV64_TARGET) > > DEF(CLANGDWARF_WARNING_OVERRIDES) > > + > > +# This is similar to GCC flags but without -n > > +DEFINE CLANGDWARF_RISCV64_ALL_DLINK_COMMON = -nostdlib > > -Wl,-q,--gc-sections -z common-page-size=0x40 > > +DEFINE CLANGDWARF_RISCV64_ALL_DLINK_FLAGS = > > DEF(CLANGDWARF_RISCV64_ALL_DLINK_COMMON) > > -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) > > -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map > > +DEFINE CLANGDWARF_RISCV64_DLINK_FLAGS = > > DEF(CLANGDWARF_RISCV64_TARGET) > > DEF(CLANGDWARF_RISCV64_ALL_DLINK_FLAGS) > > -Wl,-melf64lriscv,--oformat=elf64-littleriscv,--no-relax > > + > > +*_CLANGDWARF_RISCV64_PP_FLAGS = DEF(GCC_PP_FLAGS) > > +*_CLANGDWARF_RISCV64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) > > +*_CLANGDWARF_RISCV64_APP_FLAGS = > > +*_CLANGDWARF_RISCV64_ASL_FLAGS = DEF(IASL_FLAGS) > > +*_CLANGDWARF_RISCV64_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS) > > +*_CLANGDWARF_RISCV64_DTCPP_FLAGS = DEF(GCC_DTCPP_FLAGS) > > +*_CLANGDWARF_RISCV64_DEPS_FLAGS = DEF(GCC_DEPS_FLAGS) > > + > > +*_CLANGDWARF_RISCV64_CC_PATH = > > ENV(CLANGDWARF_BIN)clang > > +*_CLANGDWARF_RISCV64_ASM_PATH = > > ENV(CLANGDWARF_BIN)clang > > +*_CLANGDWARF_RISCV64_PP_PATH = > > ENV(CLANGDWARF_BIN)clang > > +*_CLANGDWARF_RISCV64_VFRPP_PATH = > > ENV(CLANGDWARF_BIN)clang > > +*_CLANGDWARF_RISCV64_ASLCC_PATH = > > ENV(CLANGDWARF_BIN)clang > > +*_CLANGDWARF_RISCV64_ASLPP_PATH = > > ENV(CLANGDWARF_BIN)clang > > +*_CLANGDWARF_RISCV64_DLINK_PATH = > > ENV(CLANGDWARF_BIN)clang > > +*_CLANGDWARF_RISCV64_ASLDLINK_PATH = > > ENV(CLANGDWARF_BIN)clang > > + > > +*_CLANGDWARF_RISCV64_SLINK_PATH = > > ENV(CLANGDWARF_BIN)llvm-ar > > +*_CLANGDWARF_RISCV64_RC_PATH = > > ENV(CLANGDWARF_BIN)llvm-objcopy > > + > > +*_CLANGDWARF_RISCV64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) > > -flto > Here should be -fno-lto. This option should be same for the different ARCHs. > > > > +*_CLANGDWARF_RISCV64_ASLDLINK_FLAGS = > > DEF(CLANGDWARF_RISCV64_TARGET) > > DEF(GCC5_RISCV32_RISCV64_ASLDLINK_FLAGS) > > +*_CLANGDWARF_RISCV64_ASM_FLAGS = DEF(GCC_ASM_FLAGS) > > DEF(CLANGDWARF_RISCV64_TARGET) $(PLATFORM_FLAGS) > > -Qunused-arguments -mabi=lp64 -mno-relax -flto > > Here should be no -flto. Please confirm. > Good catch!. I agree. Let me fix these issues and send next version. Thanks!