summaryrefslogtreecommitdiffstats
path: root/BaseTools
Commit message (Collapse)AuthorAgeFilesLines
...
* BaseTools: Correct BPDG tool error printsKonstantin Aladyshev2022-10-191-2/+2
| | | | | | | | | | Popen communication returns bytestrings. It is necessary to perform decode on these strings before passing them to the EdkLogger that works with ordinary strings. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/FMMT: Add Shrink Fv functionChen, Christine2022-10-193-1/+60
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3938 This function is used to remove the useless FV free space. Usage: FMMT -s Inputfile Outputfile 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/FMMT: Add Extract FV functionChen, Christine2022-10-193-22/+31
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3938 With this patch "-e" parameter supports extract FV function. Usage: FMMT -e Inputfile TargetFv Outputfile 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: Remove duplicated words in Python toolsPierre Gondois2022-10-192-2/+2
| | | | | | | | | | In an effort to clean the documentation of the above package, remove duplicated words. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
* BaseTools: Remove duplicated words in C toolsPierre Gondois2022-10-164-7/+7
| | | | | | | | | | In an effort to clean the documentation of the above package, remove duplicated words. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
* BaseTools: Enable LoongArch64 architecture for LoongArch64 EDK2 CI.Chao Li2022-10-142-0/+53
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4053 EDK CI for LoongArch64 architecture Enable LoongArch64 architecture for LoongArch64 EDK2 CI testing. 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: Chao Li <lichao@loongson.cn> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* BaseTools: Add LoongArch64 binding.Chao Li2022-10-142-0/+83
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4053 Add LoongArch64 ProcessorBin.h and add LoongArch to Makefiles. 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: Chao Li <lichao@loongson.cn> Co-authored-by: Baoqi Zhang <zhangbaoqi@loongson.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Updated build tools to support new LoongArch.Chao Li2022-10-143-4/+44
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4053 Python code changes for building EDK2 LoongArch platform. 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: Chao Li <lichao@loongson.cn> Co-authored-by: Baoqi Zhang <zhangbaoqi@loongson.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Updated for GCC5 tool chain for LoongArch platfrom.Chao Li2022-10-141-6/+48
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4053 BaseTools define template files changes for building EDK2 LoongArch platform. 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: Chao Li <lichao@loongson.cn> Co-authored-by: Dongyan Qian <qiandongyan@loongson.cn> Co-authored-by: Baoqi Zhang <zhangbaoqi@loongson.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Update GenFw/GenFv to support LoongArch platform.Chao Li2022-10-147-33/+636
| | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4053 C code changes for building EDK2 LoongArch platform. For definitions of PE/COFF and LOONGARCH relocation types, see the "Machine Types" and "Basic Relocation Types" sections of this URL for LOONGARCH values: https://docs.microsoft.com/en-us/windows/win32/debug/pe-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: Chao Li <lichao@loongson.cn> Co-authored-by: Dongyan Qian <qiandongyan@loongson.cn> Co-authored-by: Baoqi Zhang <zhangbaoqi@loongson.cn> Co-authored-by: Yang Zhou <zhouyang@loongson.cn> Co-authored-by: Xiaotian Wu <wuxiaotian@loongson.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools/VolInfo: Update file and section type stringsKonstantin Aladyshev2022-10-021-6/+6
| | | | | | | | | Change SMM to MM in naming according to the recent PI specifications. Remove trailing whitespaces in some strings. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/VolInfo: Update copyright informationKonstantin Aladyshev2022-10-021-0/+1
| | | | | | | | Add Konstantin Aladyshev to the copyright header. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/VolInfo: Parse apriori filesKonstantin Aladyshev2022-10-021-0/+74
| | | | | | | | Output file GUIDs from the DXE and PEI apriori files. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/VolInfo: Increase GUID base name stringKonstantin Aladyshev2022-10-021-3/+1
| | | | | | | | | | | The current string lenght (=60) is not enough for cases where basename is a path to Build folder. Drop custom define and use MAX_LINE_LEN from the BaseTools codebase instead. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/VolInfo: Fix EFI_SECTION_GUID_DEFINED parsingKonstantin Aladyshev2022-10-021-4/+4
| | | | | | | | | | | | | Currently 'PutFileImage' function is called with arguments that are not advanced on each section parsing. This would lead to an error if EFI_SECTION_GUID_DEFINED is not the first in a file. The same mistake is present in the parsing of CRC32 guided section case. Use correct arguments to fix the issue. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools/VolInfo: Correct buffer for GenCrc32 toolKonstantin Aladyshev2022-10-021-0/+7
| | | | | | | | | | | | If the guided section was encoded with GenCrc32 tool the resulting 'EFI_GUID_DEFINED_SECTION.DataOffset' field points to the start of the meaningfull data that follows the CRC32 value. But if we want to decode the section with GenCrc32 tool we need to provide a buffer that includes the CRC32 value itself. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* nasm_ext_dep.yaml: Remove leading zero in patch versionMichael Kubacki2022-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The patch version is currently: "2.15.05" When a formal semantic version validator is run against this version it is recognized as being invalid due to the leading zero in the patch which is not allowed per the Semantic Versioning Specification: https://semver.org/#spec-item-2 The NuGet Gallery already reports the version without the leading zero: https://www.nuget.org/packages/mu_nasm/2.15.5 This change simply removes the leading zero to prevent code such as https://pypi.org/project/semantic-version/ from reporting a version error. 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> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <mikuback@linux.microsoft.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* BaseTools: Edk2ToolsBuild: Fixing pipeline build due to path too longSean Brogan2022-09-221-1/+1
| | | | | | | | | | | | | | | | | | Current implementation of looking up toolchain will _insert_ the findings from vsvarsall.bat to existing path and potentially stuff the variable to exceed the length of maximal path length accepted by Windows. This change updated the logic to use the discovered shell varialbes to replace the existing path, which is desirable in the specific use case. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Co-authored-by: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Kun Qin <kuqin12@gmail.com> Reviewed-by: Sean Brogan <sean.brogan@microsoft.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: 64bit FSP FV map file cannot be created correctlyKuo, Ted2022-09-151-1/+1
| | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=4035 64bit FSP FV map file cannot be created correctly when using CLANG compiler. When compiling 64bit FSP with CLANG, there is no prefix symbol '_' added to function name. Hence FSP FV map file cannot be created properly. Updated the if condition for CLANG in GenFv to get the issue fixed. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Lee Hamel <lee.m.hamel@intel.com> Signed-off-by: Ted Kuo <ted.kuo@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/GenFw AARCH64: Convert more types of explicit GOT referencesArd Biesheuvel2022-09-081-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rebecca reports that builds of AArch64 DSCs that involve PIE linking when using ELF based toolchains are failing in some cases, resulting in an error message like bad definition for symbol '_GLOBAL_OFFSET_TABLE_'@0x72d8 or unsupported symbol type. For example, absolute and undefined symbols are not supported. The reason turns out to be that, while GenFw does carry some logic to convert GOT based symbol references into direct ones (which is always possible given that our ELF to PE/COFF conversion only supports fully linked executables), it does not support all possible combinations of relocations that the linker may emit to load symbol addresses from the GOT. In particular, when performing a non-LTO link on object code built with GCC using -fpie, we may end up with GOT based references such as the one below, where the address of the GOT itself is taken, and the offset of the symbol in the GOT is reflected in the immediate offset of the subsequent LDR instruction. 838: adrp x0, 16000 838: R_AARCH64_ADR_PREL_PG_HI21 _GLOBAL_OFFSET_TABLE_ 83c: ldr x0, [x0, #2536] 83c: R_AARCH64_LD64_GOTPAGE_LO15 _gPcd_BinaryPatch_PcdFdBaseAddress The reason that we omit GOT based symbol references when performing ELF to PE/COFF conversion is that the GOT is not described by static ELF relocations, which means that the ELF file lacks the metadata to generate the PE/COFF relocations covering the GOT table in the PE/COFF executable. Given that none of the usual motivations for using a GOT (copy on write footprint, shared libraries) apply to EFI executables in the first place, the easiest way around this is to convert all GOT based symbol address loads to PC relative ADR/ADRP instructions. So implement this handling for R_AARCH64_LD64_GOTPAGE_LO15 and R_AARCH64_LD64_GOTOFF_LO15 relocations as well, and turn the LDR instructions in question into ADR instructions that generate the address immediately. This leaves the reference to _GLOBAL_OFFSET_TABLE_ itself, which is what generated the error to begin with. Considering that this symbol is never referenced (i.e., it doesn't appear anywhere in the code) and is only meaningful in combination with R_*_GOT_* based relocations that follow it, we can just disregard any references to it entirely, given that we convert all of those followup relocations into direct references. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Rebecca Cran <rebecca@bsdio.com> Acked-by: Leif Lindholm <quic_llindhol@quicinc.com> Acked-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fix DevicePath GNUmakefile for macOSedk2-stable202208Rebecca Cran2022-08-281-0/+2
| | | | | | | | | | | On macOS, /usr/bin/gcc is clang, and so doesn't have the -Wno-error=stringop-overflow flag that was added for gcc 12. Update the GNUmakefile for DevicePath to skip setting that on macOS. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* Revert "BaseTools: Fix DSC LibraryClass precedence rule"Liming Gao2022-08-281-2/+2
| | | | | | | | | This reverts commit 039bdb4d3e96f9c9264abf135b8a0eef2e2b4860 for tag202208. This brings the behavior changes, and needs more discussion. Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/Source/C/GenSec: Fix EFI_SECTION_FREEFORM_SUBTYPE_GUID headerMichael D Kinney2022-08-191-1/+1
| | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4021 When the size of a EFI_SECTION_FREEFORM_SUBTYPE_GUID section required the use of EFI_FREEFORM_SUBTYPE_GUID_SECTION2 header, set the section type to EFI_SECTION_FREEFORM_SUBTYPE_GUID. Cc: Leif Lindholm <llindhol@qti.qualcomm.com> Cc: Andrew Fish <afish@apple.com> Cc: Konstantin Aladyshev <aladyshev22@gmail.com> 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> Acked-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Leif Lindholm <llindhol@qti.qualcomm.com>
* Basetools/GenFw: Allow AARCH64 builds to use the --prm flagJose Marinho2022-08-081-3/+3
| | | | | | | | | | | | | | | | The GenFw invocation with the --prm flag was previously reserved for X64. AArch64 platforms, built with GCC5, can also deploy PRM modules, hence the --prm flag is also applicable in builds targeting the AARCH64 architecture. This commit enables the --prm flag to be used for EDK2 builds targeting AARCH64. Signed-off-by: Jose Marinho <jose.marinho@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* BaseTools/GenSec: Support EFI_SECTION_FREEFORM_SUBTYPE_GUID sectionsKonstantin Aladyshev2022-08-061-2/+169
| | | | | Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/VolInfo: Parse EFI_SECTION_FREEFORM_SUBTYPE_GUID headerKonstantin Aladyshev2022-08-061-1/+9
| | | | | | | | | Print 'SubtypeGuid' field from the EFI_FREEFORM_SUBTYPE_GUID_SECTION structure. This value describes the raw data inside the section. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Bob Feng<bob.c.feng@intel.com>
* BaseTools/VolInfo: Show FV section boundariesKonstantin Aladyshev2022-08-061-0/+2
| | | | | | | | | | Currently there is no labels for start and end of the EFI_SECTION_FIRMWARE_VOLUME_IMAGE type section. Therefore it is not possible to see where the FV section ends and another section starts. Add labels for start and end of the FV sections to fix the issue. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/GenSec: Fix typoKonstantin Aladyshev2022-08-061-1/+1
| | | | | | | Fix typo in the help message. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/VolInfo: Show encapsulation sectionsKonstantin Aladyshev2022-07-271-0/+6
| | | | | | | | | | | Currently there is no labels for start and end of the encapsulation sections. Therefore it is not possible to see where the encapsulation section ends and another section starts. Add labels for start and end of encapsulation sections to fix the issue. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/Capsule: Support signtool input subject name to sign capsule fileJason1 Lin2022-07-271-9/+34
| | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3928 Windows-based system using signtool.exe to sign the capsule. Add the support to using "--subject-name" argument to assign the subject name used to sign the capsule file. This argument would pass to signtool.exe as a part of input argument with "/n" flag. NOTE: If using signtool.exe to sign capsule at least need to choose one of "--pfx-file" and "--subject-name" argument to input the value. Signed-off-by: Jason1 Lin <jason1.lin@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: Michael D Kinney <michael.d.kinney@intel.com> Cc: Dakota Chiang <dakota.chiang@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/VolInfo: Correct EFI_SECTION_VERSION displayKonstantin Aladyshev2022-07-241-2/+9
| | | | | | | | | | | - Correct typo in print statement, - "BuildNumber" field is UINT16, therefore it needs "0x%04X" format modifier, - "VersionString" field is CHAR16, therefore the input data should be processed to be displayed with "%s" printf modifier. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/VolInfo: Increase define for highest section valueKonstantin Aladyshev2022-07-241-2/+2
| | | | | | | | | | | Currently sections with unknown types are displayed as `EFI_SECTION_SMM_DEPEX` which is wrong. Increase the highest value for the section type to 0x1C for correct parsing. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Yuwei Chen<yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/VolInfo: Correct alignment attributes displayKonstantin Aladyshev2022-07-241-102/+96
| | | | | | | | | | | Alignment attribute is not a bitmask, therefore we need to compare field value with all alignment defines. Remove duplicate print statements. Unify indent with other attribute print statements. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: INF should use latest Pcd value instead of default valueLi, Yi12022-07-241-1/+3
| | | | | | | | | | | | | | This patch is a bug fix about FeatureFlagExpression in INF file: INF [Source] section now unconditionally use Pcd default value in DEC when handling FeatureFlagExpression, it is wrong. If a Pcd value has been set in the DSC file, we should use latest value in DSC instead of default value. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yi Li <yi1.li@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fix DSC LibraryClass precedence ruleChen, Christine2022-07-171-2/+2
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3965 Currently DSC LibraryClass precedence rule is not align with DSC Spec. The expectation rule should be: [LibraryClasses.$(ARCH)] < [LibraryClasses.Common.$(MODULE_TYPE)] The actual behavior is: [LibraryClasses.$(ARCH)] > [LibraryClasses.Common.$(MODULE_TYPE)] This patch fixes the issue. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Long1 Huang <long1.huang@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: add '-p' for Linux 'cp' command.Chen, Christine2022-07-172-3/+3
| | | | | | | | | | | | | | | Currently BaseTools use 'cp' command for PcdValueInit and GenMake process, as the command can not keep the time info of the source file, which will cause incremental build issue in Linux system, thus the '-p' need be added to keep the source file's attributes in copy process. This patch fixes 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>
* .gitignore: Ignore build tools build logsJeff Brasen2022-07-091-1/+2
| | | | | | | | The python BaseTools/Edk2ToolsBuild.py creates files in BaseTools/BaseToolsBuild and should be ignored. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Fix the GenMake bug for .cpp source fileFeng, Bob C2022-06-281-1/+2
| | | | | | | | | | | | | Build-rules.txt lists .cc and .cpp as supported file extensions. BaseTools commit 05217d210e introduce a regression issue that ignore the .cc and .cpp file type. This patch is to fix this bug. 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/Ecc: Fix grammar in Ecc error messageRebecca Cran2022-06-271-2/+2
| | | | | | Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: output the intermediate library instance when error occursNi, Ray2022-06-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a module "Module" depends on a library instance "Lib1" which depends on "Lib2" which depends on "Lib3" ... depends on "LibN", but "LibN" doesn't support the type (e.g.: SEC) of the "Module", the following error messages are printed by build tool: <DSC path>(...): error 1001: Module by library instance [<LibN path>] consumed by [<Module path>] But it's unclear to user how LibN is consumed by the Module. With the patch, following errors are printed: <DSC path>(...): error 1001: Module by library instance [<LibN path>] consumed by library instance [<Lib N-1 path>] which is consumed by module[<Module path>] It doesn't print all the intermediate library instances between the Module and LibN but at least the path of Lib N-1 can help users to help how to fix the build errors. I hope this patch can be a trigger point that a better solution could be developed by tool experts to print all the library instances between the Module and LibN. 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: Bob Feng <bob.c.fen@intel.com>
* Revert "OvmfPkg/Sec: fix stack switch"Gerd Hoffmann2022-06-101-3/+3
| | | | | | | | | This reverts commit ff36b2550f94dc5fac838cf298ae5a23cfddf204. Has no effect because GCC_IA32_CC_FLAGS and GCC_X64_CC_FLAGS are unused. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* OvmfPkg/Sec: fix stack switchGerd Hoffmann2022-06-081-3/+3
| | | | | | | | | | | | | | | | | | | | The ebp/rbp register can either be used for the frame pointer or as general purpose register. With gcc (and clang) this depends on the -f(no-)omit-frame-pointer switch. This patch updates tools_def.template to explicitly set the compiler option and also add a define to allow conditionally compile code. The new define is used to fix stack switching in TemporaryRamMigration. The ebp/rbp must not be touched when the compiler can use it as general purpose register. With version 12 gcc starts actually using the register, so changing it leads to firmware crashes in some configurations. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3934 Reported-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* BaseTools: Fix dependency issue in PcdValueInitJake Garver2022-06-061-1/+2
| | | | | | | | | The generated Makefile was missing a dependency. This resulted in a build-time race condition if the recursive make is multi-threaded and shares job control. Signed-off-by: Jake Garver <jake@nvidia.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Remove RVCT supportedk2-stable202205-rc1Rebecca Cran2022-05-139-253/+16
| | | | | | | | RVCT is obsolete and no longer used. Remove support for it. Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* BaseTools: Add FMMT Python ToolChen, Christine2022-05-0622-0/+2713
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The FMMT python tool is used for firmware files operation, which has the Fv/FFs-based 'View'&'Add'&'Delete'&'Replace' operation function: 1.Parse a FD(Firmware Device) / FV(Firmware Volume) / FFS(Firmware Files) 2.Add a new FFS into a FV file (both included in a FD file or not) 3.Replace an FFS in a FV file with a new FFS file 4.Delete an FFS in a FV file (both included in a FD file or not) 5.Extract the FFS from a FV file (both included in a FD file or not) This version of FMMT Python tool does not support PEIM rebase feature, this feature will be added in future update. Currently the FMMT C tool is saved in edk2-staging repo, but its quality and coding style can't meet the Edk2 quality, which is hard to maintain (Hard/Duplicate Code; Regression bugs; Restrict usage). The new Python version keeps same functions with origin C version. It has higher quality and better coding style, and it is much easier to extend new functions and to maintain. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1847 RFC Link: https://edk2.groups.io/g/devel/message/82877 Staging Link: https://github.com/tianocore/edk2-staging/tree/PyFMMT 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> Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools/Conf: Fix Dynamic-Library-File templateJake Garver via groups.io2022-04-281-0/+2
| | | | | | | | | | | | In the Dynamic-Library-File template, add missing output file declarations. These files are generated by the template and other rules explicitly depend on them. This change resolves missing dependency issues we encountered while running a recursive make with job control. Signed-off-by: Jake Garver <jake@nvidia.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Move gPlatformFinalPcd to Datapipe and optimize sizeLi, Yi12022-04-225-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3828 This is a bugfix of bf9230a9f3dde065c3c8b4175ccd32e44e8f0362. 1.In the current code, gPlatformFinalPcd will save all PCDs used at whole compile process, which wastes runtime memory and is unnecessary. This patch makes gPlatformFinalPcd save only the PCDes which are assigned in the DSC file, and the PCD that has not been assigned will use the default value in DEC. 2.During the compilation process, gPlatformFinalPcd may be lost, and the current code cannot selectively assign PCD in DSC by specifying ARCH. This patch moves gPlatformFinalPcd into datapipe and modifies the assignment logicto fix this. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: yi1 li <yi1.li@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fix DevicePath tool build failure issueFeng, Bob C2022-04-121-0/+5
| | | | | | | | | | | | | | | | | Fix the DevicePath tool build failure that was introduced by the fixes: 22130dcd98b4 ("Basetools: turn off gcc12 warning"). Failure cases are: 1. clang 13.1.6 on macOS 2. gcc5.4 Reported-by: Rebecca Cran <rebecca@bsdio.com> Reported-by: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> 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: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
* BaseTools: Scripts/efi_lldb.py: Add lldb EFI commands and pretty PrintRebecca Cran2022-04-091-0/+1044
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=3500 Use efi_debugging.py Python Classes to implement EFI gdb commands: efi_symbols, guid, table, hob, and devicepath You can attach to any standard gdb or kdp remote server and get EFI symbols. No modifications of EFI are required. Example usage: OvmfPkg/build.sh qemu -gdb tcp::9000 lldb -o "gdb-remote localhost:9000" -o "command script import efi_lldb.py" Note you may also have to teach lldb about QEMU: -o "settings set plugin.process.gdb-remote.target-definition-file x86_64_target_definition.py" Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> 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: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools: Scripts/efi_gdb.py: Add gdb EFI commands and pretty PrintRebecca Cran2022-04-091-0/+918
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=3500 Use efi_debugging.py Python Classes to implement EFI gdb commands: (gdb) help efi Commands for debugging EFI. efi <cmd> List of efi subcommands: efi devicepath -- Display an EFI device path. efi guid -- Display info about EFI GUID's. efi hob -- Dump EFI HOBs. Type 'hob -h' for more info. efi symbols -- Load Symbols for EFI. Type 'efi_symbols -h' for more info. efi table -- Dump EFI System Tables. Type 'table -h' for more info. This module is coded against a generic gdb remote serial stub. It should work with QEMU, JTAG debugger, or a generic EFI gdb remote serial stub. No modifications of EFI is required to load symbols. Example usage: OvmfPkg/build.sh qemu -gdb tcp::9000 gdb -ex "target remote localhost:9000" -ex "source efi_gdb.py" Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> 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: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Liming Gao <gaoliming@byosoft.com.cn>