summaryrefslogtreecommitdiffstats
path: root/BaseTools
Commit message (Collapse)AuthorAgeFilesLines
* BaseTools: Get Pcd DatumType from DEC file for --pcdYonghong Zhu2018-03-121-0/+1
| | | | | | | | | It is regression bug that missing the Pcd DatumType info from DEC file for --pcd . Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: GlobalData remove unused variableCarsey, Jaben2018-03-091-2/+1
| | | | | | | | | | gWideStringPattern is not used. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Fix parse OFFSET_OF get wrong offsetFeng, YunhuaX2018-03-091-1/+2
| | | | | | | | | | Fix parse OFFSET_OF get wrong offset Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Fix a bug for --pcd used in ConditionalStatement calculateYonghong Zhu2018-03-093-1/+5
| | | | | | | | | Move the GlobalData.BuildOptionPcd before FdfParser() function and add type check for Pcd item. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Update --pcd parser to support flexible pcd formatYonghong Zhu2018-03-098-268/+159
| | | | | | | | This patch update --pcd parser to support flexible pcd format. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fixed Pcd from command line issue.BobCF2018-03-094-47/+31
| | | | | | | | | Save the pcd command line value in Pcd object Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/header.makefile: revert gcc-8 "-Wno-xxx" options on OSXLaszlo Ersek2018-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I recently added the gcc-8 specific "-Wno-stringop-truncation" and "-Wno-restrict" options to BUILD_CFLAGS, both for "Darwin" (XCODE5 / clang, OSX) and otherwise (gcc, Linux / Cygwin). I also regression-tested the change with gcc-4.8 on Linux -- gcc-4.8 does not know either of the (gcc-8 specific) "-Wno-stringop-truncation" and "-Wno-restrict" options, yet the build completed fine (by GCC design). Regarding OSX, my expectation was that - XCODE5 / clang would either recognize these warnings options (because clang does recognize most -W options of gcc), - or, similarly to gcc, clang would simply ignore the "-Wno-xxx" flags that it didn't recognize. Neither is the case; the new flags have broken the BaseTools build on OSX. Revert them (for OSX only). Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reported-by: Liming Gao <liming.gao@intel.com> Fixes: 1d212a83df0eaf32a6f5d4159beb2d77832e0231 Fixes: 9222154ae7b3eef75ae88cdb56158256227cb929 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* BaseTools/GenVtf: silence false "stringop-overflow" warning with memcpy()Laszlo Ersek2018-03-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc-8 (which is part of Fedora 28) enables the new warning "-Wstringop-overflow" in "-Wall". This warning is documented in detail at <https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html>; the introduction says > Warn for calls to string manipulation functions such as memcpy and > strcpy that are determined to overflow the destination buffer. It breaks the BaseTools build with: > GenVtf.c: In function 'ConvertVersionInfo': > GenVtf.c:132:7: error: 'strncpy' specified bound depends on the length > of the source argument [-Werror=stringop-overflow=] > strncpy (TemStr + 4 - Length, Str, Length); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > GenVtf.c:130:14: note: length computed here > Length = strlen(Str); > ^~~~~~~~~~~ It is a false positive because, while the bound equals the length of the source argument, the destination pointer is moved back towards the beginning of the destination buffer by the same amount (and this amount is range-checked first, so we can't precede the start of the dest buffer). Replace both strncpy() calls with memcpy(). Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Cole Robinson <crobinso@redhat.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reported-by: Cole Robinson <crobinso@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/header.makefile: add "-Wno-restrict"Laszlo Ersek2018-03-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc-8 (which is part of Fedora 28) enables the new warning "-Wrestrict" in "-Wall". This warning is documented in detail at <https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html>; the introduction says > Warn when an object referenced by a restrict-qualified parameter (or, in > C++, a __restrict-qualified parameter) is aliased by another argument, > or when copies between such objects overlap. It breaks the BaseTools build (in the Brotli compression library) with: > In function 'ProcessCommandsInternal', > inlined from 'ProcessCommands' at dec/decode.c:1828:10: > dec/decode.c:1781:9: error: 'memcpy' accessing between 17 and 2147483631 > bytes at offsets 16 and 16 overlaps between 17 and 2147483631 bytes at > offset 16 [-Werror=restrict] > memcpy(copy_dst + 16, copy_src + 16, (size_t)(i - 16)); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In function 'ProcessCommandsInternal', > inlined from 'SafeProcessCommands' at dec/decode.c:1833:10: > dec/decode.c:1781:9: error: 'memcpy' accessing between 17 and 2147483631 > bytes at offsets 16 and 16 overlaps between 17 and 2147483631 bytes at > offset 16 [-Werror=restrict] > memcpy(copy_dst + 16, copy_src + 16, (size_t)(i - 16)); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Paolo Bonzini <pbonzini@redhat.com> analyzed the Brotli source in detail, and concluded that the warning is a false positive: > This seems safe to me, because it's preceded by: > > uint8_t* copy_dst = &s->ringbuffer[pos]; > uint8_t* copy_src = &s->ringbuffer[src_start]; > int dst_end = pos + i; > int src_end = src_start + i; > if (src_end > pos && dst_end > src_start) { > /* Regions intersect. */ > goto CommandPostWrapCopy; > } > > If [src_start, src_start + i) and [pos, pos + i) don't intersect, then > neither do [src_start + 16, src_start + i) and [pos + 16, pos + i). > > The if seems okay: > > (src_start + i > pos && pos + i > src_start) > > which can be rewritten to: > > (pos < src_start + i && src_start < pos + i) > > Then the numbers are in one of these two orders: > > pos <= src_start < pos + i <= src_start + i > src_start <= pos < src_start + i <= pos + i > > These two would be allowed by the "if", but they can only happen if pos > == src_start so they degenerate to the same two orders above: > > pos <= src_start < src_start + i <= pos + i > src_start <= pos < pos + i <= src_start + i > > So it is a false positive in GCC. Disable the warning for now. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Cole Robinson <crobinso@redhat.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reported-by: Cole Robinson <crobinso@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/header.makefile: add "-Wno-stringop-truncation"Laszlo Ersek2018-03-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc-8 (which is part of Fedora 28) enables the new warning "-Wstringop-truncation" in "-Wall". This warning is documented in detail at <https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html>; the introduction says > Warn for calls to bounded string manipulation functions such as strncat, > strncpy, and stpncpy that may either truncate the copied string or leave > the destination unchanged. It breaks the BaseTools build with: > EfiUtilityMsgs.c: In function 'PrintMessage': > EfiUtilityMsgs.c:484:9: error: 'strncat' output may be truncated copying > between 0 and 511 bytes from a string of length 511 > [-Werror=stringop-truncation] > strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > EfiUtilityMsgs.c:469:9: error: 'strncat' output may be truncated copying > between 0 and 511 bytes from a string of length 511 > [-Werror=stringop-truncation] > strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > EfiUtilityMsgs.c:511:5: error: 'strncat' output may be truncated copying > between 0 and 511 bytes from a string of length 511 > [-Werror=stringop-truncation] > strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The right way to fix the warning would be to implement string concat with snprintf(). However, Microsoft does not appear to support snprintf() before VS2015 <https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010>, so we just have to shut up the warning. The strncat() calls flagged above are valid BTW. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Cole Robinson <crobinso@redhat.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: update DNS_DEVICE_PATH/URI_DEVICE_PATH definitionYonghong Zhu2018-03-051-3/+10
| | | | | | | | Update this two definition to align with MdePkg. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix byte orders when handling 8-byte arrayYonghong Zhu2018-03-031-1/+3
| | | | | | | | | | | | | | | | Per UEFI spec, FibreEx.WWN, FibreEx.Lun, SasEx.Address, SasEx.Lun and iSCSI.Lun are all 8-byte array with byte #0 in the left. It means "0102030405060708" should be converted to: UINT8[8] = {01, 02, 03, 04, 05, 06, 07, 08} or UINT64 = {0807060504030201} Today's implementation wrongly uses the reversed order. The patch fixes this issue by using StrHexToBytes(). Copy this solution from MdePkg Hash version d0196be. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix bug when converting iSCSI nodeYonghong Zhu2018-03-031-1/+1
| | | | | | | | | | If protocol string is not specified, default TCP(0) should be used. Today's implementation wrongly sets to 1 for this case. Copy the fix solution from MdePkg Hash version e6c80aea. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix the bug to search Fv.txt file relative to workspaceYonghong Zhu2018-03-031-6/+9
| | | | | | | | | | when the SECTION FV_IMAGE = $(XX)/XX.Fv, the Fv file should relative to WORKSPACE, so when we search the XX.Fv.txt file, we should search the path relative to workspace first. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Correct Structure Pcd value in the reportYonghong Zhu2018-03-031-9/+63
| | | | | | | | | The patch "Fixed build failed issue" changed structure Pcd Object, so we need update build report to correct structure Pcd Value. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Pcd Value override issue.Feng, Bob C2018-03-031-6/+8
| | | | | | | | | | For the case that the structure PCD has no value assignment in DSC, but has value assignment in command line. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fixed build failed issue.Feng, Bob C2018-03-031-7/+14
| | | | | | | | | | Case 1. A Pcd has no default sku setting in DSC. Case 2. Build as Single SKU. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fixed Pcd value override issue.BobCF2018-03-035-62/+157
| | | | | | | | | | | | | 1. Handle the Pcd maxsize issue for the case that the length of Pcd value from CommandLine bigger that its maxsize 2. The Pcd value override in commandline. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: DSC Components section support flexible PCDYunhua Feng2018-03-032-1/+17
| | | | | | | | | | | | | DSC Components section support flexible PCD, and for binary driver, we need patch this value. Update the split char ',' not ', ' because some value may have space, while others may not have this space. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Dsc/Fdf conditional statement parse issueFeng, YunhuaX2018-03-032-0/+8
| | | | | | | | | | Set PCD value with --pcd argument not replace DSC/Fdf PCD value. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: report error if flag in LABEL() invalidFeng, YunhuaX2018-03-021-4/+10
| | | | | | | | | | Flag in LABEL() is not valid C variable name, will report error. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Fix the bug for display incorrect *M flag in reportYonghong Zhu2018-03-021-10/+10
| | | | | | | | | | | The root cause is the byte array value in the driver Pcd, some bytes have additional space character, while the value in DSC file doesn't have this space, it cause the string compare return false, so we remove the extra space. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix eval parse string issueFeng, YunhuaX2018-03-021-4/+26
| | | | | | | | | | | | | | | | eval argument start with " or ', but it is unicode string, will encounter error: List = list(eval(Value)) # translate escape character File "<string>", line 1 'j??=????????F?? ^ SyntaxError: EOL while scanning string literal Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: GlobalData.gConfDirectory is None when run GenFdsFeng, YunhuaX2018-03-021-1/+3
| | | | | | | | | | | | When run GenFds, GlobalData.gConfDirectory is None, On Linux self._ToolChainFamily default Value is "MSFT", and then generate the wrong PcdValueInit Makefile Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Fix the bug for single module build with GenC/GenMakeYonghong Zhu2018-03-021-0/+8
| | | | | | | | copy the same logic from _BuildPa() function. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Align WIN_CERTIFICATE_UEFI_GUID definition to MdePkg one.Liming Gao2018-03-011-2/+2
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Enhance FV info report file path to support absolute pathYonghong Zhu2018-03-011-1/+7
| | | | | | | | | | | When generate build report, Tool will get the info like size, Fv Name, etc from the xx.Fv.txt file and add these info into the build report. This patch support the xx.Fv.txt to use absolute file path format since user may provide specified FV path. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Improve build performance of structure PCD value generationFeng, Bob C2018-02-282-103/+112
| | | | | | | | | Optimized the PcdValueInit.c size by abstract the common logic in the funciton. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTool: GUID format PCD value assignment fail in Structure PCD fieldBobCF2018-02-282-110/+182
| | | | | | | | | | If Structure PCD field is assigned as GUID format, its data type should be the fixed GUID structure. No flexible check is required. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Improve build performance of structure PCD value generationFeng, Bob C2018-02-283-84/+101
| | | | | | | | | | Add cache for building PcdValueInit.c. If PcdValueInit.c is not changed, it will not be regenerated. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fixed the pcd value override issue.Feng, Bob C2018-02-284-24/+44
| | | | | | | | | | | 1. the issue in the overriding value from command line. 2. dec fully value < dec field assign value < dsc fully value < dsc field assign value Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/tools_def: use separate PP definition for DTCArd Biesheuvel2018-02-282-8/+4
| | | | | | | | | | | | | | Clang's preprocessor behaves differently from GCC's, and produces intermediate device tree source that still contains #pragma pack() and other directives that the device tree compiler chokes on. For assembling device tree sources, it matters very little which preprocessor is being used, so let's just use GNU CPP explicitly. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix a bug override Pcd by DSC Components sectionYonghong Zhu2018-02-282-3/+17
| | | | | | | | | | | The case is: define a VOID* pcd in DEC file, eg: Value is {0x1}. then override this PCD on DSC component section, eg: Value is {0x1, 0x2, 0x3}, the max size of this PCD is calculate wrong which cause build error. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix report not used --pcd value incorrectlyFeng, YunhuaX2018-02-281-0/+1
| | | | | | | | | | | Argument --pcd gUefiOvmfPkgTokenSpaceGuid.test10=H"{1}", If the PCD is not used, report value {0x01, 0x00}, is incorrect. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Fix flexible PCD single quote and double quote bugsFeng, YunhuaX2018-02-285-65/+123
| | | | | | | | | | | | | | | | | | | | | | 1.The " and ' inside the string, must use escape character format (\", \') 2.'string' and L'string' format in --pcd, it must be double quoted first. Some examples that to match --pcd format and DSC format --pcd DSC format L"ABC" L"ABC" "AB\\\"C" "AB\"C" "AB\\\'C" "AB\'C" L"\'AB\\\"C\'" L'AB\"C' "\'AB\\\'C\'" 'AB\'C' H"{0, L\"AB\\\"B\", \'ab\\\"c\'}" {0, L"AB\"B", 'ab\"c'} Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Update GenFw to correct DebugEntry Offset when convert XIP imageLiming Gao2018-02-271-0/+6
| | | | | | | | | DebugEntry FileOffset is required to be updated to the virtual address if the input image is converted to XIP image. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Add more error message when PcdValue is wrongLiming Gao2018-02-271-0/+2
| | | | | | | | | | For structure PCD, its field name is wrong and cause build failure. Its build error message will output to let user aware what's wrong. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Feng Bob C <bob.c.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Resolve BaseTools C tool build failureLiming Gao2018-02-272-1/+4
| | | | | | | | | New GUID definition is conflicted with GUID in Windows Kits guiddef.h. GUID definition will be defined when it is undefined. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools:Override the MAKE_FLAGS by BuildOptions in DSCYonghong Zhu2018-02-271-0/+7
| | | | | | | | | The issue that *_*_*_MAKE_FLAGS doesn't work in DSC [BuildOptions] section. It means MAKE flags can't be set in platform DSC file. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools GenFv: Update error message to describe PE image alignmentLiming Gao2018-02-261-3/+3
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Add the missing basic definition in C BaseType.hLiming Gao2018-02-261-0/+25
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Add *B Flag for the field that from command lineYonghong Zhu2018-02-251-7/+3
| | | | | | | | | | For structure PCD, the field value may override in the command line, so in the report when we print the field info we add *B Flag for those field. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Update ValueExpressionEx for flexible PCDFeng, YunhuaX2018-02-251-75/+130
| | | | | | | | | | | 1. Byte array number should less than 0xFF. 2. Add SplitPcdValueString for PCD split Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools/Expression: Use 2nd passes on PCD valuesKinney, Michael D2018-02-251-1/+25
| | | | | | | | | | | | | | | | Use 2 passes when evaluating PCD values to discover all the LABEL() operators and compute the byte offset of each LABEL(). The 2nd pass then has the information to replace the OFFSET_OF() operator with the computed byte offset. The 2 passes allows OFFSET_OF() to be used before a LABEL() is declared. fixes:https://bugzilla.tianocore.org/show_bug.cgi?id=880 Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Fix the bug to display the single SKUID infoYonghong Zhu2018-02-231-0/+4
| | | | | | | | | | when defined SKUID_IDENTIFIER = DEFAULT|TEST in DSC [Defines] section, per spec it means current SKUID is single, the bug is build report print both DEFAULT and TEST info, it should only print TEST. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Add check for INF statement must be a .inf fileYonghong Zhu2018-02-231-1/+3
| | | | | | | | | Per FDF spec, INF statement must use a .inf file, we add this error check. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Add WindowsLike path in front of PATH EnvYonghong Zhu2018-02-231-1/+1
| | | | | | | | | | | Original BaseTools source build append WindowsLike path to PATH Env, while WINDDK installation has a "build.exe", if user place WINDDK folder to PATH either during WINDDK installation or manually, it will block the BaseTools' build.bat. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix VOID* type bugFeng, YunhuaX2018-02-101-0/+2
| | | | | | | | | | | Code miss UINT32 and UINT64 value type setting in VOID*, like as {UINT32({TRUE})} Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTool: correct the generate compress section processFeng, YunhuaX2018-02-091-8/+5
| | | | | | | | | | | First generate a dummy file with section alignment, then compress the dummy file to generate the compress file Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Update Expression.py for string comparison and MACRO replace issueYunhua Feng2018-02-093-31/+13
| | | | | | | | | | | | 1. Fix string comparison incorrect issue, we expected "ABC" is greater than "AAD" since the second char 'B' is greater than 'A'. 2. fix MACRO not replace issue. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>