summaryrefslogtreecommitdiffstats
path: root/BaseTools
Commit message (Collapse)AuthorAgeFilesLines
* BaseTools/tools_def AARCH64 ARM: suppres PIE sections via linker scriptArd Biesheuvel2017-11-231-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | Recent distro builds of GCC 6 enable PIE linking by default, and allow the previous behavior to be restored by passing the -no-pie command line argument. Support for this was implemented by commits 1894a7c64c0a and 3380a591232d but unfortunately, it turns out that GCC 5 does not support this command line argument, and exits with an error. To avoid the need for yet another toolchain tag, to distinguish between GCC 5 and GCC 6, let's use our GCC linker scripts when building objects from .aslc files. This will ensure that the extra sections that are added by the PIE linker are discarded from the ELF binary, and so they will not corrupt the resulting .acpi file. This reverts 1894a7c64c0a BaseTools/tools_def AARCH64 ARM: disable PIE linking 3380a591232d BaseTools/tools_def AARCH64 ARM: disable PIE linking for .aslc sources Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix a bug for single module build with GenC/GenMake optionYonghong Zhu2017-11-201-5/+0
| | | | | | | | | | | when build a single module with GenC/GenMake option, currently it will direct return after create Autogen code files, then it cause MaList is empty, which cause an incorrect error message is reported. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Guid.xref contain information from FILE statements in FDFYonghong Zhu2017-11-201-2/+86
| | | | | | | | | | | | Update Guid.xref to contain information from FILE statements in FDF file. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=778 Cc: Liming Gao <liming.gao@intel.com> Cc: Dmitry Antipov <dmanti@microsoft.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix the bug to collect source files per build rule familyYonghong Zhu2017-11-201-4/+4
| | | | | | | | | | | | when collect source files list we should also consider build rule family. BuildRuleFamily may be set to the different one. It will impact BuildRule and source files in INF file. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=780 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix the bug to re-build uni file for LibraryYonghong Zhu2017-11-141-4/+6
| | | | | | | | | | | | | The root cause is Module's self.CanSkip() is before LibraryAutoGen, then when a uni file of library is changed, Module's self.CanSkip() is still true which cause the library is not regenerated. This patch change Module's self.CanSkip() after LibraryAutoGen. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=759 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: parse map file generated by Xcode on MacYonghong Zhu2017-11-032-1/+36
| | | | | | | | | | Add support to parse map file generated by Xcode on Mac to get variable offset and Patchable Pcd info in current EFI file. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/VfrCompile: Add check to avoid using NULL pointerDandan Bi2017-11-031-2/+6
| | | | | | | | | | | | | | | | | | | | Question value are stored in one specified storage, but the Data type of the storage is not specified or there is no sub fields in the Data type sometimes, so we need to add check before using related pointers. Here list some NULL cases: (1)For an efivastore which doesn't specify a data structure or a data type(UINT8,UINT16...)as the storage, just has VarName and VarSize instead, we can not get its data type before parsing its VarSize. (2)For efivastore which just specifies the data type(UINT8,UINT16...) not a structure as the storage,this data type doesn't have sub-fields. Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/tools_def AARCH64 ARM: disable PIE linking for .aslc sourcesArd Biesheuvel2017-11-011-2/+2
| | | | | | | | | | | | | | Commit 1894a7c64c0a ("BaseTools/tools_def AARCH64 ARM: disable PIE linking") works around an issue that was caught due to the fact that PIE linking produces broken .acpi files. However, v2 of that fix inadvertently only applied the workaround to the normal linker command line, and not to the ASLD one, so the issue still persists. So add the missing -no-pie options for ASLD on ARM and AARCH64. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/tools_def: suppress GCC predefined macros in DTB compilationArd Biesheuvel2017-10-271-1/+1
| | | | | | | | | | | | | | | | | | | The standard GCC preprocessor we use to preprocess device tree source files has a whole bunch of macros predefined, among which #define __linux 1 #define __linux__ 1 #define __gnu_linux__ 1 #define linux 1 This causes a property like 'linux,code' to be converted into '1,code' which is obviously wrong. So let's get rid of all the predefined macros by passing -undef to the preprocessor command line. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* BaseTools/tools_def AARCH64 ARM: disable PIE linkingArd Biesheuvel2017-10-271-2/+2
| | | | | | | | | | | Some prebuilt GCC toolchains targeting aarch64 (e.g., the Debian Stretch one) will default to building PIE executables. This has been observed to corrupt ACPI tables built from .aslc sources, so disable PIE linking altogether when using the GCC toolchain to build for AARCH64 or ARM. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/BuildEnv: override "set -C" (noclobber) in sourcing shell envLaszlo Ersek2017-10-181-1/+1
| | | | | | | | | | | | | | | The BuildEnv utility is sourced (executed by the user's interactive shell) when the user sets up the build session. Some users like to set -C (noclobber) for some additional safety in their shells, which trips up BuildEnv. Update the redirection operator so that it overrides noclobber. Cc: Liming Gao <liming.gao@intel.com> Cc: Thomas Huth <thuth@redhat.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Thomas Huth <thuth@redhat.com>
* BaseTools: Fix a bug Build directory should relative to WORKSPACEYonghong Zhu2017-10-163-1/+3
| | | | | | | | | | | | | The bug is for build output files it still use mws.join function, it cause maybe we will get the build output files in the PACKAGES_PATH because mws.join will try WORKSPACE first, if the file doesn't exist then try PACKAGES_PATH. But for build output, we expected it should relative to WORKSPACE. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix the Keyword error for <ExtendedFvEntry> in FDF FileYonghong Zhu2017-10-111-1/+1
| | | | | | | | | | | | current in FDF spec 3.6 [FV] section it use "FV_EXT_ENTRY_TYPE" as Keyword for <ExtendedFvEntry>, while in the code it use "FV_EXT_ENTRY". To keep compatibility, this patch support both keyword in the code first. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix the bug 'DSC DEFAULT' in report wrongly use FDF valueYonghong Zhu2017-10-113-15/+18
| | | | | | | | | | | | | | current the PCD value in DSC file may be override by FDF file, then it cause the 'DSC DEFAULT' in build report wrongly display the FDF value but not the DSC file's value. This patch add a attribute DscDefaultValue for PcdClassObject to save the actual DSC file's PCD value and use this value to display for 'DSC DEFAULT'. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix a bug to use module's Name attribute as compareYonghong Zhu2017-10-101-1/+1
| | | | | | | | | | | Fix a bug to use module's Name attribute as compare for single module build. ModuleFile.File can't be used to compare INF file, because it is the relative path. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: PI 1.6 to support FV extended header contain FV used sizeYunhua Feng2017-10-034-4/+39
| | | | | | | | | | | Per PI 1.6 we added an FV Extended Header entry that would contain the size of the FV that was in use. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix the regression bug to build single moduleYonghong Zhu2017-09-281-0/+12
| | | | | | | | | | The bug is introduced by 1b8eca to collect single module's build time. Now the fix solution is copied from Platform build. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: add support for BIOS build with binary cacheYonghong Zhu2017-09-273-9/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add three new options: --hash enables hash-based caching during build process. when --hash is enabled, build tool will base on the module hash value to do the incremental build, without --hash, build tool will base on the timestamp to do the incremental build. --hash option use md5 method to get every hash value, DSC/FDF, tools_def.txt, build_rule.txt and build command are calculated as global hash value, Package DEC and its include header files are calculated as package hash value, Module source files and its INF file are calculated as module hash value. Library hash value will combine the global hash value and its dependent package hash value. Driver hash value will combine the global hash value, its dependent package hash value and its linked library hash value. When --hash and --binary-destination are specified, build tool will copy generated binary files for each module into the directory specified by binary-destination at the build phase. Binary-destination directory caches all generated binary files. When --hash and --binary-source are specified, build tool will try to get the binary files from the binary source directory at the build phase.If the cached binary has the same hash value, it will be directly used. Otherwise, build tool will compile the source files and generate the binary files. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: report build time measured by module of EDKII BuildYonghong Zhu2017-09-263-11/+92
| | | | | | | | | | | In the build report, we add AutoGen Phase, Make Phase and GenFds Phase time duration in the Platform Summary section, and we also add a item in Module section to display module and library's build time. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: extend FFS alignment to 16MYonghong Zhu2017-09-2512-56/+140
| | | | | | | | | | Current FFS only supports 64KiB alignment for data, Per PI 1.6 requirement, we extend FFS alignment to 16M. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTool/VfrCompiler: Support Bit fields in EFI/Buffer VarStoreDandan Bi2017-09-218-490/+1196
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=545 Enhance VfrCompiler to parse following case: 1. EFI/Buffer VarStore can contain bit fields in their structure. 2. For question Oneof/Checkbox/numeric, their storage can be bit fields of an EFI VarStore/Buffer VarStore. Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTool/VfrCompile: Support Union type in VFRDandan Bi2017-09-213-37/+65
| | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=603 Update VfrCompiler to parse the UNION type in vfr file Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/tools_def AARCH64: enable frame pointers for RELEASE buildsArd Biesheuvel2017-09-191-5/+5
| | | | | | | | | | | | | | | | | | | | Commit 8f0b62a5dac0 ("BaseTools/tools_def AARCH64: enable frame pointers for DEBUG builds") removed the -fomit-frame-pointer switch from the CFLAGS definitions that are shared between AARCH64 DEBUG and RELEASE builds, and moved it to the RELEASE specific ones, so that DEBUG builds can produce a backtrace when a crash occurs. This is actually a useful thing to have for RELEASE builds as well. AArch64 has 30 general purpose registers, and so the performance hit of having a frame pointer is unlikely to be noticeable, nor are the additional 8 bytes of stack space likely to present a problem. So remove -fomit-frame-pointer altogether this time. Contributed-under: TianoCore Contribution Agreement 1.1 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: Fix a bug to correct SourceFileListYonghong Zhu2017-09-191-0/+7
| | | | | | | | | | | | | We met a case that use two microcode files in the Microcode.inf file, one is .mcb file, another is .txt file. then it cause build failure because the SourceFileList include the .txt file's output file, while this output file is still not be generated, so it cause GetFileDependency report failure. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix a bug for Mixed Pcd value display in the reportYonghong Zhu2017-09-111-1/+11
| | | | | | | | | | the case is that override the mixed pcd value in DSC [Components] section, the value display in the report is incorrect. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Not show *B when Pcd value in build option same with DECYonghong Zhu2017-09-091-3/+3
| | | | | | | | | | | Per build spec, If the value obtained from either a build option, the DSC or FDF is the same as the value in the DEC, then *B , *P or *F will not be shown in the report. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix the bug that same region print twice in the build logYonghong Zhu2017-09-091-26/+32
| | | | | | | | | This patch fixed the bug that same region print twice in the build log. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: correct to use specific arch to generate DSC databaseYonghong Zhu2017-09-091-1/+1
| | | | | | | | | Not generic to use 'Common' arch, but use current build arch. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/GCC: set -Wno-unused-const-variable on RELEASE buildsThomas Lamprecht2017-09-081-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TianoCore BZ#700 [1] Set the '-Wno-unused-const-variables' in RELEASE builds with the GGC49 and GCC5 toolchain. This fixes the RELEASE build of OVMF with GCC in version 6 or newer. GCC 6 added the '-Wunused-const-variable' warning, which gets activated by '-Wunused-variable' and has the following behavior: "Warn whenever a constant static variable is unused aside from its declaration" [2] Commit 2ad6ba80a1bd58382bde6b994070f7c01d2fb48d introduced a case where exactly this happens on a RELEASE build. All uses of the static const variable are located in debug code only, which gets thrown out by the compiler on RELEASE builds and thus triggers the unused-const-variable warning. There is currently no GCC 6 toolchain target defined and doing so would add a lot of boilerplate code. Instead, use the fact that GCC ignores unknown '-Wno-*' options: "[...] if the -Wno- form is used [...] no diagnostic is produced for -Wno-unknown-warning unless other diagnostics are being produced" This behavior is available in GCC 4.9 [3] (and also earlier, for that matter), so add the flag to the GCC49 and GCC5 toolchain, even if both GCC versions do not supports it. GCC49 doesn't enables LTO whereas GCC5 does. As GCC 6.0 through 6.2 had bugs relating to LTO there can be desire to use the GCC49 target even if compiling with GCC 6, see 432f1d83f77a. Orient the changes on 20d00edf21d2 which moved the '-Wno-unused-but-set-variable' flag to RELEASE builds only, as there it ensure that it does not gets raised if the only usage of a variable is in (then collapsed) debug code. [1] https://bugzilla.tianocore.org/show_bug.cgi?id=700 [2] https://gcc.gnu.org/onlinedocs/gcc-6.4.0/gcc/Warning-Options.html#index-Wunused-const-variable [3] https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Warning-Options.html Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> [lersek@redhat.com: fix typo in subject]
* BaseTools: update help info for -Y option to include 'HASH'Yonghong Zhu2017-09-051-1/+1
| | | | | | | | | | Per build spec,the default set of flags for -Y option include 'HASH', so this patch to update the help info. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/Gcc ARM AARCH64: add support for building device tree binariesArd Biesheuvel2017-08-312-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While modern AARCH64 server systems use ACPI for describing the platform topology to the OS, ARM systems and AARCH64 outside of the server space mostly use device tree binaries, which are compiled from device tree source files using the device tree compiler. Currently, such source files and binaries may be kept in the EDK2 platform trees, but are not integrated with the build, which means they need to be kept in sync and recompiled manually, which is cumbersome. So let's wire up BaseTools support for them: add tool definitions for the DTC compiler and preprocessor flags that allow these source files to use FixedPcd expressions and other macros defined by AutoGen.h This way, a device tree binary can be built from source and emitted into a FFS file automatically using something like: DeviceTree.inf: [Defines] INF_VERSION = 0x00010019 BASE_NAME = SomePlatformDeviceTree FILE_GUID = 25462CDA-221F-47DF-AC1D-259CFAA4E326 # gDtPlatformDefaultDtbFileGuid MODULE_TYPE = USER_DEFINED VERSION_STRING = 1.0 [Sources] SomePlatform.dts [Packages] MdePkg/MdePkg.dec SomePlatform.fdf: INF RuleOverride = DTB xxx/yyy/DeviceTree.inf [Rule.Common.USER_DEFINED.DTB] FILE FREEFORM = $(NAMED_GUID) { RAW BIN |.dtb } where it can be picked at runtime by the DTB loader that may refer to it using gDtPlatformDefaultDtbFileGuid. Note that this is very similar to how ACPI tables may be emitted into a FFS file with a known GUID and picked up by AcpiTableDxe at runtime. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Enable --whole-archive in GCC tool chain as the default optionLiming Gao2017-08-311-2/+2
| | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=581 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools/Conf: Support LLVM39 and LLVM40 in CLANG38 toolchainShi, Steven2017-08-291-2/+3
| | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=676 Add LLVM39 and LLVM40 support in CLANG38 toolchain Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Steven Shi <steven.shi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Update toolsetup.bat to support the case without EDK_TOOLS_BINLiming Gao2017-08-291-10/+5
| | | | | | | | | | | When EDK_TOOLS_BIN is not set, %EDK_TOOLS_PATH%\Bin\Win32 will be used as the binary tool directory. But, %EDK_TOOLS_PATH%\Bin\Win32 may not exist. On this case, toolsetup.bat should continue to do the other setting, such VS tool chain and tool conf file copy. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Support /WHOLEARCHIVE option in VS2015 tool chainLiming Gao2017-08-292-1/+6
| | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=582 Don't enable this option in the default setting, because it may cause VS2015 linker crash. Platform can enable this option in PlatformPkg.dsc like below: [BuildOptions] *_*_*_DLINK2_FLAGS = /WHOLEARCHIVE Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools/EfiRom: Add multiple device id supportDaniel Verkamp2017-08-262-23/+129
| | | | | | | | | | | | | | | | | | This is a patch to implement writing and dumping of PCI 3.0 Device ID lists in EFI option ROMs in the EfiRom tool. Using this modification, multiple space-delimited device IDs can be specified after -i. The first device in the list is used for the main PCI ROM header Device ID field and is also written in the list. The list is only written when more than one device ID has been specified; when only one device ID is given on the command line, the EfiRom output should be identical to the current code. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=666 Cc: Liming Gao <liming.gao@intel.com> Cc: Tomas Pilar <tpilar@solarflare.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Update tools_def to remove /Gw option in VS NOOPT targetLiming Gao2017-08-251-16/+16
| | | | | | | | To remove /Gw option is to disable size optimization. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Add the missing -pie link option in GCC tool chainLiming Gao2017-08-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=671 GCC tool chain uses -fpie in CC_FLAGS. So, add -pie in DLINK_FLAGS. More discussion in https://lists.01.org/pipermail/edk2-devel/2017-August/013508.html 3.13 Options for Linking ======================== '-pie' Produce a position independent executable on targets that support it. For predictable results, you must also specify the same set of options used for compilation ('-fpie', '-fPIE', or model suboptions) when you specify this linker option. 3.18 Options for Code Generation Conventions ============================================ '-fpie' '-fPIE' These options are similar to '-fpic' and '-fPIC', but generated position independent code can be only linked into executables. Usually these options are used when '-pie' GCC option is used during linking. '-fpie' and '-fPIE' both define the macros '__pie__' and '__PIE__'. The macros have the value 1 for '-fpie' and 2 for '-fPIE'. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* BaseTools/UPT: Fix UNI file name issueHess Chen2017-08-244-4/+16
| | | | | | | | | Fix the issue of creating duplicate UNI file names Fix the issue of removing packages Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Roll back GenFw Change to keep unknown field in RSDS debug entryLiming Gao2017-08-241-7/+1
| | | | | | | | | | | | | https://lists.01.org/pipermail/edk2-devel/2017-August/013488.html These fields are actually a GUID and DWORD respectively: the GUID identifies the PDB to make it possible to verify that a given PDB matches the PE file, and the DWORD is the "age" of the PDB which is simply a helper value that is incremented by 1 by the linker every time the file is remade. Wiping the GUID will cause PDB parsers (such as the MS DIA SDK that IDA and most other tools use) to treat the PDB as a mismatch and refuse to load it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix Segmentation fault: 11 when build AppPkg with XCODE5Andrew Fish2017-08-141-1/+11
| | | | | | | | | | | | | | it is a bug in mtoc setting the size of the debug directory entry to the size of the .debug section, not the size of the EFI_IMAGE_DEBUG_DIRECTORY_ENTRY. It was causing a loop to iterate and get bogus EFI_IMAGE_DEBUG_DIRECTORY_ENTRY data and pass that to memset() and boom. Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Andrew Fish <afish@apple.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Support TabSpace between section tag in DEC fileYanyan Zhang2017-08-131-1/+1
| | | | | | | | | | | | | | Per DEC spec, multiple section tag use <TS> to separate, and it can support Tab, so this patch fix the bug to use Tab. <TabSpace> ::= {<Tab>} {<Space>} <TS> ::= <TabSpace>* Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yanyan Zhang <yanyanx.zhang@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Don't need to add extra quotes when UI string from fileBin Wang2017-08-121-2/+1
| | | | | | | | | | | when the UI string is read from files, we don't need to add the extra quotes. Otherwise, it will cause UI name has this extra quotes. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Bin Wang <binx.a.wang@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools/UPT: Support Multiple InstallationHess Chen2017-08-128-102/+145
| | | | | | | | | Add a new feature to UPT to support installing multiple DIST packages in one time. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools/Scripts: Add sample makefile for use with RunMakefile.pyMichael D Kinney2017-08-111-0/+43
| | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=670 Add sample makefile that can be used to test RunMakefile.py script and can also be used as a template to start a new PREBUILD/POSTBUILD makefile. This makefile contains TAB characters instead of spaces on purpose to maximize compatibility with make utilities. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools/Scripts: Add python script to run a makefileMichael D Kinney2017-08-111-0/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=670 Add the python script RunMakefile.py that can be used in a PREBUILD/POSTBUIILD action to invoke a makefile passing in context as makefile defines. The command line arguments passed into RunMakefile.py are converted to the following set of defines. * ACTIVE_PLATFORM * TARGET_ARCH * TOOL_CHAIN_TAG * CONF_DIRECTORY * TARGET * EXTRA_FLAGS In addition, a makefile can access the system environment variables including WORKSPACE and PACKAGES_PATH. The makefile target from the following set is also passed into the makefile. If no target is passed into build, then the 'all' target is used. [all|fds|genc|genmake|clean|cleanall|cleanlib|modules|libraries|run] A platform DSC file can use a statements in the [Defines] section of the following form to use this script. MAKEFILE is a WORKSPACE or PACKAGES_PATH relative path to the makefile to run. [Defines] PREBUILD = python BaseTools/Script/RunMakefile.py --makefile MAKEFILE POSTBUILD = python BaseTools/Script/RunMakefile.py --makefile MAKEFILE Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools/build: Expand PREBUILD/POSTBUILD DSC actionsMichael D Kinney2017-08-112-30/+82
| | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=670 * Extend PREBUILD/POSTBUILD define values to support more than one argument. * Delay normalization of PREBUILD/POSTBUILD define values until all arguments in the define values can be processed. * Convert PREBUILD/POSTBUILD build define value arguments that are WORKSPACE or PACKAGES_PATH relative paths to absolute paths. * Append -p PlatformFile, --conf=ConfDirectory, and build target flags to command line used to execute PREBUILD/POSTBUILD actions. * Remove PrebuildScript and PostbuildScript fields from the Build class and use Prebuild and Postbuild fields instead. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Fix Xcode 9 Beta treating 32-bit left shift as undefinedYonghong Zhu2017-08-112-4/+4
| | | | | | | | | | Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=635 Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Andrew Fish <afish@apple.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/Conf: apply nasmb, asm16 build rule orderChris Ruffin2017-08-071-1/+1
| | | | | | | | | Prioritize nasmb rule over asm16 where both source types are specified. Change-Id: I33ec348dab66b313ddb05cb15f2d8407a648c320 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chris Ruffin <chris.ruffin@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/VfrCompile: Remove the MAX_PATH limitationDandan Bi2017-08-042-26/+1
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=579 Since we have already used LongFilePath() to convert file path, so we can remove the MAX_PATH limitation. Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Daniel Díaz <daniel.diaz@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>