From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=68.232.153.94; helo=esa3.dell-outbound.iphmx.com; envelope-from=karunakarpoosapalli@dell.com; receiver=edk2-devel@lists.01.org Received: from esa3.dell-outbound.iphmx.com (esa3.dell-outbound.iphmx.com [68.232.153.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7136C21962301 for ; Sun, 27 Jan 2019 23:50:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1548661820; x=1580197820; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=yzeZbe7CVX5cjD5DZAqOMT33BbQVYQ3tHxShlO5U6Vc=; b=MqeEJR36gi6wDNlnuqviZb7PGd98wQrQMFOqFy9Ms6NpjW1r69dN+LLD WfeXyxAruu2hcZaBOBHpEcD1o+a75WioepjIqgQFVcNdz5ZGf/qkM9UsH 3KmdvhrxEU2ZqFKVj7iLH1OkEffXNWjhwTGxTUWzg2OzPA8yBQrXSOyqw c=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EBAADWs05chyWd50NkGgEBAQEBAgE?= =?us-ascii?q?BAQEHAgEBAQGBUQUBAQEBCwGCaoEDJwqMEl+LFDuBUpgIFIFnCwEBGAsJAoQ?= =?us-ascii?q?+AoMZIjQJDQEDAQECAQECAQECEAEBAQoLCQgpIwyCOiIcgQsBAQEBAQEBAQF?= =?us-ascii?q?NAggFYwEBAQECAQEBEBUTNAsFBwQCAQgRBAEBAR4JBycBHgkIAgQBEggBCwc?= =?us-ascii?q?HgwABgXkHAQ+cez0CgW6JBwEBAYFrM4RBAjsEAYUeiFWDbIIWg3Uugx4BBIE?= =?us-ascii?q?qAQESAQ8XMYUGIgKJShACmGsJhy2GVoQjIIFqhTeDO4dQihWBCYQei2kCBAI?= =?us-ascii?q?EBQIUgUaBHnFwUIJsCYIeDgmIX4U/QTEBgSeJUA0XB4EBAYEeAQE?= X-IPAS-Result: =?us-ascii?q?A2EBAADWs05chyWd50NkGgEBAQEBAgEBAQEHAgEBAQGBU?= =?us-ascii?q?QUBAQEBCwGCaoEDJwqMEl+LFDuBUpgIFIFnCwEBGAsJAoQ+AoMZIjQJDQEDA?= =?us-ascii?q?QECAQECAQECEAEBAQoLCQgpIwyCOiIcgQsBAQEBAQEBAQFNAggFYwEBAQECA?= =?us-ascii?q?QEBEBUTNAsFBwQCAQgRBAEBAR4JBycBHgkIAgQBEggBCwcHgwABgXkHAQ+ce?= =?us-ascii?q?z0CgW6JBwEBAYFrM4RBAjsEAYUeiFWDbIIWg3Uugx4BBIEqAQESAQ8XMYUGI?= =?us-ascii?q?gKJShACmGsJhy2GVoQjIIFqhTeDO4dQihWBCYQei2kCBAIEBQIUgUaBHnFwU?= =?us-ascii?q?IJsCYIeDgmIX4U/QTEBgSeJUA0XB4EBAYEeAQE?= Received: from mx0b-00154901.pphosted.com ([67.231.157.37]) by esa3.dell-outbound.iphmx.com with ESMTP/TLS/AES256-SHA256; 28 Jan 2019 01:50:18 -0600 Received: from pps.filterd (m0144102.ppops.net [127.0.0.1]) by mx0b-00154901.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0S7m4HF118322 for ; Mon, 28 Jan 2019 02:50:19 -0500 Received: from esa3.dell-outbound2.iphmx.com (esa3.dell-outbound2.iphmx.com [68.232.154.63]) by mx0b-00154901.pphosted.com with ESMTP id 2q9sts915y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 28 Jan 2019 02:50:19 -0500 From: Cc: , , Received: from ausxipps301.us.dell.com ([143.166.148.223]) by esa3.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA256; 28 Jan 2019 13:50:12 +0600 X-LoopCount0: from 10.166.132.55 X-IronPort-AV: E=Sophos;i="5.56,533,1539666000"; d="scan'208";a="291791168" To: , , , Thread-Topic: [edk2] Conditional Compilation support in INF file Thread-Index: AdSn6DwaFQapYNOqQoKF9n2RWq0Njf//6EQAgAAcnoD//oKZUIADExOAgAAwnwCAABIYAP/+wVwwgALyzwCABgrHAP/rs8Fw Date: Mon, 28 Jan 2019 07:50:13 +0000 Message-ID: <77aa3032af02461f902447c79dee2de6@BLRX13MDC432.AMER.DELL.COM> References: <1a62f519f4b2466fb97c0dd7a81057e6@BLRX13MDC432.AMER.DELL.COM> <03c8ee0d-dca5-a7ca-b941-f45bd0fd6c38@redhat.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E3AE69B@SHSMSX152.ccr.corp.intel.com> <3cd149b2ee7942dda2ebef04bd0f6977@BLRX13MDC432.AMER.DELL.COM> <63fd7d96-31f9-9a8d-6191-20c851ad54c3@redhat.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E3AF0FC@SHSMSX152.ccr.corp.intel.com> <524c6b9c19b34d3680f709e6f0b2e68b@BLRX13MDC432.AMER.DELL.COM> <4A89E2EF3DFEDB4C8BFDE51014F606A14E3B25BC@SHSMSX152.ccr.corp.intel.com> In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E3B25BC@SHSMSX152.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [163.244.186.30] MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-01-28_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901280065 Subject: Re: Conditional Compilation support in INF file X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 07:50:22 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Liming/Mike and All, 1. Is there any plan for adding 'Feature Flag Expressions' support to Bas= etools? Please let me know if you want to me to create ticket in BugZilla an= d work on it. 2. If Feature Flag Expressions is NOT supported in current INF version, C= an we update INF spec until we provide this support. Please let me know to initiate the process for updating = the INF spec or let me know to create the ECR. 3. Thanks for giving alternative ways to achieve the goal. If we're planning to provide the Feature Flag Expressions support, I= would like to suggest to add 'Conditional compilation' support to BaseTool= s, So that it can provide all the requirements. Thanks & Regards, Karunakar -----Original Message----- From: Gao, Liming [mailto:liming.gao@intel.com]=20 Sent: Tuesday, January 15, 2019 8:40 PM To: Kinney, Michael D; Poosapalli, Karunakar; lersek@redhat.com; edk2-devel= @lists.01.org Cc: Vidyadhara, Sumanth; S, Shekar Babu; Raju, SriramKumar Subject: RE: [edk2] Conditional Compilation support in INF file [EXTERNAL EMAIL]=20 Karunakar and Mike: Basetools doesn't support Feature Flag Expressions in INF file. It just = ignores them. Because there are other solutions, I would like to propose to= update INF spec to remove Feature Flag Expressions and avoid the confuse.= =20 Thanks Liming > -----Original Message----- > From: Kinney, Michael D > Sent: Saturday, January 12, 2019 2:54 AM > To: KarunakarPoosapalli@Dell.com; Gao, Liming ;=20 > lersek@redhat.com; edk2-devel@lists.01.org; Kinney, Michael D=20 > > Cc: Sumanth.Vidyadhara@dell.com; Shekar.Babu.S@dell.com; Gao, Liming=20 > ; Sriramkumar.Raju@dell.com > Subject: RE: [edk2] Conditional Compilation support in INF file >=20 > Karunakar, >=20 > Feature Flag Expressions is a concept that is defined in the specs,=20 > but is a feature that is not fully implemented. Liming should be able=20 > to provide details on what has been implemented and validated in=20 > BaseTools. I think the reason that this feature has not been=20 > implemented fully is that we have been able to find alternate ways to=20 > get the equivalent results. Here are a few example techniques: >=20 > 3a: One approach is to use multiple INF files and select the > Right INF for different types of platform builds in DSC file. > If multiple modules share source files but have different > elements produced/consumed/depex, then multiple INF > file is an approach that makes the produced/consumed/depex > clear and is compatible with UDP Spec. >=20 > 3c: One approach is to use DEBUG_CODE(), DEBUG_CODE_BEGIN(), > and DEBUG_CODE_END() macros in a single version of the > source files and enable/disable the debug code using BIT2 > in the following PCD: >=20 > ## The mask is used to control DebugLib behavior.

> # BIT0 - Enable Debug Assert.
> # BIT1 - Enable Debug Print.
> # BIT2 - Enable Debug Code.
> # BIT3 - Enable Clear Memory.
> # BIT4 - Enable BreakPoint as ASSERT.
> # BIT5 - Enable DeadLoop as ASSERT.
> # @Prompt Debug Property. > # @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyM= ask & 0xC0) =3D=3D 0 > gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0|UINT8|0x00000005 >=20 > 3c: Another approach is to use multiple INF files and select > the one needed for debug/release in DSC file. >=20 > If these techniques, or other techniques that other community Member=20 > may be using do not work for your use cases, and Feature Flag=20 > Expressions are the best approach, then Bugzillas Can be entered with=20 > supporting use cases to justify adding the feature to BaseTools. >=20 > Thanks, >=20 > Mike >=20 > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel- bounces@lists.01.org] On Behalf=20 > > Of KarunakarPoosapalli@Dell.com > > Sent: Thursday, January 10, 2019 10:34 PM > > To: Kinney, Michael D ; Gao, Liming=20 > > ; lersek@redhat.com; edk2- devel@lists.01.org > > Cc: Sumanth.Vidyadhara@dell.com; Shekar.Babu.S@dell.com; Gao, Liming=20 > > ; Sriramkumar.Raju@dell.com > > Subject: Re: [edk2] Conditional Compilation support in INF file > > > > Hi All, > > > > Thank you very much for your valuable thoughts. > > Below are my concerns/thoughts, Could you please help on > > > > 1. Is there any module or INF already using FeatureFlagExpression=20 > > feature support in current edk2 source? > > 2. If not, could you please help in providing more detailed spec/Doc=20 > > to verify this support. > > 3. Below are the few of use cases we're looking for, Did really=20 > > FeatureFlagExpression support all of this? > > a. If we've this support we can add different > > protocols in DEPEX section, like we can put condition check and add=20 > > rotococol1 for Notebook and Protocol2 for Desktop. > > b. Help in simplifying build files. We > > could dispense with the prefix to inf files and more developer=20 > > convenient. > > c. Sometimes we would like to add Conditional .C > > and .H for file inclusion. Helps in our Debug / release builds as=20 > > well.. > > Example; we do have release and debug build, although Source=20 > > Section has - IA32,X64, Common, IPF, EBC exclusively. > > But for the same Source section, we can't have choices based=20 > > on our build inputs... > > > > #if Condition1 > > [Sources] > > Main.c > > #elif Condition2 > > [Sources] > > DebugMain.c > > > > 4. I don't think INF file support MACRO support, How complex in=20 > > modifying the BaseTools to support Condition checks and MACRO=20 > > support? > > > > Thanks & Regards, > > Karunakar > > > > -----Original Message----- > > From: Kinney, Michael D > > [mailto:michael.d.kinney@intel.com] > > Sent: Thursday, January 10, 2019 10:23 PM > > To: Gao, Liming; Laszlo Ersek; Poosapalli, Karunakar;=20 > > edk2-devel@lists.01.org; Kinney, Michael D > > Cc: Vidyadhara, Sumanth; Gao, Liming; Raju, SriramKumar > > Subject: RE: [edk2] Conditional Compilation support in INF file > > > > > > [EXTERNAL EMAIL] > > > > There is one additional constraint for adding conditionals to INF=20 > > files. > > > > The UEFI Distribution Packaging Specification defines a format to=20 > > share package and module content in a standard format and uses an=20 > > XML schema for the metadata. We need to be able to convert between=20 > > INF <--> XML and DEC <--> XML. > > > > http://www.uefi.org/sites/default/files/resources/Dist_P > > ackage_Spec_1_1.pdf > > > > If we define extensions to INF or DEC files, we need to make sure=20 > > these transforms are still supported. If an extension prevents=20 > > these transforms, then we either need to change the extension to be=20 > > compatible or work on an update to the UDP spec to support the=20 > > extension in the XML. > > > > Best regards, > > > > Mike > > > > > -----Original Message----- > > > From: edk2-devel [mailto:edk2-devel- bounces@lists.01.org] On=20 > > > Behalf Of Gao, Liming > > > Sent: Thursday, January 10, 2019 7:48 AM > > > To: Laszlo Ersek ;=20 > > > KarunakarPoosapalli@Dell.com; edk2-devel@lists.01.org > > > Cc: Sumanth.Vidyadhara@dell.com; Gao, Liming > > ; > > > Sriramkumar.Raju@dell.com > > > Subject: Re: [edk2] Conditional Compilation support in > > INF file > > > > > > I have same question. What flexibility is expected in > > INF? I see one > > > request in [Depex] section. So, PCD support in [Depex] > > is added. > > > > > > Edk2 INF is used to describe the source code behavior. > > > If the source uses Ppi/Protocol/Guid/Pcd, these > > information are always > > > required to be described in INF file. The compiler can > > optimize the > > > code and remove the unused Ppi/Protocol/Guid/Pcd. It > > doesn't need > > > developer specify the conditional statement. > > > > > > Thanks > > > Liming > > > > -----Original Message----- > > > > From: Laszlo Ersek [mailto:lersek@redhat.com] > > > > Sent: Thursday, January 10, 2019 8:54 PM > > > > To: KarunakarPoosapalli@Dell.com; Gao, Liming > > > ; edk2-devel@lists.01.org > > > > Cc: Sumanth.Vidyadhara@dell.com; > > > Sriramkumar.Raju@dell.com > > > > Subject: Re: [edk2] Conditional Compilation support > > in > > > INF file > > > > > > > > On 01/10/19 07:03, KarunakarPoosapalli@Dell.com > > wrote: > > > > > Hi All, > > > > > > > > > > I agree with providing the support like > > > "FixedAtBuild PCD in INF". And we need to modify or > > provide support in > > > BaseTools to support > > > > this feature. > > > > > > > > > > There are more use cases or flexibility to > > developer > > > if we support Conditional compilation support in INF. > > > > > As we're providing support in BaseTools for > > > FixedAtBuild PCD support in INF, Is there any > > challenges or drawbacks > > > in providing > > > > conditional compilation support in INF? > > > > > > > > This is not for me to say authoritatively, but I'm > > > unaware of any > > > > specific use case that cannot be solved without this > > > feature addition, > > > > and any further complexity to BaseTools should be > > > strongly justified. > > > > "More convenient" is too vague for me, and the > > > BaseTools code is already > > > > hard to read and debug. > > > > > > > > That's just my opinion, again. > > > > > > > > Thanks > > > > Laszlo > > > _______________________________________________ > > > edk2-devel mailing list > > > edk2-devel@lists.01.org > > > https://lists.01.org/mailman/listinfo/edk2-devel > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel