summaryrefslogtreecommitdiffstats
path: root/BaseTools
Commit message (Collapse)AuthorAgeFilesLines
...
* BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chainLiming Gao2020-02-071-2/+2
| | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2502 This option is required to make GCC49 tool chain work with the high version GCC compiler. Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Script for converting .aml to .hexPierre Gondois2020-02-064-0/+176
| | | | | | | | | | | | | | | | | | | | | | | | The "-tc" option of the iasl compiler allows to generate a .hex file containing a C array storing AML bytecode. An online discussion suggested that this "-tc" option was specific to the iasl compiler and it shouldn't be relied on. This conversation is available at: https://edk2.groups.io/g/devel/topic/39786201#49659 A way to address this issue is to implement a compiler independent script that takes an AML file as input, and generates a .hex file. This patch implements a Python script that converts an AML file to a .hex file, containing a C array storing AML bytecode. This scipt has been tested with the AML output from the following compilers supported by the EDKII implementation: * Intel ASL compiler * Microsoft ASL compiler Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/Scripts/PatchCheck.py: Do not use mailmapPhilippe Mathieu-Daude2020-02-061-2/+4
| | | | | | | | | | | | | | | We check the author/committer name/email are properly displayed since commits 8ffa47fb3ab..c0328cf3803. However if PatchCheck.py uses the mailmap, it will check sanitized names/emails. Use the --no-use-mailmap option so PatchCheck.py will check unsanitized input. Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/Scripts/PatchCheck.py: Detect emails rewritten by Groups.IoPhilippe Mathieu-Daude2020-02-061-0/+4
| | | | | | | | | | | | | Due to strict DMARC / DKIM / SPF rules, Groups.Io sometimes rewrite the author email. See for example commit df851da3ceff5b6bcf5e12616. Add a check to detect these rewrites with PatchCheck.py. Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/Scripts: Add log.mailmap to SetupGit.pyPhilippe Mathieu-Daude2020-02-061-0/+1
| | | | | | | | | | | | | We added .mailmap to the repository in commit 4a1aeca3bd02d04e01c2d to display commit mistakes fixed. Use this option by default in our git setup. Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: append -DNO_MSABI_VA_FUNCS option in CLANGPDB tool chainLiu, Zhiguang2020-02-061-1/+1
| | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2415 Define NO_MSABI_VA_FUNCS to use GCC built-in macros for variable argument lists for CLANGPDB 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/DscBuildData: Fix PCD autogen include file conflictMichael D Kinney2020-02-041-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2494 When using structured PCDs, a C application is auto generated to fill in the structured PCD value. The C application uses the standard include files <stdio.h>, <stdlib.h>, and <string.h>. This C application also supports include paths from package DEC files when a structured PCD declaration provides a <Packages> list. The complete list of include paths are -I options for include paths from package DEC files and the compiler's standard include paths. -I include paths are higher priority than the standard include paths. If the -I included paths from package DEC files contain <stdio.h>, <stdlib.h>, or <string.h> the wrong include files are used to compile the C application for the structured PCD value. Update GenerateByteArrayValue() to skip a package DEC include paths that contain <stdio.h>, <stdlib.h>, or <string.h>. Build failures were observed when adding a structured PCD to CryptoPkg. CryptoPkg contains <stdio.h>, <stdlib.h>, and <string.h> in the path CryptoPkg/Library/Include to support building Open SSL. The Library/Include path is listed as a private include path in CryptoPkg.dec. Without this change, the standard include files designed to support build OpenSLL are used to build the structured PCD C application, and that build fails. Other packages that provide a standard C lib or a gasket for a subset of the standard C lib will run into this same issue if they also define and use a Structured PCD. So this issue is not limited to the CryptoPkg. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/Conf/gitattributes: fix "--function-context" for C source codeLaszlo Ersek2020-01-311-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "--function-context" ("-W") option of git-diff displays the entire body of a modified function, not just small modified hunks within the function. It is useful for reviewers when the code changes to the function are small, but they could affect, or depend on, control flow that is far away in the same function. Of course, the size of the displayed context can be controlled with the "-U" option anyway, but such fixed-size contexts are usually either too small, or too large, in the above scenario. It turns out that "--function-context" does not work correctly for C source files in edk2. In particular, labels for the goto instruction (which the edk2 coding style places in the leftmost column) appear to terminate "--function-context". The "git" utility contains built-in hunk header patterns for the C and C++ languages. However, they do not take effect in edk2 because we don't explicitly assign the "cpp" git-diff driver to our C files. The gitattributes(5) manual explains that this is required: > There are a few built-in patterns to make this easier, and > tex is one of them, so you do not have to write the above in > your configuration file (you still need to enable this with > the attribute mechanism, via .gitattributes). The following > built in patterns are available: > > [...] > > * cpp suitable for source code in the C and C++ > languages. The key statement is the one in parentheses. Grab the suffix lists from the [C-Code-File] and [Acpi-Table-Code-File] sections of "BaseTools/Conf/build_rule.template", add "*.h" and "*.H", and mark those as belonging to the "cpp" git-diff driver. This change has a dramatic effect on the following command, for example: $ git show -W 2ef0c27cb84c Cc: Bob Feng <bob.c.feng@intel.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20200120094245.9010-1-lersek@redhat.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/Scripts/PatchCheck.py: Remove submodule false positivesMichael D Kinney2020-01-241-2/+21
| | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2484 https://bugzilla.tianocore.org/show_bug.cgi?id=2485 Update PatchCheck to not enforce no tabs and not enforce CR/LF line endings for .gitmodules files. These files are updated by git when a git submodule command is used and the updates by git use tab characters and LF line endings. Also update patch check to not enforce CR/LF line endings for patch lines that create a submodule directory. These patch lines use LF line endings. The git submodule directory is added as a new file with attributes 160000 that can be detected by looking for the pattern "new file mode 160000". Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* BaseTools: Fixed a incremental build bugBob Feng2020-01-193-4/+13
| | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2451 If removing a header file from source code and file system, the incremental build will fail. This patch is to fix this issue by setting each header file as a target without any actions in makefile. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/Capsule: Add capsule dependency supportLi, Aaron2020-01-152-7/+464
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2412 Capsule generate tool support encode capsule dependencies through '-j' command with a JSON file. To enable dependency feature, "Dependencies" field for each payload in JSON file is required. The value of "Dependencies" field is C style infix notation expression. For example: "Dependencies":"72E2945A-00DA-448E-9AA7-075AD840F9D4 > 0x00000001" The relation of Dependency Expression Opcode in UEFI2.8 chap 23.2 and infix notation expression value is as follows: +-----------------------------+--------------------------+ | OPCODE | INFIX EXPRESSION VALUE | +-----------------------------+--------------------------+ | 0x00 (PUSH_GUID) | {GUID} | | 0x01 (PUSH_VERSION) | {UINT32} | | 0x02 (DECLEAR_VERSION_NAME} | DECLEAR "{VERSION_NAME}" | | 0x03 (AND) | && | | 0x04 (OR) | || | | 0x05 (NOT) | ~ | | 0x06 (TRUE) | TRUE | | 0x07 (FALSE) | FALSE | | 0x08 (EQ) | == | | 0x09 (GT) | > | | 0x0A (GTE) | >= | | 0x0B (LT) | < | | 0x0C (LTE) | <= | +-----------------------------+--------------------------+ Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Aaron Li <aaron.li@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/Scripts/PatchCheck: Address false error conditionsMichael D Kinney2020-01-131-6/+51
| | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2406 * Always print subject line after the git commit id to make it easier to know the context of warnings or errors. * Allow UTF-8 characters in subject line * Error if subject line length > 75 without CVE-xxx-xxxxx present * Error if subject line length > 92 with CVE-xxxx-xxxxx present * If body line length is > 75, then print warning instead of error. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* BaseTools:Fix GenFds issue for BuildOption replace GenFdsOptionFan, ZhijuX2020-01-1310-169/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2455 BuildOption is used by TargetTxtClassObj.py GenFdsOption is used by GenFds.py When the GenFds tool is used alone (e.g. python3 -m GenFds.GenFds -h) With the OptionParser function, the first detected function prints the help message import TargetTxtClassObj to GenFds, The BuildOption will be executed and replace GenFdsOption We removed all objects associated with this problem that were created directly during the import process (e.g. BuildOption, BuildTarget = MyOptionParser(), TargetTxt = TargetTxtDict()) The Patch is going to fix this issue 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:Change the case rules for ECC check pointer namesFan, ZhijuX2020-01-131-3/+4
| | | | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2087 In CryptHkdf.c line 42 EVP_PKEY_CTX *pHkdfCtx; Variable pHkdfCtx begins with lower case 'p', which should be acceptable because it it is a pointer. (Refer to CCS_2_1_Draft, 4.3.3.3) So ECC tool should be improved to handle issues like this. Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
* BaseTools/PatchCheck.py: Check the patch author email addressPhilippe Mathieu-Daude2020-01-101-1/+6
| | | | | | | | | | | | | | | | | | To avoid patches committed with incorrect email address, use the EmailAddressCheck class on the author email too. Example: $ python BaseTools/Scripts/PatchCheck.py 1a04951309f Checking git commit: 1a04951309f The 'Author' email address is not valid: * The email address cannot contain a space: /o=Intel/ou=External \ (FYDIBOHF25SPDLT)/cn=Recipients/cn=fe425ca7e5f4401abed22b904fe5d964 Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
* BaseTools/PatchCheck.py: Let EmailAddressCheck describe email checkedPhilippe Mathieu-Daude2020-01-101-3/+7
| | | | | | | | | | | We are checking different emails from the signature list. We are going to check more. To be able to differency, add a description field, so the error reported is clearer. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
* BaseTools/PatchCheck.py: Check the committer email addressPhilippe Mathieu-Daude2020-01-101-0/+6
| | | | | | | | | | To avoid patches committed with incorrect email address, use the EmailAddressCheck class on the committer email too. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
* BaseTools/PatchCheck.py: Extract email check code to EmailAddressCheckPhilippe Mathieu-Daude2020-01-101-29/+54
| | | | | | | | | | As we are going to reuse this code out of the CommitMessageCheck class, extract it in a new class: EmailAddressCheck. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
* BaseTools/PatchCheck.py: Ignore CR and LF characters in subject lengthPhilippe Mathieu-Daud?2020-01-091-1/+1
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=113 Strip the trailing characters before checking the subject line is less than 72 characters. Fixes: e61406708c83f Cc: Liming Gao <liming.gao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
* BaseTools/Scripts: Add sendemail.transferEncoding to SetupGit.pyDesimone, Nathaniel L2019-12-241-18/+20
| | | | | | | | | | | | | | | | | If git finds a '\r' character in the message, then it converts the entire message content into Quoted-Printable encoding. It appears that when groups.io converts the QP encoding back to text format, the '\r' characters somehow become '\n'. To workaround this, the SetupGit.py script will now explicitly set the sendemail.transferEncoding git config option to '8bit' Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* edksetup.bat stuck on unicode locale WindowsPark, Aiden2019-12-231-1/+1
| | | | | | | | | | | | | | This issue happens under two conditions. 1. Unicode language environment in Windows 2. Python2 (Not reproducible with Python3) Step to reproduce C:\edk2>edksetup.bat forcerebuild The edksetup.bat stuck at 'nmake cleanall'. Signed-off-by: Aiden Park <aiden.park@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Resolve a issue of Incremental buildBob Feng2019-12-181-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2311 In patch set 13c5e34a - 0c3e8e99, we implemented incremental build with using compiler/pre-processor generate dependent header file function. A issue is found for MSVC compiler, that the cl.exe /showIncludes build option generate header file list to either stdout or stderr. For .c file, the header file list is print out to stdout while for .vfr, .aslc and .nasm file, the file list is print out to stderr. The build tool use two threads to process the message from stdout and stderr, but to generate correct *.deps file, build tool need to combine the header file list from stderr and other messages from stdout together with correct time sequence order. So this patch is trying to combine the stdout and stderr together for the process which is for calling make program. The impact of this patch is that the output message of build with -q will be changed. The compiler error message will not print out. The build behavior of other log level setting will not be impacted. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools:replaces the two offending quotes by ascii quotesFan, Zhiju2019-12-181-2/+2
| | | | | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2423 That commit 13c5e34a1b introduces the first two UTF-8 characters (the quote ') in an otherwise all-ascii file. In Conf\tools_def.template There is tow lines of Notes: Since this tool chain is obsolete, it doesn't enable the compiler option for included header file list generation, we replaces the two offending quotes by proper ascii quotes The patch is going to fix this issue 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 failure when multiple build targets givenBob Feng2019-12-183-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2371 This patch is to fix a regression issue that build fails if multiple build targets given. Two changes cause this regression issue. One is AutoGen object __hash__ function only hash file path and arch, missing ToolChain and build target. The other is changing the multiple-thread-genfds function as default build behavior. To generate the genffs command to Makefile, there is a global data set is used, GenFdsGlobalVariable, which cause build tool use the data of first build-target build in the second build-target build. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Remove redundant binary cache fileSteven Shi2019-12-101-29/+0
| | | | | | | | | | | | | Redesign the binary cache and not need to save the cache intermediate result and state in memory as a ModuleBuildCacheIR class instance. So remove the CacheIR.py which define the ModuleBuildCacheIR class. Signed-off-by: Steven Shi <steven.shi@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: Leverage compiler output to optimize binary cacheSteven Shi2019-12-106-822/+714
| | | | | | | | | | | | | | | | | Redesign the binary cache and bases on the compiler to output the dependency header files info for every module. The binary cache will directly consume the dependency header files info and doesn't parse the C source code by iteself. Also redesign the dependency files list format for module and try to share the common lib hash result as more as possible in local process. Remove the unnecessary share data access across multiprocessing. Signed-off-by: Steven Shi <steven.shi@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: enhance the CacheCopyFile method arg namesSteven Shi2019-12-101-3/+3
| | | | | | | | | | | Enhance the CacheCopyFile method arg names to be more clear and readable Signed-off-by: Steven Shi <steven.shi@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: store more complete output files in binary cacheSteven Shi2019-12-101-16/+4
| | | | | | | | | | | | | Binary cache use the OutputFile method to return the module built output files needed to store in cache, but current OutputFile implementation doesn't return complete output files. Enhance the OutputFile method to return more complete output files. Signed-off-by: Steven Shi <steven.shi@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: Enhance Basetool for incremental buildBob Feng2019-12-104-73/+380
| | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2311 Include dependency file in Makefile to enhance incremental build Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Update build_rule.txt to generate dependent files.Bob Feng2019-12-101-42/+54
| | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2311 Enable the dependent files generation function for compilers and Trim tool. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Generate dependent files for ASL and ASM filesBob Feng2019-12-101-20/+95
| | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2311 Implement the function in Trim tool to get the included file list for ASL and ASM file. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Add build option for dependency file generationBob Feng2019-12-101-83/+98
| | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2311 Add /showIncludes for msvc and -MMD -MF $@.deps for GCC and CLANG Remove /MP for msvc since /MP does not work with /showIncludes Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Avoid "is" with a literal Python 3.8 warningsPhilippe Mathieu-Daude2019-12-061-1/+1
| | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2304 The following statement produces a SyntaxWarning with Python 3.8: if str(FdRegion.RegionType) is 'FILE' and self.Platform.VpdToolGuid in \ str(FdRegion.RegionDataList): BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py:168: SyntaxWarning: \ "is" with a literal. Did you mean "=="? Change the 'is' operator by the conventional '==' comparator. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
* BaseTools:Enhance the way to handling included dsc fileFan, ZhijuX2019-12-041-39/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2400 In Dsc Parser, included dsc file is parsed always no matter if its condition is False gUefiOvmfPkgTokenSpaceGuid.test1|FALSE !if gUefiOvmfPkgTokenSpaceGuid.test1 == FALSE !include OvmfPkg/test1.dsc !else !include OvmfPkg/test2.dsc !endif The patch avoids processing redundant dsc files and improves the way Tool handles them. In the above case, since the conditional result is FALSE, "test2.dsc" is not parsed. 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 regression issue for platform .map fileFan, ZhijuX2019-11-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2363 This patch is to fix a build tool regression issue which was introduced by commit b8ac0b7f28.This issue caused map file lost the line of IMAGE=***. For example,in Ovmf.map, there is no line of (IMAGE=<path to efi> ) under each of modules item. The path to the efi file generated by each module is written on this line The purpose of this line is add the debug image full path. there is no information about the module in the map file other than FVName, it allows us to quickly know which module this part corresponds to. In commit b8ac0b7f28,add a line ("self.BuildModules = []") in function, but it's used to calculate the variable ModuleList in the following code. 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:Add [packages] section in dsc fileFan, ZhijuX2019-11-208-7/+68
| | | | | | | | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2270 Currently a PCD (e.g. FeaturePCD) cannot be used in a conditional statement in a DSC/FDF file without a module in the build referencing the PCD package DEC file. An example implementation that to support this is to allow a [Packages] section in the DSC file to list additional package dependencies for PCD references in the package DSC/FDF files. this patch is going to add the ability to have the [packages] section defined in the DSC file Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Acked-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Rename tool chain CLANG9 to CLANGPDBLiming Gao2019-11-152-85/+85
| | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2341 Based on feedback from https://edk2.groups.io/g/devel/message/50466, CLANGPDB is the most acceptable tool chain name, because this tool chain generates PE/COFF image with PDB debug symbol. The following changes are made in this patch. 1. Update tool chain name from CLANG9 to CLANGPDB. 2. Update tool chain BUILDRULEFAMILY from CLANGPE to CLANGPDB. 3. Update CLANG9_BIN env name to CLANG_BIN without version info. 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: Fix build failure when using python38Ni, Ray2019-11-131-1/+1
| | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2304 Signed-off-by: Ray Ni <ray.ni@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: Enable MACRO for DSC Components section tagFeng, Bob C2019-11-131-0/+1
| | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2308 This patch is to enable MACRO for Components section architecture modifier. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Add BaseTools plugins to support CISean Brogan2019-11-119-0/+483
| | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2315 Add the following plugins that are required to support EDK II Continuous Integration (CI) builds. These plugins are added to BaseTools because that support EDK II BaseTools features. * BuildToolsReportGenerator * LinuxGcc5ToolChain * WindowsResourceCompiler * WindowsVsToolChain Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Add YAML files with path env and tool extdepsSean Brogan2019-11-1110-0/+297
| | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2315 Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Add RC_PATH define for VS2017/2019Sean Brogan2019-11-112-2/+26
| | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2315 Add use of RC_PATH define that provides the path to the resource compiler that is typically provided in a Windows SDK. The path changes with different Windows SDK releases. This define is set to the WINSDK_PATH_FOR_RC_EXE environment variable. This environment variable must be set to the path to the currently installed resource compiler (rc.exe). Update set_vsprefix_envs.bat to set WINSDK_PATH_FOR_RC_EXE if a Windows SDK is detected. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/GenFw AARCH64: disregard ADRP instructions that are patched alreadyArd Biesheuvel2019-11-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to permit the use of compilers that only implement the small code model [which involves the use of ADRP instructions that require 4 KB segment alignment] for generating PE/COFF binaries with a small footprint, we patch ADRP instructions into ADR instructions while doing the ELF to PE/COFF conversion. As it turns out, the linker may be doing the same, but for different reasons: there is a silicon erratum #843419 for ARM Cortex-A53 which affects ADRP instructions appearing at a certain offset in memory, and one of the mitigations for this erratum is to patch them into ADR instructions at link time if the symbol reference is within -/+ 1 MB. However, the LD linker fails to update the static relocation tables, and so we end up with an ADR instruction in the fully linked binary, but with a relocation entry in the RELA section identifying it as an ADRP instruction. Since the linker has already updated the symbol reference, there is no handling needed in GenFw for such instructions, and we can simply treat it as an ordinary ADR. However, since it is guaranteed to be accompanied by an add or load instruction with a LO12 relocation referencing the same symbol, the section offset check we apply to ADR instructions is going to take place anyway, so we can just disregard the ADR instruction entirely. Reported-by: Eugene Cohen <eugene@hp.com> Suggested-by: Eugene Cohen <eugene@hp.com> Tested-by: Eugene Cohen <eugene@hp.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Acked-by: Liming Gao <liming.gao@intel.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* BaseTools: Add support for parseing map files generated by CLANG9 in GenFvZhiguang Liu2019-11-081-5/+23
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2320 Add support for parseing map files generated by CLANG9 in GenFv Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* BaseTools: Add map file parsing support for CLANG9Zhiguang Liu2019-11-082-6/+12
| | | | | | | | Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* BaseTools GenFw: Fix the issue to update the wrong size as SectionSizeLiming Gao2019-10-241-2/+6
| | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1603 CLANG9 generated PE image exposes below two issues. 1. SectionSize is used to copy PE section data. It should be smaller than section raw size. 2. The real data is required to be copied. So, copy the min size of VirtualSize and SizeOfRawData. Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
* BaseTools tools_def: Add CLANG9 tool chain to directly generate PE imageLiming Gao2019-10-242-10/+118
| | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1603 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com>
* BaseTools tools_def.template: Remove unnecessary $(DEST_DIR_DEBUG) pathLiming Gao2019-10-241-11/+11
| | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1603 $(DEST_DIR_DEBUG) path is in Include directory. It is not required to be specified again. Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Do not call sys.setdefaultencoding with python 3Vitaly Cheptsov via Groups.Io2019-10-231-1/+1
| | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2301 This interface was a originally a no-op in python 3, and now is fully removed causing a build warning on macOS (Darwin). Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>> Acked-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fix an incremental build issue caused by macro in #includeLin, Derek (HPS SW)2019-10-181-7/+11
| | | | | | | | | | | | | | | | When c/h file use macro after #include, for example, In this case, GenMake is not able to create a healthy dependency for the c file. GenMake used to add $(FORCE_REBUILD) dependency in the c file, this guarantee the c file is always compiled in incremental build. But, this function is broken since 05217d210e8da37b47d0be58ec363f7af2fa1c18 which enable /MP for MSVC compiler, in order to compile multiple c files in one command multi-processing. The fix here is adding '$(FORCE_REBUILD)' back to retain the original function. Line number 1728 and 978 are the code pieces which handle this logic. Signed-off-by: Derek Lin <derek.lin2@hpe.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>