From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id E35D1AC1730 for ; Tue, 7 Jan 2025 20:14:29 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=nEdR6+ER96RLakuaZqZtX+XBgXk7380UxmEnhTQ79/E=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240830; t=1736280869; v=1; x=1736540068; b=PGv8xyAw1wv+HQJOgcZ1KqgqYvEkFy6TOCxdv58PwMXDTWnBMivqvWj0ZOS0cxUAy8Gd/GhL s4hhNla/93wmfxdss+Gbft8c8er5Z1rj1nW+jlewJtQGtN1TY50PjkcpoKQoCR+Emt4gzCgeX2P 9cJ7pUNsMwn84ONg8Uxm1nDzodnmPvKv5w9nuWZoIRrHk+f5rOcGaEKs68cuVNg4xgcfoLVmJbv WaCa/gdP/BxUqgFgruKC4pvuBHtDh+jakap6BO+nB12ykRmCjsnzcfJA6DH0yXAGKv03x5pUokH EFalJFWyA1pggDYf/AZqN+s9Aqhoj2fFbjjGqA4riEmqw== X-Received: by 127.0.0.2 with SMTP id NJtAYY7687511xdkOIRQEhvP; Tue, 07 Jan 2025 12:14:28 -0800 X-Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web10.2067.1736280862425057338 for ; Tue, 07 Jan 2025 12:14:22 -0800 X-Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 507ELgdO006816 for ; Tue, 7 Jan 2025 20:14:22 GMT X-Received: from mail-yb1-f199.google.com (mail-yb1-f199.google.com [209.85.219.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4415y9gwdw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 07 Jan 2025 20:14:21 +0000 (GMT) X-Received: by mail-yb1-f199.google.com with SMTP id 3f1490d57ef6-e549eac4ae6so7141516276.1 for ; Tue, 07 Jan 2025 12:14:21 -0800 (PST) X-Gm-Message-State: Vgv3SkpDpuFA98uDa4dj64nnx7686176AA= X-Gm-Gg: ASbGncvvFQXMyTIHWmo5S9o38fmNoU81/IBquXrGcvBvRZwIc72eY7iI0AjHyym79wp rGLal8UVga25QGWMiVM86xG7jqP5gFztQoLTplEJNthOHGkxAwjQHoKEUWmSE27R+Us0D1w== X-Received: by 2002:a25:2057:0:b0:e38:8263:7990 with SMTP id 3f1490d57ef6-e54ee23ec7dmr213137276.48.1736280860792; Tue, 07 Jan 2025 12:14:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFB+SU0st8eKlCJE/a3F3ETh8EUMaE0RlydDjzKpIF5ScIRGarop7ySWswxSpkncy/JzMxA+YwyESs7spwDCFM= X-Received: by 2002:a25:2057:0:b0:e38:8263:7990 with SMTP id 3f1490d57ef6-e54ee23ec7dmr213097276.48.1736280859941; Tue, 07 Jan 2025 12:14:19 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "Leif Lindholm via groups.io" Date: Tue, 7 Jan 2025 20:14:09 +0000 X-Gm-Features: AbW1kvZBjhnw7sW7HTBxEA1oKSYyUugRKPh3tlNlwde_cDN0EyRpLOe3zEcKK2E Message-ID: Subject: Re: [edk2-devel] Expansion of ARCH in .dsc files To: Joey Vagedes Cc: "devel@edk2.groups.io" , Ajan Zhong , Ard Biesheuvel , "Kinney, Michael D" X-Proofpoint-GUID: Yc7rE2tJhiFUWWyUX-dhIJuj37GoPXRq X-Proofpoint-ORIG-GUID: Yc7rE2tJhiFUWWyUX-dhIJuj37GoPXRq 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 Resent-Date: Tue, 07 Jan 2025 12:14:22 -0800 Resent-From: leif.lindholm@oss.qualcomm.com Reply-To: devel@edk2.groups.io,leif.lindholm@oss.qualcomm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=PGv8xyAw; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Hi Joey, I appreciate the pointer. However, that's the .inf spec. The same language is not in the corresponding section of https://tianocore-docs.github.io/edk2-DscSpecification/release-1.28/3_edk_ii_dsc_file_format/35_[defines]_section.html#35-defines-section Regards, Leif On Tue, 7 Jan 2025 at 19:43, Joey Vagedes wrote: > > Leif, > > For your awareness, Section 3.4 of the INF specification states that architectural modifiers for the [Defines] section tag are not permitted. > > So that you can Ctrl+F and to find the exact language, here is a quote: > > "architectural modifiers for the [Defines] section tag are not permitted" > > https://tianocore-docs.github.io/edk2-InfSpecification/release-1.27/3_edk_ii_inf_file_format/34_[defines]_section.html#34-defines-section > > Thanks, > Joey > > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Leif Lindholm via groups.io > Sent: Tuesday, January 7, 2025 11:05 AM > To: devel@edk2.groups.io > Cc: Ajan Zhong ; Ard Biesheuvel ; Kinney, Michael D > Subject: [EXTERNAL] [edk2-devel] Expansion of ARCH in .dsc files > > So... I originally tripped over my misunderstanding of when writing > https://github.com/tianocore/edk2/pull/6262 to get around something I wanted to test in UefiPayloadPkg. > > Now Ajan has run into at least an adjacent problem when trying to rework > https://github.com/tianocore/edk2/pull/6545 based on feedback I among others provided. > > Now, the thing I had misunderstood before is that when build is called with multiple -a options, the ARCH variable will expand to a space-separated list of *all* the specified architectures. > A lot of Arm/AArch64 modules assume this variable only ever contains a single architecture. > > The thing is, I don't think this is clearly documented in the .dsc specification at all. And it is frequently used as a shorthand in there in a form that would only work if build was called with a single -a. > Now, this also means that there are nearly no correct users of ARCH in > edk2 or edk2-platforms. > Because "the list of all architectures being built simultaneously" > simply isn't very useful information > build-time. There are two correct uses in edk2, in EmulatorPkg.dsc and in UefiPayloadPkg.dsc, using '!if "IA32" in "$ARCH"', which as far as I can tell is the only possible way to use the variable correctly. > Slightly amusingly, EmulatorPkg.dsc also contains an incorrect use. > > I guess the behaviour is a direct result of how the build command is architected. > I guess the one question I have is - is this the intended behaviour? > > Ard: I think we need to update some of our .dsc files... > > Ajan: one somewhat hacky workaround I can think of to separate the output images is to hardcode the output image name in arch-specific Defines sections, like so: > > diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 0bd8d85cab03..f07f2b91764e 100644 > --- a/ArmVirtPkg/ArmVirtQemu.dsc > +++ b/ArmVirtPkg/ArmVirtQemu.dsc > @@ -12,12 +12,17 @@ > # Defines Section - statements that will be processed to create a Makefile. > # > ################################################################################ > +[Defines.ARM] > + OUTPUT_DIRECTORY = Build/ArmVirtQemu-ARM > + > +[Defines.AARCH64] > + OUTPUT_DIRECTORY = Build/ArmVirtQemu-AARCH64 > + > [Defines] > PLATFORM_NAME = ArmVirtQemu > PLATFORM_GUID = 37d7e986-f7e9-45c2-8067-e371421a626c > PLATFORM_VERSION = 0.1 > DSC_SPECIFICATION = 0x00010005 > - OUTPUT_DIRECTORY = Build/ArmVirtQemu-$(ARCH) > SUPPORTED_ARCHITECTURES = AARCH64|ARM > BUILD_TARGETS = DEBUG|RELEASE|NOOPT > SKUID_IDENTIFIER = DEFAULT > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120970): https://edk2.groups.io/g/devel/message/120970 Mute This Topic: https://groups.io/mt/110483263/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-