mirror_edk2/BaseTools/Source/Python/Workspace
Michael D Kinney b47fe2655d BaseTools/DscBuildData: Fix PCD autogen include file conflict
https://bugzilla.tianocore.org/show_bug.cgi?id=2494

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 <stdio.h>, <stdlib.h>, and <string.h>.
This C application also supports include paths from package DEC
files when a structured PCD declaration provides a <Packages>
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
<stdio.h>, <stdlib.h>, or <string.h> 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 <stdio.h>, <stdlib.h>, or <string.h>.

Build failures were observed when adding a structured PCD to
CryptoPkg.  CryptoPkg contains <stdio.h>, <stdlib.h>, and
<string.h> 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 <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2020-02-04 20:46:22 +00:00
..
__init__.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
BuildClassObject.py BaseTools: Sort Pcd settings to make PcdTokenNumber be fixed 2019-09-10 08:39:19 +08:00
DecBuildData.py BaseTools: Correct the value assignment for StructurePcd 2019-05-10 17:06:44 +08:00
DscBuildData.py BaseTools/DscBuildData: Fix PCD autogen include file conflict 2020-02-04 20:46:22 +00:00
InfBuildData.py BaseTools: Fixed regression issue for building !x86 builds 2019-08-29 11:10:29 +08:00
MetaDataTable.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
MetaFileCommentParser.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
MetaFileParser.py BaseTools:Enhance the way to handling included dsc file 2019-12-04 07:56:55 +00:00
MetaFileTable.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
WorkspaceCommon.py BaseTools:Add [packages] section in dsc file 2019-11-20 07:46:42 +00:00
WorkspaceDatabase.py BaseTools:Add [packages] section in dsc file 2019-11-20 07:46:42 +00:00