summaryrefslogtreecommitdiffstats
path: root/BaseTools
Commit message (Collapse)AuthorAgeFilesLines
* BaseTools: Enable the flag to treat dynamic pcd as dynamicExBob Feng2021-07-125-131/+73
| | | | | | | | | | | | | | | | | | | | Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1688 In order to support binary build, build tool add a flag to convert type of Dynamic Pcd to DynamicEx Pcd User can append -D PCD_DYNAMIC_AS_DYNAMICEX to build command to enable this function. Also, user can add "PCD_DYNAMIC_AS_DYNAMICEX = TRUE/FALSE" to the defines section of Dsc file to enable this function. PCD_DYNAMIC_AS_DYNAMICEX is a new reserved key word for this function. 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: Michael D Kinney <michael.d.kinney@intel.com> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Remove non-ascii character of StructurePcd commentChen, Christine2021-07-121-1/+9
| | | | | | | | | | | | | Currently, the ConvertFceToStructurePcd.py tool generate StructurePcd dsc file with comments from UNI file including non-ascii character. Following DSC spec, there should not have non-ascii character in DSC file. This patch removes the non-ascii character when adding the comment and changes the circle R to (R). Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/Scripts: Ignore Mergify merge commits in PatchCheck.pyMichael D Kinney2021-07-091-6/+12
| | | | | | | | | | | | | | | | Mergify adds merge commits to a PR when processing PRs using the queue feature with auto rebase. Update PatchCheck.py to ignore commit message issues with these merge commits. These merge commits are not added to the base branch when the PR is merged by Mergify. 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: Bret Barkelew <bret.barkelew@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools GenFw: Add support for RISCV GOT/PLT relocationsSunil V L2021-06-291-6/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3096 This patch adds support for R_RISCV_CALL_PLT and R_RISCV_GOT_HI20 relocations generated by PIE enabled compiler. This also needed changes to R_RISCV_32 and R_RISCV_64 relocations as explained in https://github.com/riscv/riscv-gnu-toolchain/issues/905#issuecomment-846682710 Testing: 1) Debian GCC 8.3.0 and booted sifive_u and QMEU virt models. 2) Debian 10.2.0 and booted QEMU virt model. 3) riscv-gnu-tool chain 9.2 and booted QEMU virt model. Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> Acked-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com> Tested-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
* BaseTools: Reset ERRORLEVEL in toolsetup.bat after edk2basetools checkRebecca Cran2021-06-251-0/+2
| | | | | | | | | | | | | | When using the in-source BaseTools, edksetup.bat will exit with an ERRORLEVEL of 1 because the line in toolsetup.bat "%PYTHON_COMMAND% -c "import edk2basetools" >NUL 2>NUL" fails. Ensure ERRORLEVEL is set to 0 when edksetup.bat or toolsetup.bat is successfully run. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Fix spelling of "overwrite" and "overwriting" in toolset.batRebecca Cran2021-06-251-3/+3
| | | | | | | | | The words "overwrite" and "overwriting" are one word and shouldn't have hyphens. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Remove check for Split.exe in toolset.batRebecca Cran2021-06-251-1/+0
| | | | | | | | | | Split is now a Python tool, so BaseTools\Bin\Win32\Split.exe no longer exists. Remove the check for it from toolsetup.bat to prevent the erroneous claim that the binary C tools are missing. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools GenFw: Keep read only alloc section as text when convert ELFgaoliming2021-06-162-2/+4
| | | | | | | | | | | | This is the fix of the regression issue at c6b872c6. Based on ELF spec, readonly alloc section is .rodata section. It is used. This fix is to add back original check logic for ELF section. Now, the readonly alloc section and execute alloc section are regarded as .text. Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Ray Ni <ray.ni@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools GenFw: Fix regression issue to convert the image to ACPI dataLiming Gao2021-06-062-2/+2
| | | | | | | | | | | | | | | | | Commit c6b872c updates GenFw base code attribute to find .text section. With GCC49 tool chain, aslc file is compiled into elf image. But, its text section has no CODE attribute. So, it can't be detected by new GenFw tool.For this type file. its text section is not required. Its data section will be converted to acpi table. This fix is to remove assert check when the generated image is ACPI data. Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Tested-by: Leif Lindholm <leif@nuviainc.com>
* BaseTools: Change CLANG8ELF to CLANGDWARFNi, Ray2021-06-041-90/+91
| | | | | | | | | | | | | CLANGDWARF is more proper because it's similar to CLANGPDB that generates PE images but with DWARF debug symbols. This toolchain is needed for creating ELF format universal payload that follows https://universalpayload.github.io/documentation/. Signed-off-by: Ray Ni <ray.ni@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: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Update ClangBase.lds to keep dynamic sectionNi, Ray2021-06-041-3/+2
| | | | | | | | | | The .dynamic section is needed for ELF runtime relocation. Signed-off-by: Ray Ni <ray.ni@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: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Add new CLANG8ELF tool chain for new LLVM/CLANG8Liming Gao2021-06-041-0/+102
| | | | | | | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1603 LLVM/CLANG8 formal release http://releases.llvm.org/download.html#8.0.0 It can be downloaded and installed in Windows/Linux/Mac OS. CLANG8ELF tool chain is added to generate ELF image, and convert to PE/COFF. On Windows OS, set CLANG_HOST_BIN=n, set CLANG8_BIN=LLVM installed directory For example: set CLANG_HOST_BIN=n # use windows nmake set CLANG8_BIN=C:\Program Files\LLVM\bin\ On Linux/Mac, set CLANG8_BIN=LLVM installed directory This tool chain can be used to compile the firmware code. On windows OS, Visual Studio is still required to compile BaseTools C tools and nmake.exe. On Linux/Mac OS, gcc is used to compile BaseTools C tools. make is used for makefile. This tool chain is verified on OVMF Ia32, X64 and Ia32X64 to boot Shell. This tool chain is verified in Windows/Linux and Mac OS. Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Feng Bob C <bob.c.feng@intel.com>
* BaseTools: Update build_rule to skip CLANG resource section generationLiming Gao2021-06-041-3/+2
| | | | | | | LLVM/CLANG doesn't support resource section generation when ELF image generated. Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Feng Bob C <bob.c.feng@intel.com>
* BaseTools GenFw: Support CLANG8ELF with conversion ELF to PE/COFF imageLiming Gao2021-06-042-11/+6
| | | | | | | | | | CLANG8ELF tool chain generated ELF image with the different attributes in section. Update GenFw to handle them. 1. .text section with writable attribute (support) 2. .reloc section has the symbol for *ABS* (skip) Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Feng Bob C <bob.c.feng@intel.com>
* BaseTools: Add ClangBase.lds for CLANG8 tool chain with max-page-sizeLiming Gao2021-06-041-0/+79
| | | | | | | | LLVM LLD linker doesn't support common-page-size option. So, max-page-size is used. To not impact GCC tool chain, new ClangBase.lds is added. Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Feng Bob C <bob.c.feng@intel.com>
* BaseTools: build: Set ReturnCode on POSTBUILD failGarrett Kirkendall2021-05-211-0/+1
| | | | | | | | | | | | | | | When build.by POSTBUILD handling section returns other than 0, set ReturnCode to POSTBUILD_ERROR so build.py exits with return code other than 0. Fix for https://bugzilla.tianocore.org/show_bug.cgi?id=1977 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: Garrett Kirkendall <garrett.kirkendall@amd.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Add DTCPP_FLAGS for GCC5 RISCV64 toolchainDaniel Schaefer2021-05-171-0/+1
| | | | | | | | | | | | | | Some/all platforms are going to require EDK2 to build a device tree and use it in the early stages of boot. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Abner Chang <abner.chang@hpe.com> Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools/Brotli: Fix compressed data loss issueChen, Christine2021-05-171-23/+38
| | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2946 Currenly, when using the Brotli tool to compress data, the output compressed binary file does not record complete compressed data when size of input file is too large, which makes the data loss and will trigger decompress-check issue. The Brotli document mentioned: The brotli tool use BrotliEncoderCompressStream method to compresses input stream to output stream. Under some circumstances (e.g. lack of output stream capacity) the BrotliEncoderOperation would require several calls to BrotliEncoderCompressStream. The method must be called again until both input stream is depleted and encoder has no more output after the method is called. This patch fixes this issue based on the Brotli document. 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: Add support for version 3 of FMP Image Header structureSughosh Ganu2021-05-122-9/+24
| | | | | | | | | | | Add support for the ImageCapsuleSupport field, introduced in version 3 of the EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER structure. This structure member is used to indicate if the corresponding payload has support for authentication and dependency. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fix DSC override of Guided toolMichael D Kinney2021-05-103-97/+190
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3359 If the DSC file provides an override of a Guided tool path and/or Guided tool GUID value, then make sure the one from the DSC file is used if it is higher priority than the Guided tool in the tools_def.txt file. This makes the Guided tool used by GenFds match the tool listed GuidedSectionTools.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: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fix New Target/ToolChain/Arch in DSC [BuildOptions] issuesMichael D Kinney2021-05-033-30/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3359 * Save/Restore global state in GetToolChainAndFamilyFromDsc() This resolves an issue where the multi-arch build for UefiPayloadPkg would skip the autogen and build of IA32 components. * Expand tools wildcard. This resolves the issue where autogen makefile contents would have a BUIDLRULEFAMILY tools definitions with an '*' in the tool field that breaks the build from invalid makefile syntax. * Build rule family higher priority than Family. This resolves the issue where flags were appended from both the BUILDRULEFAMILY and FAMILY when only BUILDRULEFAMILY should be appended when present. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Steven Shi <steven.shi@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Andrew Fish <afish@apple.com>
* BaseTools/Source/Python: New Target/ToolChain/Arch in DSC [BuildOptions]Michael D Kinney2021-04-295-96/+230
| | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3359 Update BaseTools to support new build targets, new tool chains, and new architectures declared in DSC file [BuildOptions] sections. * Do not expand * when tools_def.txt is parsed. Only expand when both tools_def.txt and DSC [BuilsOptions] sections have been parsed. This also requires more flexible matching of tool keys that contain * in tool key fields. * Pre-scan the platform DSC file for FAMILY and TOOLCHAIN declarations DSC in [BuildOptions] sections before the FAMILY and TOOLCHAIN need to be known. 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/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>