summaryrefslogtreecommitdiffstats
path: root/BaseTools
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* BaseTools: convert diff.order to LF-onlyLeif Lindholm2020-07-031-13/+13
| | | | | | | | | | | | | | | | | | | | | SetupGit.py sets the git config option diff.orderFile to {edk2 directory}/BaseTools/Conf/diff.order, to override the default order in which files are shown in a diff/patch/whatever. This is in imitation of what is done manually in Laszlo's Unkempt Guide. However, the version currently in the tree is in CRLF format, which makes git interpret e.g. *.c as matching on *.c<CR>, finding no matches and failing to apply the desired reordering. Note: this is true regardless of whether running on Linux or Windows. Convert the file to LF-only to make it work as expected. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: explicitly import email.header PatchCheck.pyLeif Lindholm2020-07-031-0/+2
| | | | | | | | | | | | | | | | | | | | | On Debian 10 (Buster), when running PatchCheck.py with python2, a backtrace is printed, starting from: File "../edk2/BaseTools/Scripts/PatchCheck.py", line 595, in find_patch_pieces parts = email.header.decode_header(pmail.get('subject')) AttributeError: 'module' object has no attribute 'header' When using python3, this backtrace does not appear. Explicitly importing email.header resolves this for python2 and does not appear to cause any issues with python3. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/PatchCheck.py: add exception for diff orderfileLeif Lindholm2020-07-031-4/+5
| | | | | | | | | | | | | | | SetupGit.py adds BaseTools/Conf/diff.order as a diff orderfile, but that file currently has CRLF line endings, which causes all pattern matches to fail and the ordering remaining unaffected. Add an exception to PatchCheck.py (to the existing .gitmodules clause), so that we can merge the fix to the config file. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fix string concatenationPierre Gondois2020-07-021-1/+1
| | | | | | | | | | | | | | | | Using Python 3.7.2 on win32, when printing a FileBuildRule instance, the following error occurs: File "edk2\BaseTools\Source\Python\AutoGen\BuildEngine.py", line 177, in __str__ DestString = ", ".join(self.DestFileList) TypeError: sequence item 0: expected str instance, PathClass found This patch converts each PathClass element of the list to a string instance before concatenating them. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Compile AML bytecode arrays into .obj filePierre Gondois2020-07-022-50/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The AmlToHex script and Posix/WindowsLike wrappers convert an AML file to a .hex file, containing a C array storing AML bytecode. This ".hex" file can then be included in a C file, allowing to access the AML bytecode from this C file. The EDK2 build system doesn't allow to a depict dependency orders between files of different languages. For instance, in a module containing a ".c" file and a ".asl", the ".c" file may or may not be built prior to the ".asl" file. This prevents any inclusion of a generated ".hex" in a ".c" file since this later ".hex" file may or may not have been created yet. This patch modifies the AmlToC script to generate a C file instead of a ".hex" file. It also adds the generation of an intermediate ".amli" file when compiling an ASL file, and adds a rule to convert this ".amli" to a C file. This allows to generate a C file containing the AML bytecode from an ASL file. This C file will then be handled by the EDK2 build system to generate an object file. Thus, no file inclusion will be required anymore. The C file requiring the AML bytecode as a C array, and the ASL file, will be compiled independently. The C array must be defined as an external symbol. The linker is resolving the reference to the C array symbol. To summarize, the flow goes as: -1. ASL file is compiled to AML; -2. AML file is copied to a ".amli" intermediate file; -3. EDK2 build system applies the rule relevant to ".amli" files. This is, calling the "AmlToC" script, generating a C file from the ".amli" file; -4. EDK2 build system applies the rule relevant to C files. This is creating an object file. -5. EDK2 build system links the object file containing the AML bytecode with the object file requiring it. 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: Rename AmlToHex script to AmlToCPierre Gondois2020-07-023-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The AmlToHex script and Posix/WindowsLike wrappers convert an AML file to a .hex file, containing a C array storing AML bytecode. This ".hex" file can then be included in a C file, allowing to access the AML bytecode from this C file. The EDK2 build system doesn't allow to a depict dependency orders between files of different languages. For instance, in a module containing a ".c" file and a ".asl", the ".c" file may or may not be built prior to the ".asl" file. This prevents any inclusion of a generated ".hex" in a ".c" file since this later ".hex" file may or may not have been created yet. This patch renames the script as AmlToC. It is posted as a separate patch to prevent git from seeing the renaming as a deletion plus addition of a new file. The ending line of the posix-like bin-wrapper script has also been corrected. This is a first step toward generating a C file containing the AML bytecode from an ASL file. This C file will then be handled by the EDK2 build system to generate an object file. Thus, no file inclusion will be required anymore. The C file requiring the AML bytecode as a C array, and the ASL file, will be compiled independently. The C array must be defined as an external symbol. The linker is resolving the reference to the C array symbol. To summarize, the flow goes as: -1. ASL file is compiled to AML; -2. AML file is copied to a ".amli" intermediate file; -3. EDK2 build system applies the rule relevant to ".amli" files. This is, calling the "AmlToC" script, generating a C file from the ".amli" file; -4. EDK2 build system applies the rule relevant to C files. This is creating an object file. -5. EDK2 build system links the object file containing the AML bytecode with the object file requiring it. 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: Generate multiple rules when multiple output filesPierre Gondois2020-07-022-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch modifies the Makefile generation not to stop adding Makfile rules when the first final target is found. E.g.: If the following rules are described in build_rule.txt: -[Rule1]: .X files generate .Y and .Z files; -[Rule2]: .Z files generate .Z1 files. Currently, if a File1.X file was part of the sources of a module, only [Rule1] would be generated in the Makefile. Indeed, there are no rules to apply to .Y files: .Y files are a final target. However, there is still [Rule2] to apply to .Z files. This patch also adds a dependency between the first ouput file of a rule and the other output files. For instance, with the same example as above, File1.Y and File1.Z are generated by the following rule: File1.Y: File1.X <Generate File1.Y> <Generate File1.Z> and the new dependency is: File1.Z: File1.Y This is necessary to keep a dependency order during the execution of the Makefile. Indeed, .Y and .Z files are generated by the execution of a common set of commands, and without this rule, there is no explicit dependency relation between them. 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: PatchCheck: Exclude bash scripts from CRLF checkPierre Gondois2020-07-021-1/+7
| | | | | | | | | | | | | | | | | | | Bash scripts require LF line endings to work. PatchCheck.py checks that the files added in a patch have CRLF line endings. It excludes files ending with the ".sh" extension from this check. Some bash script don't have a ".sh" extension. Most of them are located in: - BaseTools/BinWrappers/PosixLike/ - BaseTools/Bin/CYGWIN_NT-5.1-i686/ This patch excludes these folder plus BaseTools/BuildEnv from this CRLF check. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Add external definitions for RISC-V assembly buildAbner Chang2020-06-241-0/+1
| | | | | | | | | | | | | | | Add opensbi external definitions to RISC-V build for assembly code. Use GCC5_RISCV_OPENSBI_TYPES to refer to edk2 data type for assembly files instead of using opensbi data type. Signed-off-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Leif Lindholm <leif.lindholm@linaro.org>
* BaseTools/PatchCheck.py: Add LicenseCheckShenglei Zhang2020-06-121-0/+50
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2691 For files to be added to the tree, this feature will check whether it has BSD plus patent license. If not, licenses listed in Readme are also accepted but warning will be reported. Otherwise, it should be error. 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 GenFv: Report the correct spare FV image sizeLiming Gao2020-06-111-0/+13
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2790 If the top FFS is placed in FV image, current FV will show there is no space. In fact, the pad ffs in FV image can be regarded as the spare space. This change reports the max pad ffs size as the spare space for use. Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Warn user the file not found issue instead of break build.Bob Feng2020-06-071-2/+4
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2770 The Trim.py would break the build process when the file not found issue occures, however sometimes we do not care about this issue. This patch changes the error with warning in order to solve this kind of break. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng<bob.c.feng@intel.com>
* BaseTools/build.py: Exit with 1 when AutoGen error occurredIrene Park2020-06-071-2/+4
| | | | | | | | | | | AutoGen manager/workers halt the progress when an error occurs but doesn't propagate the error code to main and allows main exit with 0 and gets the build system unable to catch the occurrence of an error. This change informs main with an error when a progress is halted and helps main exit with 1. Signed-off-by: Irene Park <ipark@nvidia.com> Reviewed-by: Bob Feng<bob.c.feng@intel.com>
* BaseTools: Remove deprecated Visual Studio OptionSami Mujawar2020-05-211-9/+9
| | | | | | | | | | | | | | | | | | | The VS2017 compiler reports 'warning D9035 : option 'Gm' has been deprecated and will be removed in a future release' The documentation for the 'Gm' option at https://docs.microsoft.com/en-us/cpp/build/reference/gm-enable-minimal-rebuild?view=vs-2019 indicates that this option can be safely removed from the project. Therefore, remove the deprecated 'Gm' Visual Studio Compiler option. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2660 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Bootable NVDIMM namespacesOleksiy Yakovlev2020-05-151-0/+12
| | | | | | | | | | | | Provided a mechanism for UEFI FW to identify and hand off bootable NVDIMM namespaces to the OS by standardizing the EFI device path. EFI device path for physical NVDIMM devices changed from an ACPI _ADR device to an ACPI NVDIMM device for correctness. (UEFI 2.8 mantis 1858) Signed-off-by: Oleksiy Yakovlev <oleksiyy@ami.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>
* BaseTools: REST style formsetOleksiy Yakovlev2020-05-151-0/+1
| | | | | | | | | | In question level, a new flag EFI_IFR_FLAG_REST_STYLE is defined. (UEFI 2.8 mantis 1853) Signed-off-by: Oleksiy Yakovlev <oleksiyy@ami.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>
* BaseTools: Fix parse PCD GUID expression issueFeng, YunhuaX2020-05-131-5/+5
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2686 The build tool will give an incorrect GUID value if the GUID includes character ' or " ASCII value. This patch is going to fix this issue. 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>
* BaseTools/Ecc: Replace deprecated function time.clock()Michael Kubacki2020-05-131-2/+3
| | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2707 Ecc fails with Python 3.8 because it uses the deprecated time.clock() function - https://docs.python.org/3.7/library/time.html#time.clock This change updates EccMain.py to use time.perf_counter(). Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/Plugin: Update HostBasedUnitTestRunner to support LinuxSean Brogan2020-05-082-31/+31
| | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2513 Update HostBasedUnitTestRunner plugin to support the Linux environment and remove any Windows only logic. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: add handling for 'S:' flag to GetMaintainer.pyLeif Lindholm2020-05-081-0/+4
| | | | | | | | | | | | | | | GetMaintainer.py already extracts the value of any S: tags for sections, but it doesn't do anything with that information. Print a warning message, with the status, for each matching section with a status explicitly set to anything other than 'Supported' or 'Maintained'. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Leif Lindholm <leif@nuviainc.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: add repo name option to SetupGit.pyRebecca Cran2020-05-081-3/+9
| | | | | | | | | | | | | | | | | | | Allow users who didn't clone one of the TianoCore repos from a canonical URL to specify the name of the repo (edk2, edk2-platforms or edk2-non-osi) when running SetupGit.py to allow them to configure their repo properly. The new option is: -n repo, --name repo set the repo name to configure for, if not detected automatically 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: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* BaseTools: Enable RISC-V architecture for RISC-V EDK2 CI.Abner Chang2020-05-072-0/+60
| | | | | | | | | | | | | | | | | | | | | BZ:2562: https://bugzilla.tianocore.org/show_bug.cgi?id=2562 EDK CI for RISC-V architecture Enable RISC-V architecture for RISC-V EDK2 CI testing. Signed-off-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Gilbert Chen <gilbert.chen@hpe.com> Cc: Daniel Helmut Schaefer <daniel.schaefer@hpe.com>
* BaseTools: BaseTools changes for RISC-V platform.Abner Chang2020-04-292-4/+7
| | | | | | | | | | | | | | | Python code changes for building EDK2 RISC-V platform. Signed-off-by: Abner Chang <abner.chang@hpe.com> Co-authored-by: Gilbert Chen <gilbert.chen@hpe.com> Co-authored-by: Daniel Helmut Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Gilbert Chen <gilbert.chen@hpe.com>
* BaseTools: BaseTools changes for RISC-V platform.Abner Chang2020-04-291-2/+51
| | | | | | | | | | | | | | | Tools definitions template file changes for building EDK2 RISC-V platform. Signed-off-by: Abner Chang <abner.chang@hpe.com> Co-authored-by: Gilbert Chen <gilbert.chen@hpe.com> Co-authored-by: Daniel Helmut Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Gilbert Chen <gilbert.chen@hpe.com>
* BaseTools: BaseTools changes for RISC-V platform.Abner Chang2020-04-298-13/+580
| | | | | | | | | | | | | | | C code changes for building EDK2 RISC-V platform. Signed-off-by: Abner Chang <abner.chang@hpe.com> Co-authored-by: Gilbert Chen <gilbert.chen@hpe.com> Co-authored-by: Daniel Helmut Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Gilbert Chen <gilbert.chen@hpe.com>
* BaseTools:Add the spare space FV image size checkerFan, Zhiju2020-04-232-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2654 If FV is placed in FD region, its FV image size is fixed. When FV image size exceeds it, it will trig the build break. To alert the developer to adjust FV image size earlier, I request to add new checker for the the spare FV space. When the spare FV space is less than the specified threshold, build tool will report the error. This checker is the optional. It can be enabled by -D FV_SPARE_SPACE_THRESHOLD=10000. Macro is the value of the spare space threshold size. It can be decimal or hex format. If it is enabled, BaseTools will check every FV with the fixed size. If FV doesn't meet with the size requirement, Build tool will report error message to say there is no enough spare space. Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Make brotli a submoduleShenglei Zhang2020-04-1689-35213/+53
| | | | | | | | | | | Use submodule way to access brotli in BaseTools based on brotli version 666c3280cc11dc433c303d79a83d4ffbdd12cc8d. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2558 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: Liming Gao <liming.gao@intel.com>
* BaseTools/WindowsVsToolChain.py: Update toolchain pluginShenglei Zhang2020-04-131-11/+62
| | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2659 Allow WindowsVsToolChain Plugin to add libraries and headers of user defined ARCH for VS2017 and VS2019. 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: Bret Barkelew <bret.barkelew@microsoft.com>
* BaseTools: Use SEH exceptions in CLANGPDB for IA32Vitaly Cheptsov2020-04-081-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2628 This patch reduces the size of IA32 binaries by ensuring that no .debug_frame / .eh_frame sections are generated through forcing SEH exception model, which is already the default in clang for X64. EDK II does not support exceptions, and in future we should disable them instead of switching to some other variant. Currently this is not possible due to the following LLVM bugs: https://bugs.llvm.org/show_bug.cgi?id=45324 https://bugs.llvm.org/show_bug.cgi?id=45325 Upon applying this patch OvmfPkgIA32.dsc compilation in DEBUG mode gets the following size decrease with clang 9.0.1. Before: FV Space Information SECFV [11%Full] 212992 total, 24512 used, 188480 free PEIFV [22%Full] 917504 total, 203048 used, 714456 free DXEFV [36%Full] 11534336 total, 4215672 used, 7318664 free FVMAIN_COMPACT [37%Full] 3440640 total, 1287776 used, 2152864 free After: FV Space Information SECFV [10%Full] 212992 total, 22112 used, 190880 free PEIFV [19%Full] 917504 total, 176392 used, 741112 free DXEFV [31%Full] 11534336 total, 3657112 used, 7877224 free FVMAIN_COMPACT [33%Full] 3440640 total, 1153896 used, 2286744 free Cc: Liming Gao <liming.gao@intel.com> Cc: Marvin H?user <mhaeuser@outlook.de> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
* BaseTools: Update Edk2ToolsBuild.py to use multiple threads on LinuxSean Brogan2020-04-071-1/+15
| | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2640 Azure Pipelines agents have 2 threads. This commit has been shown to reduce the build time in half on those agents. Cc: Bob C Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Bob C Feng <bob.c.feng@intel.com>
* BaseTools:GuidedSectionTools.txt is not generated correctlyFan, ZhijuX2020-03-312-14/+5
| | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2538 For LzmaCompress or BrotliCompress, the platform may use the different options and add their batch file, such as LzmaCompressPlatform. Then, specify it in platform.dsc [BuildOptions] to override the default one in tools_def.txt. *_*_*_LZMA_PATH = LzmaCompressPlatform This override tool will be used. But, its name is not specified in the generated GuidedSectionTools.txt. Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools:Fix build tools print traceback info issueFan, ZhijuX2020-03-241-3/+0
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2610 We meet a case that the DEC file declaring the PCD isn't included in the INF.it cause build tools report Traceback error. Remove raise statements that generate Tracebacks that were only intended for development/debug. With the raise statements removed proper error messages are shown. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools:fix issue for decode the stdout/stderr byte arraysFan, ZhijuX2020-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2365 This patch is to fix a build tool regression issue which was introduced by commit 8ddec24dea74. compiler output message includes localized string. So build failed when code decode the stdout/stderr byte arrays. The cause of the build failed is that Commit 8ddec24dea74 removed "errors='ignore'". The build tool does not need to deal with localized string, so we need to add "errors='ignore'". this function is only invoked for structure PCDs. Build failed if structurePcd is used in platform dsc file. The patch is going to fixed this issue Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools:copy the common PcdValueCommon.c to output directoryFan, ZhijuX2020-03-121-2/+11
| | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2568 PcdValueInit shares the same Edk2\BaseTools\Source\C\PcdValueCommon.c. To avoid the conflict, it should copy this file to its output directory, If so, PcdValueCommon.c file will be private for PcdValueInit Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Remove invalid leading space before !INCLUDE in MakefileBob Feng2020-03-021-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2563 This patch is to fix a incremental build regression bug which happen when using nmake. That's introduced by 818283de3f6d. If there is white space before !INCLUDE instruction, nmake will not process it. Source code's dependent header files are listed in ${deps_file} file, if it's not included successfully, nmake will not detect the change of those header file. This patch has been verified in Windows with VS2015 and Linux with GCC5. The header file add/modify/delete can trig the incremental build with this fix. There is no impact on the clean build. Cc: Andrew Fish <afish@apple.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Tested-by: Liming Gao <liming.gao@intel.com>
* BaseTools: remove -DNO_MSABI_VA_FUNCS option in CLANGPDB tool chainLiu, Zhiguang2020-02-131-1/+1
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2524 remove -DNO_MSABI_VA_FUNCS option in CLANGPDB tool chain After CLANGPDB is switched to GNU mode, to use MS ABI version of GCC built-in macros for variable argument lists as same as CLANG38 tool chain. 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: Liming Gao <liming.gao@intel.com>
* BaseTools:build failure in CLANGPDB tool chainFan, ZhijuX2020-02-131-0/+2
| | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2520 Incremental build failure in CLANGPDB tool chain on Windows host The build failure is like below when do incremental build. The root cause is in generated deps_target file. It has one line ":". Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fixed build failure when using python38Fan, ZhijuX2020-02-121-1/+1
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2304 SyntaxWarning: "is" with a literal. Did you mean "=="? Using "is" instead of "==" is an irregular syntax Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Cc: Bob C Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools:fix Ecc tool issue for check StructPcdFan, ZhijuX2020-02-121-2/+69
| | | | | | | | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2142 gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation| {0x0}|SMBIOS_TABLE_TYPE0|0x80010000 { <HeaderFiles> IndustryStandard/SmBios.h <Packages> MdePkg/MdePkg.dec AdvancedFeaturePkg/AdvancedFeaturePkg.dec } If there's a PcdStructHF or PcdStructPKGs in StructPcd, EccTool report error,IndexError: list index out of range This patch is going to fix this issue Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Remove caret in NASM_INC macroPierre Gondois2020-02-121-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | NASM_INC contains the list of directory to include when using the nasm assembler. In nmake makefiles, a trailing backslash escapes the newline char and replaces it with a space ' '. To have a literal trailing backslash, it must be escaped with a caret '^'. This is not necessary for GNU makefiles. On windows platforms, for the NASM_INC macro, a caret escaping a trailing a backslash was appended to the last included folder regardless of the makefile type. For instance, "/Include/" was replaced by "/Include/^\". This is causing a build failure on windows platforms using GNU makefiles since the caret '^' doesn't escape any chars in GNU makefiles and is thus conserved. "/Include^\" was replaced by "/Include\/" in nmake makefiles, but remained "/Include/^\" in GNU makefiles. This patch removes the caret '^' on the build using GNU makefiles. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Rationalise makefile generationPierre Gondois2020-02-124-94/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GenMake.py script tests the platform environment to determine the type of makefile that needs to be generated. If a Windows build host is detected, the makefile generated is of Nmake type. Otherwise a GNUmake type is generated. Furthermore, the <TARGET>_<TAGNAME>_<ARCH>_MAKE_PATH option in tools_def.template defines the make tool to use. E.g.: for VS2017 this is configured to use Nmake, cf. *_VS2017_*_MAKE_PATH = DEF(VS2017_BIN_HOST)\nmake.exe while for GCC5 it is setup to use GNU make. *_GCC5_*_MAKE_PATH = DEF(GCC_HOST_PREFIX)make This prevents using the GCC compiler toolchain on a Windows build host. To address this issue this patch introduces 2 factors to determine the generated makefile output. 1. Platform -> to determine shell commands used in makefile. 2. MakeTool -> to determine the type of makefile that needs to be generated. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Switch to GNU mode for CLANGPDBVitaly Cheptsov2020-02-111-3/+3
| | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2397 Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fixed a Incremental build issueBob Feng2020-02-091-1/+1
| | | | | | | | | | The .map file is not update to FFS_OUTPUT_DIR folder in the incremental build. Signed-off-by: Guo Dong <guo.dong@intel.com> 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>