Revision: 18058
          http://sourceforge.net/p/edk2/code/18058
Author:   jljusten
Date:     2015-07-26 08:04:10 +0000 (Sun, 26 Jul 2015)
Log Message:
-----------
BaseTools: Make AutoGen.h array declaration match AutoGen.c definition

When a quoted string is used as initialization data in a DEC file PCD
entry, the PCD data type in that entry must be VOID*. The created
AutoGen.c defines the PCD data as UINT8[] or UINT16[], depending on
the string type. The created AutoGen.h, however, declares the PCD data
as VOID*. For a standard compile/link, this works because AutoGen.c
doesn't include AutoGen.h. But when GCC LTO is used, the link time
code generation detects the mismatch and the build fails. This
change makes the AutoGen.h PCD data declaration match the AutoGen.c
definition.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Scott Duplichan <[email protected]>
Reviewed-by: Yingke Liu <[email protected]>
Signed-off-by: Laszlo Ersek <[email protected]>

Modified Paths:
--------------
    trunk/edk2/BaseTools/Source/Python/AutoGen/GenC.py

Modified: trunk/edk2/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/edk2/BaseTools/Source/Python/AutoGen/GenC.py  2015-07-26 08:04:04 UTC 
(rev 18057)
+++ trunk/edk2/BaseTools/Source/Python/AutoGen/GenC.py  2015-07-26 08:04:10 UTC 
(rev 18058)
@@ -1088,6 +1088,8 @@
     if PcdItemType == TAB_PCDS_FIXED_AT_BUILD or PcdItemType == 
TAB_PCDS_FEATURE_FLAG:
         key = ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName))
         
+        if DatumType == 'VOID*' and Array == '[]':
+          DatumType = ['UINT8', 'UINT16'][Pcd.DefaultValue[0] == 'L']
         AutoGenH.Append('extern const %s _gPcd_FixedAtBuild_%s%s;\n' 
%(DatumType, TokenCName, Array))
         AutoGenH.Append('#define %s  %s_gPcd_FixedAtBuild_%s\n' %(GetModeName, 
Type, TokenCName))
         AutoGenH.Append('//#define %s  ASSERT(FALSE)  // It is not allowed to 
set value for a FIXED_AT_BUILD PCD\n' % SetModeName)


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to