summaryrefslogtreecommitdiffstats
path: root/BaseTools
Commit message (Collapse)AuthorAgeFilesLines
* BaseTools/GenMake: Sort generated makefile tool definitionsMichael D Kinney2021-04-271-4/+8
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3353 Sort the tool definition content of generated makefiles to help verify that makefile contents have not changed after BaseTools code changes. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
* BaseTools/Source/Python: Verify TAB_TOD_DEFINES_FAMILY key presentMichael D Kinney2021-04-232-5/+15
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3344 Veify that TAB_TOD_DEFINES_FAMILY key is present in ToolDef dictionary before access. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/Conf/tools_def.template: Remove redundant MAKE statementsMichael D Kinney2021-04-191-55/+0
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3337 Remove redundant MAKE_PATH and MAKE_FLAGS statements for VS20xx tool chains. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
* BaseTools/Source/Python: Remove CPU architecture assumptionsMichael D Kinney2021-04-153-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3308 The EDK II Build Specifications do not restrict the set of CPU architectures that can be supported. Remove places in the EDK II that assume a fixed set of CPU architectures. Remove build breaks in the following tools when a check against a fixed set of CPU architectures is made. * Build * GenFds * TargetTool Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Andrew Fish <afish@apple.com> Cc: Abner Chang <abner.chang@hpe.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/Source/C: Remove CPU architecture assumptionsMichael D Kinney2021-04-152-6/+4
| | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3308 The EDK II Build Specifications do not restrict the set of CPU architectures that can be supported. Remove places in the EDK II that assume a fixed set of CPU architectures. Remove build breaks in the following tools when a check against a fixed set of CPU architectures is made. * GenFw Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Andrew Fish <afish@apple.com> Cc: Abner Chang <abner.chang@hpe.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/PlatformAutoGen: MAKE_FLAGS and MAKE_PATH fixesMichael D Kinney2021-04-141-15/+21
| | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3312 Update parsing of MAKE_FLAGS in DSC [BuildOptions] sections to split the flags into a list to be compatible with running the make command using Popen(). Parsing MAKE_FLAGS from tools_def.txt already uses _SplitOption(). This change uses the same _SplitOption() method for MAKE_FLAGS from a DSC [BuildOptions] section. Also update the parsing of MAKE_PATH to support MAKE_PATH from tools_def.txt or the DSC [BuildOptions] section. MAKE_PATH in DSC [BuildOptions] section is higher priority than MAKE_PATH in tools_def.txt. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/Conf: Fix MAKE_FLAGS typos in tools_def.templateMichael D Kinney2021-04-121-8/+8
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3313 Change MAKE_FLAG to MAKE_FLAGS to match required name from EDK II Build Specifications for VS20xx tool chains. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
* BaseTools/Ecc: Make Ecc only check first include guardPierre Gondois2021-03-181-3/+5
| | | | | | | | | | | The Ecc tool checks the format of the include guard. This check is currently done on all the names following the '#ifndef' statement. It should only be done on the first include guard. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3252 Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Modify struct parser for StructPcdYuwei Chen2021-03-081-0/+2
| | | | | | | | | | | Currently the struct parser for StructPcd Generation does not filter the types such as UINT8 which should be ignored successfully. This patch modifies this issue. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Adjust StructurePcd List Order.Chen, Christine2021-03-081-3/+26
| | | | | | | | | | | | | | | | | | | | | | Currently StructurePcd.dsc have the list order issue. For a Pcd with several elements, the list indexs are used to distinguish these elements like this: PcdName.name.offset_name[0]|0x0 PcdName.name.offset_name[10]|0x0 PcdName.name.offset_name[11]|0x0 ... PcdName.name.offset_name[2]|0x0 ... However, the index is not strictly sorted by decimal numerical order, which is not user friendly. One more sort rule for index is added to the current rules to support for decimal numerical order in this patch. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Update the NASM CI dependencyBret Barkelew2021-03-081-1/+1
| | | | | | | | | | | | | | | Update the external dependency (consumed by Edk2Tools) version for NASM, as agreed in recent community meetings: https://edk2.groups.io/g/devel/message/71289 https://edk2.groups.io/g/devel/message/71070 This is primarily used by CI builds, but may also be used by platforms. Signed-off-by: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Align include guards policyPierre Gondois2021-02-262-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | The EDK II C Coding Standards Specification states that: "Names starting with one or two underscores, such as _MACRO_GUARD_FILE_NAME_H_, must not be used. They are reserved for compiler implementation." [1] The Ecc tool currently checks that the include guard end with a trailing underscore. Thus, the check and the error message should both be modified. The new check forces having one sole trailing underscore character, as the example in the specification shows: "FILE_NAME_H_" [1] This would allow to have more consistency. [1] Section 5.3.5 "All include file contents must be protected by a #include guard": https://edk2-docs.gitbook.io/ edk-ii-c-coding-standards-specification/5_source_files/53_include_files Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <Sami.Mujawar@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Fix BrotliCompress run issue on LinuxYunhua Feng2021-02-223-31/+54
| | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3210 BrotliCompress changed, but not completely on Linux Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Fix the ending character for Linux script BuildEnvBob Feng2021-02-101-12/+12
| | | | | | | | | | | Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Matthew Carlson <matthewfcarlson@gmail.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* BaseTools: Use pip module if available, CI uses it by defaultMatthew Carlson2021-02-0953-2/+714
| | | | | | | | | | | | | | | Use the new edk2-basetools pip module. Includes a helpful message in setup to let users know which has been selected. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Yuwei <Chen<yuwei.chen@intel.com> Signed-off-by: Matthew Carlson <matthewfcarlson@gmail.com>
* BaseTools: fix the split output files root dirBob Feng2021-02-072-75/+87
| | | | | | | | | | | | | | | | | If the output file path is a relative path, the split tool will create the output file under the input file path. But the expected behavior for this case is the output file should be relative to the current directory. This patch will fix this bug. If the output file path is not specified and output prefix is not specified, the output file should be under the input file path Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Acked-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
* BaseTools: Ecc/exception: Added _ModuleEntryPoint into exception listKun Qin2021-02-011-0/+4
| | | | | | | | | | | | | | | Function '_ModuleEntryPoint' is a pre-defined interface for various EFI module types and should not be caught violating EFI coding style. This change added '_ModuleEntryPoint' into exception list to fix EFI coding style error 8006 during CI build. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Kun Qin <kun.q@outlook.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Add unittest for Split toolBob Feng2021-01-211-0/+111
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3165 This patch is to add the unit test for Split python tool Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
* BaseTools: Convert Split tool to pythonBob Feng2021-01-219-524/+223
| | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3165 There are 2 reasons to convert Split tool from C to Python. 1. We are in the process of moving the Basetools Python code to a separate repository. But there still are many C tools under edk2/BaseTools. To make all Basetools be in the separate repo, we can convert the C tools to Python tools. 2. The original Split tool is very slow. This python tool can reduce 90% time. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
* BaseTools: Fix the build report crash issueBob Feng2021-01-141-7/+9
| | | | | | | | | | | | | | | | In the following corner case, the build report will crash. This patch is to fix this problem. Case: Multiple SKU are used and 2 more DynamicHii structure Pcds are set in dsc file under different SKU. And 1 more of those Pcds are not used in any INF file. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Yuwei Chen<yuwei.chen@intel.com>
* BaseTools LzmaCompress: Update LZMA to new 19.00 versionLiu, WeiX C2021-01-0812-575/+877
| | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3101 New formal release in https://www.7-zip.org/sdk.html is 19.00. Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Wei Liu <weix.c.liu@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools/CommonLib.h: Build failed due to MAX_LONG_FILE_PATHEnze Zhu2021-01-061-0/+8
| | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3032 We had a build fail due to the hard coded MAX_LONG_FILE_PATH value. We should use PATH_MAX if it is available. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Enze Zhu <zhuenze@byosoft.com.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fix the improper error loggingIrene Park2021-01-061-1/+1
| | | | | | | | | EdkLogger.ERROR() was replaced with EdkLogger.error() to deliver the expected error message when an error occurs. Signed-off-by: Irene Park <ipark@nvidia.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Fix the issue caused by tostring() removal on Py39Bob Feng2021-01-061-3/+20
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3136 Python 3.9 remove the array.array.tostring and array.array.fromstring() function. This patch is to use other method to replace tostring() and fromstring() Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Mingyue Liang <mingyuex.liang@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Should always define PCD TOKEN value as Zero for static PCDYunhua Feng2020-12-231-2/+1
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3120 FixedAtBuild, PatchableInModule and FeatureFlag PCD don't use PCD TOKEN. Their PCD TOKEN value can always be zero. AutoGen.h will not be changed when static PCD is added or removed. Dynamic PCD add or remove will still cause dynamic PCD token value be changed. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/EfiRom: remove redundant checking of argcwenyi,xie via groups.io2020-12-221-1/+1
| | | | | | | | | | | As the condition of while statement is argc > 0, so argc < 1 will always be false, it's redundant. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/GenFfs: Optimazing else if statementwenyi,xie via groups.io2020-12-221-6/+5
| | | | | | | | | | | When Alignment < 0x400 is false, the expression of Alignment >= 0x400 is always true. So extract the expression from the else if statement. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Correct report the line number in INF file issueYunhua Feng2020-12-221-1/+1
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3127 If one protocol is not found in package dec file, Build will report the error message that module.inf(-1): error 4000: Value of Protocol [gXxxProtocolGuid] is not found under [Protocols] section in MdePkg.dec. Here, -1 should be the line number of this protocol in module INF file. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/Ecc: Allow init of function static variablesPierre Gondois2020-12-221-1/+1
| | | | | | | | | | The Ecc tool currently reports the initialization of variables at declaraton if the variable is non-constant and declared in a function. Static variables locally defined in functions should also be allowed to be initialized at declaration. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Fix crash in ECC when parsing incorrect headerSami Mujawar2020-12-221-1/+4
| | | | | | | | | | | | | | | | | | | | | The ECC tool crashes if a C file has an incorrect file header format. The file ArmPkg\Library\ArmMmuLib\AArch64\ArmMmuPeiLibConstructor.c has a file header in the incorrect format. It uses # to mark the header comments instead of enclosing the file header in /* */. This may have been a result of an INF file header being copied to a C file. A separate patch fixes the C file but ECC tool should not crash if a file with an incorrect header is found. Therefore, update the ECC tool to prevent it from crashing if an incorrect file header is found. With this change the ECC tool will report the incorrect header issue without crashing. Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Add comments in StructurePcd DSC file.Chen, Christine2020-12-151-3/+12
| | | | | | | | | | | | | | Currently VFR files have variables comments which will not be added into StructurePcd.dsc file. Thus, it is not convenient for developer to Modify Pcds. To solve this problem, The comments will be modified to user friendly format and added after the corresponding Pcd values in StructurePcd.dsc file. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Collect full Header files for struct finding.Chen, Christine2020-11-301-6/+19
| | | | | | | | | | | | Currently, only parts of the Header files can be collected which caused some struct definition can not be found. To solve this issue, Header files full collection has been added in this file to support the struct finding. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Resolve index out of range errors.Mingyue Liang2020-11-191-1/+2
| | | | | | | | | | | | | | | | | | | | This problem is generated by solving bz2972's patch, and the commit ID is 0af7f8e6a9253960ba820cd6ddfd8c36543d30cb. This is a problem when updating the DEPs file. The code does not consider that there is only one line of content in the file, so the filter condition is added to prevent the index from exceeding the range. Signed-off-by: Mingyue Liang <mingyuex.liang@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Fix BrotliCompress tool issueYunhua Feng2020-11-134-59/+576
| | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2946 This is the regression issue in BaseTools BrotliCompress after Brotli is changed to submodule. BrotliCompress should store the source size and scratch buffer size into the header of the compressed binary data. But now, BrotliCompress doesn't store them. So, BrotliDecompress can't work. To fix this issue, BrotliCompress tool main() function should be provided. It needs to support the options of -e, -d, -o file, -g gap, -q level. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools/VfrCompile: VFR compiler supports REST_STYLE in HII optionAbner Chang2020-11-111-3/+22
| | | | | | | | | | | | | | | | | | Add REST_STYLE support on VFR language BZ: 2916 https://bugzilla.tianocore.org/show_bug.cgi?id=2916 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Signed-off-by: Ye Ting <ting.ye@intel.com> Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Signed-off-by: Wang Fan <fan.wang@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Nickle Wang <nickle.wang@hpe.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Limit command line length.Mingyue Liang2020-11-102-9/+44
| | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2528 Currently, CL command contains multiple C files will be compiled, and that caused command line too long, which may trigger build error. In order to solve this issue, the following rules is used in this scene: If the number of C files is greater than one, a txt file will be used to record these C files, and replaces the corresponding content in command line with the file name. Else (only one C file listed in the command line), the length of the whole CL command line will determine whether use a file to record. If the length exceeds the limited max length, use the recording file; else C file name directly listed in the command line Signed-off-by: Mingyue Liang <mingyuex.liang@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Update report map file formatYunhua Feng2020-11-101-1/+1
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2977 For a source-level BIOS debugger the .map files are quite useful with one major shortcoming: the debugger cannot know, solely from the .map file, the format (PE/COFF vs. TE) of the image included in the final BIOS ROM Update report map file format Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Add image type into generate map fileYunhua Feng2020-11-101-1/+6
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2977 For a source-level BIOS debugger the .map files are quite useful with one major shortcoming: the debugger cannot know, solely from the .map file, the format (PE/COFF vs. TE) of the image included in the final BIOS ROM Add Type=PE or TE in the map file Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Incremental build issue for included ASI file's deletion.Mingyue Liang2020-11-101-2/+1
| | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2972 When using incremental build to delete an included xxx.asi file from the ASL file, the xxx.asl.trim.deps file generated by previous build process will not be deleted from the OUTPUT directory, which caused the dependency file still include the xxx.asl.trim.deps file. If the include file is deleted and DEPs is empty. Signed-off-by: Mingyue Liang <mingyuex.liang@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fix BaseTools nmake cleanall hang issuefengyunhua2020-11-061-1/+4
| | | | | | | | | | | | | | | | | On windows system, when use command chcp displays the number of the active console code page, if the active console code is 936, run make cleanall in the BaseTools will hang. Issue reproduce step: chcp 936 edksetup.bat VS2015 cd BaseTools nmake cleanall Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Enable Module Scope Structure PcdBob Feng2020-11-057-74/+326
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2648 This patch is to enable the Module scoped Structure Pcd usage. User can set structure pcd field value in module scope. For example, under the [components] section of a dsc file, user can override some field value for a specific module. Package/Module.inf{ <PcdsFixedAtBuild> gUefiTokenSpaceGuid.StructurePcdModule.FieldName | 5 } Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Tested-by: Liming Gao <gaoliming@byosoft.com.cn> Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Remove the dependency on the build intermediate fileBob Feng2020-11-041-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | When generating compressed section, the build tool rely on the build intermediate files, which were generated in last build, to get the file list. This method will cause the incremental build to generate incorrect build result. To reproduce this incremental build error, you can do: 1. build Ovmf 2. change the module OvmfPkg\AcpiTables a source file Facp.aslc name from Facp.aslc to Facpxxx.aslc. 3. change the Facp.aslc file name in [sources] section of AcpiTables.inf 4. incremental build Ovmf you will see the in AcpiTables module Makefile, the corresponding Facp.acpi file is not changed. This patch is to make the build always get file list from the INF. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Update the FV Space Information to display decimal and Hexfengyunhua2020-11-031-1/+4
| | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3009 Update the FV Space Information to display decimal and Hex FV Space Information before format: SECFV [13%Full] 212992 total, 28400 used, 184592 free Updated format: SECFV [13%Full] 212992 (0x34000) total, 28400 (0x6ef0) used, 184592 (0x2d110) free Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools/Ecc: Fix ECC check MetaFile Copyright information issueYunhua Feng2020-10-271-1/+5
| | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3011 MetaFile Copyright support below format: # Copyright (C) 2020 Hewlett Packard Enterprise Development LP<BR> # (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Fix PcdValueInit tool build issue with VS compiler x64Bob Feng2020-10-261-1/+1
| | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3001 When the 64-bit version of VS compiler is used, the generated PcdValueInit tool will be failed to compile. This patch is going to fix that issue. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Reviewed-by: Sean Brogan <sean.brogan@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Add EDKII_DSC_PLATFORM_GUID MACROfengyunhua2020-10-131-0/+3
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2969 Add EDKII_DSC_PLATFORM_GUID MACRO to AutoGen.h and AutoGen.c Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Tested-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools Build_Rule: Add the missing ASM16_FLAGS for ASM16 source filegaoliming2020-10-101-1/+1
| | | | | | | Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Move C tool flags before the common flagsgaoliming2020-10-102-2/+2
| | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2938 C tool may add the additional INC include path. They should have high priority than the common INC include path. This fix is to resolve the structure PCD issue to refer to the same header file defined in BaseTools and MdePkg. The one in MdePkg should be used. Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Yuwei Chen<yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Tested-by: Garrett Kirkendall <garrett.kirkendall@amd.com>
* BaseTools: Copy PACKED definition from MdePkg Base.hgaoliming2020-10-101-0/+10
| | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2938 MdePkg Acpi10.h definition depends on PACKED. When structure PCD refers to Acpi10.h, build will fail, because PACKED definition is missing in BaseTools BaseTypes.h. C source tools include BaseTools BaseTypes.h. They don't include MdePkg Base.h. When C source tools include MdePkg Acpi10.h, they also need PACKED definition. So, add PACKED definition into BaseTools BaseTypes.h. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Tested-by: Garrett Kirkendall <garrett.kirkendall@amd.com>
* BaseTools: Add RISCV64 bindingNikita2020-09-293-0/+94
| | | | | | | | | | - Add RISCV64 ProcessorBind.h - Add RISCV64 to Makefiles Signed-off-by: Nikita Ermakov <sh1r4s3@mail.si-head.nl> Ack-by: Liming Gao <gaoliming@byosoft.com.cn> Acked-by: Abner Chang <abner.chang@hpe.com>