From nobody Thu May 2 03:38:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+53551+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+53551+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 15803451745216.992687423899611; Wed, 29 Jan 2020 16:46:14 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id FIBVYY1788612xKs0BUKm9Lq; Wed, 29 Jan 2020 16:46:13 -0800 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web09.863.1580345172409783393 for ; Wed, 29 Jan 2020 16:46:12 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jan 2020 16:46:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,379,1574150400"; d="scan'208";a="252844467" X-Received: from mdkinney-mobl2.amr.corp.intel.com ([10.254.44.187]) by fmsmga004.fm.intel.com with ESMTP; 29 Jan 2020 16:46:11 -0800 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [edk2-devel] [Patch] BaseTools/DscBuildData: Fix PCD autogen include file conflict Date: Wed, 29 Jan 2020 16:46:09 -0800 Message-Id: <20200130004609.14820-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,michael.d.kinney@intel.com X-Gm-Message-State: i6KEbEGYdrUH4qxA2Qt4dmFmx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1580345173; bh=to6/8G5B4EX1locIMrWLFQazI1/6Rs+nuGMTomkHtCg=; h=Cc:Date:From:Reply-To:Subject:To; b=rXCIH4QRKaLLmCnZIH/S9qhbxtLbF1sCJ7/S7cvQ19l9DMOGK9RU5URGfa50ZfrnCRi qybiq9PKmBK6xp0Kzta9iMrnHN0XTIlMy80UWmYparPvzOShbUq4sxah7z5ISNz1oGtLd Rz6m5firw4Nqc6QLUNERIBiVvIg6tWELK/Y= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D2494 When using structured PCDs, a C application is auto generated to fill in the structured PCD value. The C application uses the standard include files , , and . This C application also supports include paths from package DEC files when a structured PCD declaration provides a list. The complete list of include paths are -I options for include paths from package DEC files and the compiler's standard include paths. -I include paths are higher priority than the standard include paths. If the -I included paths from package DEC files contain , , or the wrong include files are used to compile the C application for the structured PCD value. Update GenerateByteArrayValue() to skip a package DEC include paths that contain , , or . Build failures were observed when adding a structured PCD to CryptoPkg. CryptoPkg contains , , and in the path CryptoPkg/Library/Include to support building Open SSL. The Library/Include path is listed as a private include path in CryptoPkg.dec. Without this change, the standard include files designed to support build OpenSLL are used to build the structured PCD C application, and that build fails. Other packages that provide a standard C lib or a gasket for a subset of the standard C lib will run into this same issue if they also define and use a Structured PCD. So this issue is not limited to the CryptoPkg. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Michael D Kinney --- .../Source/Python/Workspace/DscBuildData.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index c65a0dd346..be6688dc75 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1,7 +1,7 @@ ## @file # This file is used to create a database used by build tool # -# Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
# SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -2667,6 +2667,22 @@ class DscBuildData(PlatformBuildClassObject): for pkg in PcdDependDEC: if pkg in PlatformInc: for inc in PlatformInc[pkg]: + # + # Get list of files in potential -I include path + # + FileList =3D os.listdir (str(inc)) + # + # Skip -I include path if one of the include files= required + # by PcdValueInit.c are present in the include pat= hs from + # the DEC file. PcdValueInit.c must use the stand= ard include + # files from the host compiler. + # + if 'stdio.h' in FileList: + continue + if 'stdlib.h' in FileList: + continue + if 'string.h' in FileList: + continue MakeApp +=3D '-I' + str(inc) + ' ' IncSearchList.append(inc) MakeApp =3D MakeApp + '\n' --=20 2.21.0.windows.1 -=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 (#53551): https://edk2.groups.io/g/devel/message/53551 Mute This Topic: https://groups.io/mt/70261740/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-