summaryrefslogtreecommitdiffstats
path: root/BaseTools
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* BaseTools: Set section alignment as zero if its type is AutoBob Feng2020-09-252-16/+2
| | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2881 Currently, the build tool try to read the section alignment from efi file if the section alignment type is Auto. If there is no efi generated, the section alignment will be set to zero. This behavior causes the Makefile to be different between the full build and the incremental build. Since the Genffs can auto get the section alignment from efi file during Genffs procedure, the build tool can just set section alignment as zero. This change can make the autogen makefile consistent for the full build and the incremental build. 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: Remove CanSkip calling for incremental buildBob Feng2020-09-251-3/+0
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2978 If a module add a new PCD, the pcd token number will be reassigned. The new Pcd token number should be updated to all module's autogen files. CanSkip can only detect a single module's change but not others. CanSkip block the pcd token number update in incremental build, so this patch is going to remove this call. 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: Yuwei Chen<yuwei.chen@intel.com>
* BaseTools: Normalize case of pathname when evaluating Macros.Mingyue Liang2020-09-251-2/+4
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2880 Currently, When doing the Incremental build, the directory macros extended to absolute path in output Makefile, which is inconsistent with the output of Clean build. When we do macro replacement, we can't replace macro due to inconsistent path case, which results in inconsistent display of incremental build and clean build in makefile.Therefore, the path is converted to achieve the correct macro replacement. 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> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
* BaseTools: Clean the ffs folder before generating files in itBob Feng2020-09-251-0/+3
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2965 The content in Guid.xref depends on the files under the corresponding ffs folder.(refer to the commit 5e9256cd7f54ffd6f1fd9837df92a911fcd2d7c2) To make Guid.xref update in the incremental build, clean the files under that ffs folder before generating files in it. 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: Yuwei Chen<yuwei.chen@intel.com>
* BaseTools: Add included files to deps_target file.Mingyue Liang2020-09-251-3/+1
| | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2882 After changing the name of the include source file, when doing incremental build, the previous source file is not covered in the. DEPs file, and a build error occurs. The root cause is that the build tools filter out some dependency files, which are listed in inf source section, from the deps_target file. Add those files back to deps_target file to resolve the above problem. 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> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
* BaseTools: update IASL extdep to more modern versionMatthew Carlson2020-09-161-3/+3
| | | | | | | | | | | | | | | The IASL extdep is used for CI only and a recent fork of the ACPICA repo was made to make nuget builds more regular and easier to audit. https://dev.azure.com/projectmu/_git/acpica Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Matthew Carlson <matthewfcarlson@gmail.com>
* BaseTools: Sort the Pcd set when generating the VPD binaryBob Feng2020-09-082-2/+2
| | | | | | | | | | | | | | If VPD PcdNvStoreDefaultValueBuffer is used, all DynamicHii and DynamicExHii PCD value will be generated into that VPD. In order to generate the same VPD binary file in every build, sort the Pcd set when generating VPD. 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: Philippe Mathieu-Daude <philmd@redhat.com>
* BaseTools/Ecc: Fix an issue of path separator compatibilityBob Feng2020-09-011-4/+4
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2904 The path separator is different in Windows and Linux, the original code does not handle this difference. This patch is to fix this 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: Shenglei Zhang <shenglei.zhang@intel.com> Message-Id: <20200901102315.38840-1-bob.c.feng@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Fix the issue in VS2017/VS2019 settingLiming Gao2020-08-141-0/+4
| | | | | | | | | | edksetup.bat VS2017 should set VS2017 only. But now, it will set VS2017/VS2019 both. This patch corrects it. Signed-off-by: Liming Gao <liming.gao@intel.com> 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: Fix the issue in VS prefix setting for VS2017/VS2019Liming Gao2020-08-141-0/+6
| | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2896 When VS2017/VS2019 are both installed. VS prefix setting will wrongly be set. VS2017_PREFIX is set to the same value of VS2019. This patch clears VSINSTALLDIR and VCToolsVersion env, then the different vcvars32 can set the correct VS env. Signed-off-by: Liming Gao <liming.gao@intel.com> 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 VS2019 env setting after VS2017 env settingLiming Gao2020-08-141-23/+23
| | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2896 Keep the latest VS version as the last one Signed-off-by: Liming Gao <liming.gao@intel.com> 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: Work around array.array.tostring() removal in python 3.9Cole Robinson2020-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | In python3, array.array.tostring() was a compat alias for tobytes(). tostring() was removed in python 3.9. Convert this to use tolist() which should be valid for all python versions. This fixes this build error on python3.9: (Python 3.9.0b5 on linux) Traceback (most recent call last): File "/root/edk2/edk2-edk2-stable202002/BaseTools/BinWrappers/PosixLike/../../Source/Python/Trim/Trim.py", line 593, in Main GenerateVfrBinSec(CommandOptions.ModuleName, CommandOptions.DebugDir, CommandOptions.OutputFile) File "/root/edk2/edk2-edk2-stable202002/BaseTools/BinWrappers/PosixLike/../../Source/Python/Trim/Trim.py", line 449, in GenerateVfrBinSec VfrUniOffsetList = GetVariableOffset(MapFileName, EfiFileName, VfrNameList) File "/root/edk2/edk2-edk2-stable202002/BaseTools/Source/Python/Common/Misc.py", line 88, in GetVariableOffset return _parseForGCC(lines, efifilepath, varnames) File "/root/edk2/edk2-edk2-stable202002/BaseTools/Source/Python/Common/Misc.py", line 151, in _parseForGCC efisecs = PeImageClass(efifilepath).SectionHeaderList File "/root/edk2/edk2-edk2-stable202002/BaseTools/Source/Python/Common/Misc.py", line 1638, in __init__ if ByteArray.tostring() != b'PE\0\0': AttributeError: 'array.array' object has no attribute 'tostring' Signed-off-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: fix ucs-2 lookup on python 3.9Cole Robinson2020-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | python3.9 changed/fixed codec.register behavior to always replace hyphen with underscore for passed in codec names: https://bugs.python.org/issue37751 So the custom Ucs2Search needs to be adapted to handle 'ucs_2' in addition to existing 'ucs-2' for back compat. This fixes test failures on python3.9, example: ====================================================================== FAIL: testUtf16InUniFile (CheckUnicodeSourceFiles.Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/edk2-edk2-stable202002/BaseTools/Source/Python/AutoGen/UniClassObject.py", line 375, in PreProcess FileIn = UniFileClassObject.OpenUniFile(LongFilePath(File.Path)) File "/builddir/build/BUILD/edk2-edk2-stable202002/BaseTools/Source/Python/AutoGen/UniClassObject.py", line 303, in OpenUniFile UniFileClassObject.VerifyUcs2Data(FileIn, FileName, Encoding) File "/builddir/build/BUILD/edk2-edk2-stable202002/BaseTools/Source/Python/AutoGen/UniClassObject.py", line 312, in VerifyUcs2Data Ucs2Info = codecs.lookup('ucs-2') LookupError: unknown encoding: ucs-2 Signed-off-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Move CreateAsBuiltInf into AutoGenWorker for parallelBob Feng2020-08-142-4/+2
| | | | | | | | | | | AsBuiltInf can be created during AutoGen phase. Move CreateAsBuiltInf into AutoGenWorker to make this step run in parallel. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Improve the method of checking queue emptyFeng, Bob C2020-08-072-7/+22
| | | | | | | | | | | | | | | | | | Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2807 The Queue.empty() method is not reliable in the multiple process runtime environment. This patch uses a new method to check if all modules are processed and workers need to be stopped. That is to add a None item at the bottom of the queue. Worker check if it gets that None item to know if all the module is processed. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Lucy Yan <lucyyan@google.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/VolInfo: Fix spelling mistakeMichael D Kinney2020-08-051-1/+1
| | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2349 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: Bob Feng <bob.c.feng@intel.com>
* BaseTools/GenSec: Fix spelling mistakeMichael D Kinney2020-08-031-1/+1
| | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2345 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>
* Revert "BaseTools/PatchCheck.py: Add LicenseCheck"Leif Lindholm2020-07-311-50/+0
| | | | | | | | | | | | | This reverts commit a4cfb842fca9693a330cb5435284c1ee8bfbbace. This commit suggests inclusion of non-edk2+license content without a contribution agreement is something the community has made a decision on, which is incorrect. Cc: Shenglei Zhang <shenglei.zhang@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/PeCoffLoaderEx: Remove the unused local variableAbner Chang2020-07-291-3/+0
| | | | | | | | | | | | | BZ:2864 GCC build fails due to variable self assignment. This local variable is not used at any where, we can just remove it. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* Revert "BaseTools: Add gcc flag to warn on void* pointer arithmetic"Bob Feng2020-07-241-3/+3
| | | | | | | | | | | | | | | | | This reverts commit dbd546a32d5abe225306e22d43a7d86e3a042eee. This patch also breaks about half of the ARM/AARCH64 platforms in edk2-platforms Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Pierre Gondois <pierre.gondois@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.Jiang, Guomin2020-07-241-1/+1
| | | | | | | | | | | If the submodule is upgraded, skip the CRLF check as it isn't change for file. Signed-off-by: Guomin Jiang <guomin.jiang@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fix binary file not generate map file issueFeng, YunhuaX2020-07-231-1/+1
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2624 When EFI file come from binary file, not generate .map file, so need ignore the map file. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* Using LLVM compiler set to build BaseTools in LinuxLiu, Zhiguang2020-07-214-4/+32
| | | | | | | | | | | | | | | Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2842 To use LLVM to build BaseTools, first set the CLANG_BIN environment value, and add "CXX=llvm" to choose LLVM compiler set when using make command. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Yuwei Chen<yuwei.chen@intel.com>
* BaseTools: Remove the file timestamp checking during parsingBob Feng2020-07-212-26/+2
| | | | | | | | | | | | During build, the meta files are not changed, so it's no need to check file timestamp. This patch is to remove useless logic. 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: rename ReadMe.txt to ReadMe.rstRebecca Cran2020-07-211-0/+0
| | | | | | | | | | The ReadMe file is now RST, so update the filename extension to match. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Update ReadMe.txt to match current functionalityRebecca Cran2020-07-211-22/+16
| | | | | | | | | | | | ReadMe.txt contained outdated information. Update it to match current functionality (e.g. sqlite3 is no longer used), and convert the formatting from ad-hoc to reStructuredText. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Factorize GCC flagsPierre Gondois2020-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | GCC48_ALL_CC_FLAGS has no dependency on GCC_ALL_CC_FLAGS. By definition, there should be such dependency. The outcomes of this patch is that GCC48_ALL_CC_FLAGS and other dependent configurations will inherit from the additional "-Os" flag. The "-Os" flag optimizes a build in size, not breaking any build. In a gcc command line, the last optimization flag has precedence. This means that this "-Os" flag will be overriden by a more specific optimization configuration, provided that this more specific flag is appended at the end of the CC_FLAGS. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Suggested-by: Tomas Pilar <Tomas.Pilar@arm.com> Reviewed-by: Bob Feng<bob.c.feng@intel.com>
* BaseTools: Add gcc flag to warn on void* pointer arithmeticPierre Gondois2020-07-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | By default, gcc allows void* pointer arithmetic. This is a GCC extension. However: - the C reference manual states that void* pointer "cannot be operands of addition or subtraction operators". Cf s5.3.1 "Generic Pointers"; - Visual studio compiler treat such operation as an error. To prevent such pointer arithmetic, the "-Wpointer-arith" flag should be set for all GCC versions. The "-Wpointer-arith" allows to: "Warn about anything that depends on the "size of" a function type or of void. GNU C assigns these types a size of 1, for convenience in calculations with void * pointers and pointers to functions." This flag is available since GCC2.95.3 which came out in 2001. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Bob Feng<bob.c.feng@intel.com>
* BaseTools/PatchCheck.py: Skip length check for user name in xxx-byShenglei Zhang2020-07-201-1/+8
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2836 Current PatchCheck.py checks each line to ensure line's length is not larger than 76. But there's a case that length of user's name is much longer than that number. So enhance the script to handle this case. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Yuwei Chen<yuwei.chen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Add Guid name support in GenFfs.Yuwei Chen2020-07-173-1/+38
| | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2762 The Fv Section in the FDF files use hard coding Guid values which is inconvenient to manage. This patch adds Guid name support in GenFfs to solve this problem. Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng<bob.c.feng@intel.com>
* BaseTools/Python: Allow HOST_APPLICATION to use NULL librariesMichael D Kinney2020-07-151-2/+2
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2797 Update HOST_APPLICATION module type to use NULL library instances. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Sean Brogan <sean.brogan@microsoft.com> Reviewed-by: Liming Gao <liming.gao@intel.com>