summaryrefslogtreecommitdiffstats
path: root/BaseTools
Commit message (Collapse)AuthorAgeFilesLines
* BaseTools: Add support to merge Prebuild and Postbuild into build ProcessYonghong Zhu2016-04-078-22/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | This feature is enhance build tool to incorporate execution of prebuild and postbuild. 1.Prebuild script a.DEFINE PREBUILD in DSC [Defines] section b.Build command -D PREBUILD to override the one in DSC [Defines] section 1)If PREBUILD is a file, then this file will be used as prebuild script. 2)If PREBUILD is empty, then prebuild script will be disabled. 3)If PREBUILD is not defined in [Defines] section and not passed in on command line, then prebuild script is also disabled. 2.Prebuild option a.All options of build tool b.TARGET, ARCH and TOOL_CHAIN_TAG value, Those value will be from target.txt file if they are not in build command line. c.Additional options following prebuild definition. Quotes are needed when these additional options are present. d.Quotes would also be required if the path to the prebuild command contains space or special characters. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Enhance --Pcd which override by build optionYonghong Zhu2016-04-072-1/+3
| | | | | | | | | This patch 1) enhance the help info for --pcd to use " but not '. 2) Add the condition statements for build option Pcd type check. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: cache the defined Guid tool to improve the performanceYonghong Zhu2016-04-062-3/+8
| | | | | | | | | | | Current GenFds Tool class GuidSection() is parsing the tools_def.txt for every GUID'ed section that has a GUID defined tool, it cause a bad performance. so this patch cache the defined Guid tool to improve the performance. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/GenFds: Fix the bug for wrong alignment generate for RAW fileYonghong Zhu2016-04-053-42/+23
| | | | | | | | | | | When do the multiple raw file support feature, it cause the regression that the raw file section alignment value was wrongly overridden by the single raw file. this patch: 1) fix the wrong overridden bug. 2) remove the duplicate code for combine multiple raw file into one. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Add two new sections for PCD in the build reportYonghong Zhu2016-03-293-17/+104
| | | | | | | | | | | | | Build Spec updated to add two new sections for PCD in the build report. 1.Conditional directives section:If the DSC or FDF file contains conditional directive statements. 2.Unused PCDs section: If the DSC or FDF file define values for PCDs that are not used by any module and are not used in conditional directive statements. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Remove the unnecessary check for RAW FileYonghong Zhu2016-03-281-2/+0
| | | | | | | | | Because the __VerifyFile function already checked whether the file is valid. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: generate alignment when the FV content come from the filesystemYonghong Zhu2016-03-271-1/+19
| | | | | | | | | | | when the FV contents come from the filesystem instead of from a named FDF section, the build tool missed to generate alignment for this FV. The fix is get the alignment value from FV header and use this value to generate alignment. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Extend the RAW format to support multiple binary filesYonghong Zhu2016-03-273-3/+107
| | | | | | | | | | | | | | | | Current FDF spec updated to support multiple binary files for RAW File in the [FV] and [Capsule] section. For the multiple normal files, it may have the optional FfsAlignment. Example: FILE RAW = 197DB236-F856-4924-91F8-C1F12FB875F3 { Align=16 $(PLATFORM_PACKAGE)/Binaries/File1.pdb Align=16 $(PLATFORM_PACKAGE)/Binaries/File2.pdb Align=16 $(PLATFORM_PACKAGE)/Binaries/File3.pdb } Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools AARCH64: move DEBUG GCC49 to the small code modelArd Biesheuvel2016-03-251-4/+6
| | | | | | | | | | | | | | | | | | | When building AARCH64 platforms that include a Shell binary built from source, we run into trouble when using the tiny code model for DEBUG builds. The reason is that the Shell binary built in DEBUG mode exceeds the 1 MB range of the ADR instruction, so anything that gets pulled into the final link of the Shell binary either needs to be built with the small or large model, or needs to be sorted in some way to put the ADR references close to their targets. Since code size is not a big concern for DEBUG builds anyway, let's move to the small code model for all modules when using DEBUG GCC49. This way, there is no need for workarounds that are specific to UEFI_APPLICATION modules in general, or the Shell application in particular. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* BaseTools/GCC: set -Wno-unused-but-set-variables only on RELEASE buildsArd Biesheuvel2016-03-251-10/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | This aligns the GCC definitions for 4.6 and up to align with the ARM and AARCH64 definitions, which is to ignore unused but set variables only on RELEASE builds. This allows us to find instances of unused variables that are left behind after refactoring. It also allows us to find bad new code, which, due to the EDK2 coding style which disallows initialized automatic variables, may contain such variables without having been noticed by other toolchains. (Slightly edited) observation from Jordan Justen <jordan.l.justen@intel.com>: RELEASE builds must keep the flag because debug code (such as assertions) may collapse to nothing -- e.g. if a platform defines MDEPKG_NDEBUG for RELEASE -- and therefore trigger the warning. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> [lersek@redhat.com: incorporate commit message update from Jordan] Signed-off-by: Laszlo Ersek <lersek@redhat.com>
* BaseTools: Updated BuildNotes URLsPeter Kirmeier2016-03-251-2/+2
| | | | | | | | | | Updated URLs (git repository and step-by-step instructions) Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Peter Kirmeier <topeterk@freenet.de> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: not include the undefined macro in response fileYonghong Zhu2016-03-232-7/+41
| | | | | | | | | | | | | | In last Nmake patch, when we generate the response file, we would replace all the Macros in the make file. Once there have undefined macro used, the tool direct report error. In this patch, we use following solution to resolve the failure. 1. Add all the defined macros into AutoGenObject macro dict 2. For the undefined macros which used in the Make file, when we generate the response file, we not include this macro, let make phase to handle. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix nmake failure due to command-line length limitationYonghong Zhu2016-03-224-2/+135
| | | | | | | | | | | | | | | | | | | | | | NMAKE is limited to command-line length of 4096 characters. Due to the large number of /I directives specified on command line (one per include directory), the path length of WORKSPACE is multiplied by the number of /I directives and can exceed the limit. This patch: 1. Add new build option -l, --cmd-len to set the maximum command line length, default value is 4096. 2. Generate the response file only if the command line length exceed its maximum characters (default is 4096) when build the module. Cover PP_FLAGS, CC_FLAGS, VFRPP_FLAGS, APP_FLAGS, ASLPP_FLAGS, ASLCC_FLAGS and ASM_FLAGS. 3. The content of the response file is combine from the FLAGS option and INC option. 4. When build failure, it would print out the response file's file location and its content. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: add new command line option to support override PCD valueYonghong Zhu2016-03-166-16/+156
| | | | | | | | | | | | | | | | | | | | | this patch add new feature to support override PCD value on the command line. The value from the command line is the highest priority. 1.Add option(--pcd) to support both PcdName and TokenSpaceGuild.PcdName 2.For void* type PCD, use following format: cstring PCD: --pcd PcdName="string" unicodestring PCD: --pcd PcdName=L"string" CArray PCD: --pcd PcdName=B"{0x1, 0x2}" 3.Build Report, use *B to show the PCD value was overridden in the command line. 4.Error Condition: Report error if the PCD is not found Report error if the PcdName is found under multiple different TokenSpaceGuid Report error if PCD value syntax is incorrect Report error if void* type PCD value exceed its max size Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Support recent versions of cx_freeze.Marvin Haeuser2016-03-151-1/+1
| | | | | | | | | | | This patch fixes the assumed invalid command to start recent versions of cx_freeze on Windows, which are python and not Windows executables. To launch them correctly, the '$(PYTHON_HOME)\python' prefix has been added, so that Python can interpret the tool. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Add two macros into AutoGenObject macro dictYonghong Zhu2016-03-151-0/+2
| | | | | | | | | | Add DEST_DIR_OUTPUT and DEST_DIR_DEBUG into AutoGenObject macro dict. Because some module (eg: BaseUefiCpuLib) may use this macro in the make file. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Mentioned get_vsvars.bat at ReadMePeter Kirmeier2016-03-151-1/+3
| | | | | | | | | | | When someone doesn't know where to find or what to do with vsvars32.bat, get_vsvars.bat can be used. CC: Yonghong Zhu <yonghong.zhu@intel.com> CC: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Peter Kirmeier <topeterk@freenet.de> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/BPDG: Fix the bug to get the PCD SizeYonghong Zhu2016-03-141-15/+15
| | | | | | | | | | The original bug is only consider int format of PcdSize, but forgot the Hex format. The fix is use the already exist variable PCD.PcdBinSize which done to translate PCD size cover both format. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: update the mail address for stack trace infoYonghong Zhu2016-03-114-5/+5
| | | | | | | | | | Update the mail address from edk2-devel@lists.sourceforge.net to edk2-devel@lists.01.org. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Andrew Fish <afish@apple.com>
* BaseTools ConvertMasmToNasm: Support Python 3Jordan Justen2016-03-101-43/+47
| | | | | | | | | | | | | | | The script is updated to support both python 2.7 and python 3. v2: * Use io.open() rather than open() (Jaben) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Erik Bjorge <erik.c.bjorge@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
* BaseTools ConvertMasmToNasm: Fix exception when no arguments are givenJordan Justen2016-03-101-48/+37
| | | | | | | | | | | | | | | Convert to use the argparse library rather than optparse. As part of the conversion, the script will now give an error message if no arguments are given. Previously the script would give an exception when no arguments were given. Fixes: https://github.com/tianocore/edk2/issues/65 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools ConvertMasmToNasm: Fix running script outside of a git treeJordan Justen2016-03-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The script previously would hit an exception if it was run outside of a git tree. The exception looked like: edk2/BaseTools/Scripts/ConvertMasmToNasm.py Version 0.01 Traceback (most recent call last): File "edk2/BaseTools/Scripts/ConvertMasmToNasm.py", line 986, in <module> ConvertAsmApp() File "edk2/BaseTools/Scripts/ConvertMasmToNasm.py", line 984, in __init__ ConvertAsmFile(src, dst, self) File "edk2/BaseTools/Scripts/ConvertMasmToNasm.py", line 209, in __init__ CommonUtils.__init__(self, clone) File "edk2/BaseTools/Scripts/ConvertMasmToNasm.py", line 69, in __init__ self.gitemail = clone.gitemail AttributeError: ConvertAsmApp instance has no attribute 'gitemail' Fixes: https://github.com/tianocore/edk2/issues/63 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Update ARM/AArch64 GenFv vector processing for encapsulated FVsCohen, Eugene2016-03-101-186/+402
| | | | | | | | | | Instead of only handling SEC Core or PEI Core instances in the outer FV, the GenFv tool will now recurse into FV image FFS files to look for instances in encapsulated FVs so the vector area can be updated appropriately. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eugene Cohen <eugene@hp.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: report warning if VOID* PCD with {} value is not 8-byte alignedYonghong Zhu2016-03-102-4/+18
| | | | | | | | | | For VOID* Pcd with {} value, If platform developer wants to put in a specific hex offset value that is not 8-byte aligned for VOID * then we allow it with a warning message. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Change source files to DOS format.Liming Gao2016-03-1011-55/+55
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Add Multiple Workspaces support for custom Makefiles.Marvin Haeuser2016-03-091-3/+5
| | | | | | | | | | | | | This patch makes sure the MODULE_DIR variable points to the correct location when multiple workspaces are used. Currently, it is always prefixed with $(WORKSPACE), which only works as long as the package is in the Workspace. Code modules were not effected because the required paths were valid, but for custom Makefiles, the MODULE_DIR variable is used. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools/LZMA: fix the format issue for last patchYonghong Zhu2016-03-031-2/+3
| | | | | | | | | | | | There are no functional changes in this patch. fixing the format base on last commit. The only change is 1) add back the blank line, which can help we better compare with the original LZMA source code. 2) remove the indent of #ifndef and #endif. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: fix LzmaCompress VS2013 make failureYonghong Zhu2016-02-291-1/+2
| | | | | | | | | when make BaseTools by VS2013, LzmaEnc.c report warning C4127: conditional expression is constant, so this patch fix this issue. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/tools_def.txt: Add -march=i586 for IA32 GCC targetsMichael Kinney2016-02-241-2/+2
| | | | | | | | | | | | | | | | | | | | Newer GCC compilers use a default of march higher than i586 for -m32 (IA32 configuration) and this is causing generation of instructions that are not compatible with all IA32 targets. Specically Galileo platform support in the QuarkPlatformPkg does not boot if GCC48 or higher is used. This is similar to the following checkin that was done to address this same issue for VS2012 and higher tool chains: SHA-1: 71028ba2c4c398d70475504e671d048d9003d90f Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Leroy Leahy <leroy.p.leahy@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/Trim: Fix the bug for stripping when no line directive in fileYonghong Zhu2016-02-191-3/+34
| | | | | | | | | when no line directive in file, the tool still need to strip the typedef statement (eg: typedef struct, typedef union ..). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/Conf/XMLSchema: Reformat XML using Visual Studio 2013Larry Hauch2016-02-191-2631/+3056
| | | | | | | | | | | | | | | There are no functional changes in this patch. The only change is to the XML format, updated using Visual Studio Edit->Advanced->Format Document. Different XML Schema editors use different formats for indentation and line breaks. Visual Studio 2013 uses a two space indentation for content. Cc: Zhu Yonghong <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Larry Hauch <larry.hauch@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: LzmaCompress: fix gcc-6 warning "misleading-indentation"Laszlo Ersek2016-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The way the first use of the "_maxMode" variable is commented out (i.e., together with the enclosing "if" statement) in GetOptimum() triggers the "misleading-indentation" warning that is new in gcc-6.0, for the block of code that originally depended on the "if" statement. Gcc believes (mistakenly) that the programmer believes (mistakenly) that the block depends on (repIndex == 0) higher up. Restore the if statement, with a controlling expression that comprises the constant 1 and "_maxMode" commented out. Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Cole Robinson <crobinso@redhat.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reported-by: Cole Robinson <crobinso@redhat.com> Suggested-by: Jordan Justen <jordan.l.justen@intel.com> Build-tested-by: Cole Robinson <crobinso@redhat.com> Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1307439 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/VolInfo: add some generic optionsYonghong Zhu2016-02-181-47/+94
| | | | | | | | | | The Help information provided by VolInfo does not follow the EDK II Tools Design doc, so this patch update the help text and add the generic options: -d, -v, -q, -s. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: report an error message when failed to start build commandYonghong Zhu2016-02-181-1/+2
| | | | | | | | | | when build.py was failing to build packages but was not providing any error message except for “Failed to start command.” this patch provide the error message. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/GenFw: Fix a bug for GCC buildYonghong Zhu2016-02-182-2/+4
| | | | | | | | | current GCC build report error: 'for' loop initial declarations are only allowed in C99 or C11 mode, the patch fix this failure. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/GenFw: Correct datatypes in diagnostic messages and check for ↵Michael LeMay2016-02-172-6/+24
| | | | | | | | | | | | | | | string termination This patch revises multiple diagnostic messages to use correct datatypes. It also checks that a symbol name that is about to be used in a diagnostic message is terminated by a null character within the contents of the string table section so that the print routine does not read past the end of the string table section contents when reading the symbol name. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael LeMay <michael.lemay@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools/GenFw: Enhance error message for bad symbol definitionsMichael LeMay2016-02-173-6/+119
| | | | | | | | | | | | | | | | | | | | This patch expands the error message that is output when GenFw encounters a bad symbol definition or an unsupported symbol type. It displays the symbol name, the symbol address, and a message that describes both possibilities (bad symbol definition or unsupported symbol type). It also provides two examples of unsupported symbol types. Furthermore, this patch revises the conditional for detecting bad symbol definitions to eliminate a redundant test (a Sym->st_shndx value of SHN_ABS should certainly be greater than mEhdr->e_shnum) and to change another test from 'Sym->st_shndx > mEhdr->e_shnum' to 'Sym->st_shndx >= mEhdr->e_shnum' for consistency with the test in GetShdrByIndex. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael LeMay <michael.lemay@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools/GenFw: Exit with error when header lookup failsMichael LeMay2016-02-172-5/+12
| | | | | | | | | | | | This patch revises GetPhdrByIndex and GetShdrByIndex to cause GenFw to exit with an error message when a section header lookup fails. The current behavior of those functions in such circumstances is to return NULL, which can cause GenFw to subsequently fault when it attempts to dereference the null pointer. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael LeMay <michael.lemay@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools-Source: Update displayed version informationedk2 dev2016-02-1611-59/+65
| | | | | | | | | | | | | Standardize the --version and --help text command-line options Updated tools to correctly display the Build number when using command-line option --version and exit successfully after termination. Ecc was also updated to print informational messages after the options are parsed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Larry Hauch <larry.hauch@intel.com> Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
* BaseTools/GenFw AARCH64: add support for relative data relocationsArd Biesheuvel2016-02-151-10/+12
| | | | | | | | | | | | | | | | | This adds support to the ELF to PE/COFF conversion performed by GenFw for the AArch64 ELF relocation types R_AARCH64_PREL64, R_AARCH64_PREL32 and R_AARCH64_PREL16. Since we already require the ELF and PE/COFF section layouts to be identical in order to support other relative relocation types, this is simply a matter of whitelisting these new relocation types in the same way. While we're at it, clean up the code a bit, and add a comment explaining why these relocations are ignored in WriteRelocations64 (). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Update BaseTools to pass VS2015 compilerYonghong Zhu2016-01-295-31/+29
| | | | | | | | | | | | Fix some errors to pass VS2015 compiler. 1. warning C4456: declaration of xxx hides previous local declaration 2. warning C4005: 'UINT8_MAX': macro redefinition Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19768 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools:Incremental build not work if VPD values in DSC changed by -DYonghong Zhu2016-01-292-34/+17
| | | | | | | | | | | | | | If a -D flag is passed into build that selects different lines in [PcdsDynamicExVpd], then build does not see any changes to the timestamp of the DSC file and the VPD tool is not used to regenerate the VPD region based in the statements that are active. so we changed the detect condition and use SaveFileOnChange function to generate VPD. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19767 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools: Fix the bug for VOID* Patchable PCD declaration in LibraryYonghong Zhu2016-01-291-3/+12
| | | | | | | | | | | VOID* Patchable PCD in Library has the different declaration from the one in Driver, this issue that will cause GCC LTO build failure. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19766 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools: Fix a bug for VpdOffset calculateYonghong Zhu2016-01-291-2/+16
| | | | | | | | | | | The VpdOffset value in the DSC both support integer and Hex value, so we fix the bug to support both format. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19765 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools: Fix the bug when no FD section in the FDF fileYonghong Zhu2016-01-261-5/+6
| | | | | | | | | | | Check if the Fdf.CurrentFdName is not None and in Fdf.Profile.FdDict before using it which fix a crash issue when no FD section in FDF file. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19747 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools: make build report tolerant of FVs specified by nameEugene Cohen2016-01-211-34/+38
| | | | | | | | | | | | | Check if the FV name is in the FV dictionary before using it which fixes a crash during build report generation when FVs are specified by path in the FDF. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eugene Cohen <eugene@hp.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19705 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools: Improve LzmaF86Compress wrapperCharles Duffy2016-01-202-14/+16
| | | | | | | | | | | | - Remove test usage declared obsolescent by POSIX - Pass argv array through as literal rather than forming into a string, then string-splitting and glob-expanding same. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Charles Duffy <chaduffy@cisco.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19697 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools: Use python2 if available in Tests/GNUmakefileCharles Duffy2016-01-201-1/+1
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Charles Duffy <chaduffy@cisco.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19696 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools: Improve shell wrapper for C build commandsCharles Duffy2016-01-2032-480/+480
| | | | | | | | | | | | | | - Avoid obsolescent forms of test builtin (`-a` and `-o`; see APPLICATION USAGE section of http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html). - Quote all expansions to prevent string-splitting and globbing. - Avoid unspecified "exit -1" (only single-byte integers are valid); instead, use identical exit status to shell command-not-found. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Charles Duffy <chaduffy@cisco.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19695 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools: Improve shell wrappers for Python build commandsCharles Duffy2016-01-2016-32/+180
| | | | | | | | | | | | | | | | | | | | - Use `python2` executable if it exists, to avoid breakage on systems (such as Arch Linux) where `python` is Python 3. - Quote all references to `$0`, for safety when located in a directory containing spaces in its name. - Use the `exec` shell command to avoid leaving the shell wrapper in the process table when invoking the actual build tool. - Use `"$@"` rather than `$*` to pass arguments through directly rather than concatenating to a string, and then string-splitting and glob-expanding its contents. - Use `$BASH_SOURCE` in preference to `$0` (which is only guaranteed to be process name, *not* source path). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Charles Duffy <chaduffy@cisco.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19694 6f19259b-4bc3-4df7-8a09-765794883524