summaryrefslogtreecommitdiff
path: root/BaseTools/Conf
AgeCommit message (Collapse)Author
2016-07-13BaseTools: use unsigned chars on ARM architecturesLeif Lindholm
By default, the ARM architectures have unsigned chars, whereas the other architectures supported by EDK2 by default have signed chars. However, EDK2 uses -funsigned-chars on those architectures to change the default behaviour. Unfortunately, the ARM architectures explicitly break their default behaviour by specifying -fsigned-chars (I presume in a pre-emptive attempt at avoiding incompatibility). Since this situation is already confusing enough, switch the ARM architectures to also specify -funsigned-chars explicitly rather than just dropping the current parameter. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit 3f7f28717892d8c82065f25070d36ba7eca3dccd)
2016-07-13BaseTools: Remove /Oi from Visual Studio tool chains.Cinnamon Shia
Remove /Oi from Visual Studio tool chains. because of the following reasons: 1. Intrinsic is Compiler-dependent. 2. Adding /Oi (Generate Intrinsic Functions) doesn't promise 100% replacing the function call with inline functions. /Oi is only a request, but doesn't force, the compilers to use the intrinsic. The visual studio optimizer can still use the library version. 3. Since EDK2 doesn't include Visual Studio header files, intrinsic function should not be used. Built Nt32Pkg, OvmfPkg, ShellPkg, MdeModulePkg and CryptoPkg successfully. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Qin Long <qin.long@intel.com> (cherry picked from commit 716132efb1a650586d5d1f1fde9dd9d183f45bc8)
2016-07-13BaseTools AARCH64: move DEBUG GCC49 to the small code modelArd Biesheuvel
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> (cherry picked from commit f37d891c1b870b294964adf65f619a661700fcab)
2016-07-13BaseTools/GCC: set -Wno-unused-but-set-variables only on RELEASE buildsArd Biesheuvel
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> (cherry picked from commit 20d00edf21d2f2144921622891d8b59a1553cd83)
2016-03-02BaseTools/tools_def.txt: Add -march=i586 for IA32 GCC targetsMichael Kinney
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> (cherry picked from commit c261c27dcee4603b9628d68639e7dccc4253af7e)
2016-02-24BaseTools/Conf/XMLSchema: Reformat XML using Visual Studio 2013Larry Hauch
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> (cherry picked from commit cbf14fa0845d118a85cb691a02f3793ffce45e82)
2016-02-24BaseTools AARCH64: build XIP modules with strict alignmentArd Biesheuvel
GCC for AARCH64 recognizes byte swapping load and store sequences and may replace them with wider loads or stores combined with rev instructions. In some cases (i.e., with GCC version 5 and later) this may result in unaligned accesses, which are not allowed before we turn the MMU on. So build any modules or static libraries that may execute with the MMU off with -mstrict-align. Other modules don't need this switch, so we can remove it from the CLANG35/AARCH64 common CC flags. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19638 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit d764d59849b782c11424f27c2148ecb057533a76)
2016-02-24BaseTools AARCH64: add separate GCC build rule for XIP objectsArd Biesheuvel
This introduces a special .c to .obj build rule for GCC/AARCH64 that takes into account additional compiler flags that have been specified via *_*_*_CC_XIPFLAGS. These will be passed after (and in addition to) the ordinary CC_FLAGS. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19637 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 3a02a87f9f4dd5ba6741e64e20e5ab67fe4f303b)
2016-02-24BaseTools CLANG35: use -target in PP flags as wellArd Biesheuvel
The Clang preprocessor may rely on builtin defines that are target dependent, so we should add the -target argument also when invoking the preprocessor directly. 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: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19584 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit c2a892d7c8a78143006bb7fdc95fb18f7e2fc685)
2016-02-24BaseTools CLANG35: use linux-gnu target triplets explicitlyArd Biesheuvel
Since we are combining Clang with the GNU linker, make that explicit in the target triplet. This affects certain builtin defines and other compiler behavior that may be unspecified otherwise. 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: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19583 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit d4dcd5542a88eeee5a268284a4dfe026918f1720)
2015-12-18BaseTools ARM: add CLANG35 supportArd Biesheuvel
This extends the existing CLANG35 toolchain definition with support for building for the ARM architecture. In order to be able to reuse the existing ARM GCC definitions as much as possible, the following changes have been made to the existing ARM GCC support: - the -mapcs option has been removed; it is a no-op under Thumb (our default) and we use AAPCS (-mabi=aapcs) anyway - the -mword-relocations option has been moved from GCC_ARM_CC_FLAGS to the GCC4x specific option: CLANG does not support it, and uses '-mllvm -marm-use-movt=0' instead. (Sync patch r19284 from main trunk.) 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19386 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-18BaseTools RVCT: use scatter file to enforce minimum section alignmentArd Biesheuvel
Up until SVN r18540, GenFw created invalid PE/COFF binaries for the ARM architecture, by allowing PE/COFF .data sections to appear at offsets that were not aligned to the global PE/COFF section alignment. The reason for this was that the relocation metadata emitted by RVCT's armlink only contains dynamic absolute relocations, so it is impossible to recalculate relative relocations between .text and .data, and so the relative offset between the two needs to be preserved. Since r18540, we do align .data to the PE/COFF section alignment, resulting in potentially corrupt PE/COFF binaries unless .data happens to appear at a 32-byte aligned offset. So let's introduce a RVCT scatter file that sets this alignment for the ELF .data section (and subsequent .bss section). At the same time, set the start offset to 0x220 bytes (which is the size of our 32-bit PE/COFF header) so that the memory layouts are identical between ELF and PE/COFF. Also add a 4 KB aligned version that can be used to build DXE_RUNTIME_DRIVER modules with runtime memory protection enabled. (Sync patch r19235 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Eugene Cohen <eugene@hp.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19382 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-18BaseTools GCC: avoid the use of COMMON symbolsArd Biesheuvel
The default behavior of the GCC compiler is to emit uninitialized globals with external linkage into a COMMON section, where duplicate definitions are merged. This may result in unexpected behavior, since global variables defined under the same name in different C files may not refer to the same logical data item. For instance, the definitions of EFI_EVENT mVirtualAddressChangeEvent that [used to] appear in the following files: CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c will be folded into a single instance of the variable when the latter module includes the former library, which can lead to unexpected results. Even if some may argue that there are legal uses for COMMON allocation, the high modularity of EDK2 combined with the low level of awareness of the intracicies surrounding common allocation and the generally poor EDK2 developer discipline regarding the use of the STATIC keyword* make a strong case for disabling it by default, and re-enabling it explicitly for packages that depend on it. So prevent GCC from emitting variables into the COMMON section, by passing -fno-common to the compiler, and discarding the section in the GNU ld linker script. * Any function or variable that is only referenced from the translation unit that defines it could be made STATIC. This does not only prevent issues like the above, it also allows the compiler to generate better code, e.g., drop out of line function definitions after inlining all invocations or perform constant propagation on variables. (Sync patch r19164 from main trunk.) 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> Tested-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19381 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-18BaseTools RVCT: add preprocessor preinclude for AutoGen.hEugene Cohen
Ensure that AutoGen.h is force-included when the RVCT preprocessor is invoked. (Sync patch r19097 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eugene Cohen <eugene@hp.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19370 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-04BaseTools: Add VS2015 tool chain in tools_def.templateWang Yu
(Sync patch r19101 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Yu <yu.wang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19117 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-16Update BaseTools from main trunk r18767.Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18784 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-20BaseTools AARCH64: use tiny code model by defaultArd Biesheuvel
The AARCH64 tiny code model produces more efficient code, since it uses relative symbol references rather than absolute references, i.e., an emitted relative reference refers to the symbol directly rather than a literal containing its 64-bit absolute address. This saves space in the binary, and reduces the number of relocation fixups that need to be applied by the PE/COFF loader. So now that we support relative relocations in GenFw, move to the tiny code model by default. Note that the large model can still be selected by individual modules by adding -mcmodel=large to the appropriate CC_FLAGS. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18242 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-18BaseTools: Add /arch:IA32 option in VS2012 and VS2013Liming Gao
VS2012 and VS2013 turn on optimizations by default that generate the use of CMOV instruction. This is a change from previous version VS2008. This means when you build with VS2012 or VS2013, it will generate UD exceptions on Quark. To resolve it, add /arch:IA32 options to not use enhanced instructions. https://msdn.microsoft.com/en-us/library/7t5yh4fd(v=vs.140).aspx Update the default options of VS2012 & VS2013 tool chain IA32 arch in BaseTools\Conf\tools_def.template to make sure the generated Quark compatibility driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18230 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-17BaseTools GCC: prevent unaligned memory accesses on ARM GCC 4.6Ard Biesheuvel
In GCC 4.7, a feature was added to the ARM backend that allows unaligned loads and stores to be emitted. Since it is enabled by default on ARMv6 and later CPUs, and since such code is not suitable in our case (i.e., bare metal code), we must disable it by passing the -mno-unaligned-access option if we are using GCC 4.7 or later. However, this particular feature and its enabling by default have been backported to version 4.6 by Linaro. Since the Linaro toolchains are widely used for ARM development, and also shipped by distros such as Ubuntu, we should disable the feature on version 4.6 as well. Unfortunately, since the upstream version does not support the feature, it also does not understand the -mno-unaligned-access option. Since GCC sets the builtin #define __ARM_FEATURE_UNALIGNED to 1 when -munaligned-access is in effect, we can force the build to fail in this case by passing -D__ARM_FEATURE_UNALIGNED=0 on the GCC command line. This will produce the following error message: <command-line>:0:0: error: "__ARM_FEATURE_UNALIGNED" redefined [-Werror] <built-in>:0:0: note: this is the location of the previous definition and terminate the build. This patch may cause some existing builds to fail, but they will be builds that were previously at risk of unexpected runtime exceptions. Those builds can also easily be switched to the GCC47 profile instead, generating safe binaries. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18228 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-13BaseTools IA32/X64: prevent .eh_frame sections from being generatedArd Biesheuvel
After the recent GNU linker script changes, the following warning is emitted many times during the OVMF build: BFD: <...>: warning: Empty loadable segment detected, is this intentional ? This is caused by the fact that, now that the section layout has changed somewhat, the .eh_frame section is assigned an ELF segment of its own, which ends up with no contents at all after we strip the .eh_frame section from the output. (Note that the program headers that contain the segment information are completely irrelevant to us since the PE/COFF conversion does not rely on them.) Since we only retain the .eh_frame data for external debugging, and not for things like stack unwinding or generating backtraces at runtime, we can remedy the situation by passing -fno-asynchronous-unwind-tables on the GCC command line. This option instructs the compiler to emit the unwind data into a debug section called .debug_frame instead of into .eh_frame. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Build-tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18217 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-12BaseTools: remove ARMGCC and ARMLINUXGCC toolchainsArd Biesheuvel
The ARMGCC and ARMLINUXGCC toolchains are specific to the ARM and AARCH64 architectures, and overlap with the toolchain configuration that is provided by the GCC44 - GCC49 toolchains, which are defined for all architectures. To reduce the maintenance burden, and make it easier to keep these different architectures aligned, remove the ARMGCC and ARMLINUXGCC toolchains entirely. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18212 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-10BaseTools: add CLANG35 toolchain with AARCH64 supportArd Biesheuvel
This adds support for building the AARCH64 platforms using the Clang compiler and assembler combined with the GNU (cross-)linker. The chosen name CLANG35 is based on version 3.5 being the oldest supported version, but no issues are known that should prevent its use with any later version. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18198 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-06BaseTools/Trim: Fixed a bug that cannot trim long valuesYingke Liu
The long value substitution must move to the front of HEX substitution, and updated build_rule to add --trim-long Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18170 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-03BaseTools IA32/X64: Use GccBase.lds instead of gcc*-ld-scriptArd Biesheuvel
These scripts all now have the same contents, so we only need to use GccBase.lds. Therefore we can delete gcc-4K-align-ld-script, gcc4.4-ld-script and gcc4.9-ld-script. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18142 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-03BaseTools AARCH64: move to unified GCC linker scriptArd Biesheuvel
Drop the GCC AARCH64 specific linker script and use the new unified one instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18138 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-03BaseTools IA32/X64: get header size and alignment from ld commandlineArd Biesheuvel
Instead of hardcoding the values for the PE/COFF header size and the section alignment, set them on the linker command line. This factors out these values from the various linker scripts, which will allow us to unify them in a subsequent patch. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18134 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-09BaseTools: aarch64: add -fno-asynchronous-unwind-tables to gcc cflagsLeif Lindholm
Some toolchains, at least Fedora GCC, generate inline unwind tables in object files. These confuses GenFw to no end, leading to build failures: GenFw: ERROR 3000: Invalid WriteSections64(): ... unsupported ELF EM_AARCH64 relocation 0x105. GenFw: ERROR 3000: Invalid WriteSections64(): ... unsupported ELF EM_AARCH64 relocation 0x0. I am aware of no current use of these tables, so explicitly disable their generation for aarch64. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Tested-by: Wei Huang <wei@redhat.com> Reviewed-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17905 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-06BaseTools: AArch64: use explicit linker scriptsArd Biesheuvel
Instead of relying on the builtin linker script of GNU ld, which may vary based on binutils version (which is not tightly coupled to the GCC version) and linker command line options, introduce a linker script for AArch64 to be used by all GCC/binutils versions. The script is laid out such that two ELF sections .text and .data are created that map onto the PE/COFF with the same names. By aligning .data to the minimum alignment of .text, and by not adding any additional padding -which is what LD's builtin linker script does- the relative offset between .text and .data is retained after the PE/COFF conversion. This should prevent problems with debuggers and other tooling that are ELF based. Also provided is an overlay linker script that increases the alignment of .text and .data to 64 KB. This is intended for DXE_RUNTIME_DRIVER modules, to make them compatible with the newly introduced Properties Table feature. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Olivier Martin <Olivier.Martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17824 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-02Revert tree to r17801Jordan Justen
Revert r17802 "BaseTools: AArch64: use explicit linker scripts" Revert r17803 "ArmVirtPkg: build runtime drivers with 64 KB section alignment" Revert r17804 "IntelFrameworkModulePkg: AcpiS3SaveDxe: prepare for End-of-Dxe callback" Revert r17805 "IntelFrameworkModulePkg: AcpiS3SaveDxe: call S3Ready() at End-of-Dxe" Revert r17806 "OvmfPkg: AcpiS3SaveDxe: prepare for End-of-Dxe callback" Requested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17807 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-02BaseTools: AArch64: use explicit linker scriptsArd Biesheuvel
Instead of relying on the builtin linker script of GNU ld, which may vary based on binutils version (which is not tightly coupled to the GCC version) and linker command line options, introduce a linker script for AArch64 to be used by all GCC/binutils versions. The script is laid out such that two ELF sections .text and .data are created that map onto the PE/COFF with the same names. By aligning .data to the minimum alignment of .text, and by not adding any additional padding -which is what LD's builtin linker script does- the relative offset between .text and .data is retained after the PE/COFF conversion. This should prevent problems with debuggers and other tooling that are ELF based. Also provided is an overlay linker script that increases the alignment of .text and .data to 64 KB. This is intended for DXE_RUNTIME_DRIVER modules, to make them compatible with the newly introduced Properties Table feature. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17802 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-29BaseTools: Updated tool_def to support 4K alignment.Yingke Liu
Replace '/MERGE:.data=.text /MERGE:.rdata=.text' with /MERGE:.rdata=.data Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17726 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-29BaseTools: Update IASL download link and remove specific version info.Yingke Liu
The version of IASL compiler in the tools_def.template file no longer exists on the acpica.org site. Update download link and remove the specific version info from the tools_def.template file. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17725 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-10BaseTools: Append FILE_GUID to BaseName.Yingke Liu
This patch makes sure the EFI file in $(BIN_DIR) is unique. If there are modules with same BaseName, the FILE_GUID is appended. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17608 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-08BaseTools: Update BuildRule for *.nasmbLiming Gao
*.nasmb is place of *.asm16. To keep the same output file, copy the output file with .com postfix. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17580 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-01BaseTools/Conf: Don't support upper case nasm extensionsJordan Justen
For *.asm and *.s, there have been cases of *.Asm and *.S files, but since the nasm extensions are new, we don't need to support the upper case extensions. In other words, remove .Nasm and .NASM. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17544 6f19259b-4bc3-4df7-8a09-765794883524
2015-05-26BaseTools: Add default BuildRuleOrder in tools_def.templateYingke Liu
*_*_*_*_BUILDRULEORDER = nasm Nasm NASM asm Asm ASM S s *_XCODE32_*_*_BUILDRULEORDER = S s nasm Nasm NASM *_XCLANG_*_*_BUILDRULEORDER = S s nasm Nasm NASM *_XCODE5_*_*_BUILDRULEORDER = S s nasm Nasm NASM Tool Chain in Mac Os will use S as the first priority. Other tool chains use nasm as the first priority. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17510 6f19259b-4bc3-4df7-8a09-765794883524
2015-03-23NT32Pkg: Fix build errors from building secure boot with NT32 X64Cinnamon Shia
Root cause: The CryptoPkg\Library\IntrinsicLib needs override MSFT build option to remove /Oi and /GL, but it doesn’t work because of the build option override in Nt32Pkg.dsc. Solution: Remove /X in BaseTools/Conf/tools_def.template Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hp.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17069 6f19259b-4bc3-4df7-8a09-765794883524
2015-01-09BaseTools Fix NASM tool version in comments of tools_def.templateLiming Gao
NASM tool version should be 2.07 instead of 2.0.7. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16596 6f19259b-4bc3-4df7-8a09-765794883524
2014-12-02Fix ARM build failure with gcc 4.6.Scott Duplichan
Gcc option -mno-unaligned-access is supported by gcc 4.7 and newer, so it shouldn't be used with gcc 4.6. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Scott Duplichan <scott@notabs.org> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Olivier Martin <Olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16464 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-24BaseTools: Extend support for Windows hosted gcc to versions 4.4-4.7.Scott Duplichan
Revision 16400 adds support for Windows hosted gcc versions 4.8 and 4.9. With this change, all of the GCCXX tool chains can be used from Windows. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Scott Duplichan <scott@notabs.org> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16418 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-18BaseTools: Modify gcc 4.8 and 4.9 tool chain definition to support building ↵Scott Duplichan
from Windows. Here is a new patch that adds Windows support for both gcc 4.8.x and gcc 4.9.x. This time testing is more thorough: boot testing using Duet for all 4 combinations of IA32/X64 and gcc 4.8.2 and gcc 4.9.1 passes. A Windows hosted gcc 4.8.2 has been added here: http://sourceforge.net/projects/edk2developertoolsforwindows/ The environment variable settings for Windows look like: set UEFI_BUILD_TOOLS=%cd%\tools set NASM_PREFIX=%UEFI_BUILD_TOOLS%\nasm211\ set GCC48_BIN=%UEFI_BUILD_TOOLS%\gcc482-x86\bin\ set GCC48_DLL=%UEFI_BUILD_TOOLS%\gcc482-x86\dll\;%GCC48_BIN% set GCC48_ARM_PREFIX=%UEFI_BUILD_TOOLS%\gcc482-arm\bin\ set GCC48_AARCH64_PREFIX=%UEFI_BUILD_TOOLS%\gcc482-aarch64\bin\ set GCC49_BIN=%UEFI_BUILD_TOOLS%\gcc491-x86\bin\ set GCC49_DLL=%UEFI_BUILD_TOOLS%\gcc491-x86\dll\;%GCC49_BIN% set GCC49_ARM_PREFIX=%UEFI_BUILD_TOOLS%\gcc491-arm\bin\ set GCC49_AARCH64_PREFIX=%UEFI_BUILD_TOOLS%\gcc491-aarch64\bin\ No change is needed for building from Linux. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Scott Duplichan <scott@notabs.org> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16400 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-18BaseTools: Correct NASM output file type for UNIXGCC and CYGGCC. Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16399 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-25BaseTools: Use '/' as path separator for objcopy --add-gnu-debuglinkNikolai Saoukh
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Nikolai Saoukh <nms@otdel-1.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16172 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-10BaseTools: Fix XCODE5 to work properly with NASMAndrew Fish
The default object type for NASM is raw binary, and this will not link. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Andrew Fish <afish@apple.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16085 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-01BaseTools tools_def: Indicate that NASM 2.07 or later is requiredJordan Justen
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16018 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-01BaseTools build_rule: Add .nasm => .obj build ruleJordan Justen
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16017 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-01BaseTools tools_def: Add NASM_FLAGSJordan Justen
Note: Only tested with the GCC49 toolchain so far. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16016 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-29BaseTools: Cleanup XCODE build rulesAnderw Fish
Update C-Code-File rule since XCODE never needs the SYMRENAME step. Add *.S16 to Mash16-Code-File rule to supoprt 16-bit assmebly with XCODE Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anderw Fish <afish@apple.com> Reviewed-by: Gao, Liming <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15980 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-29BaseTools: Add the XCODE5 tools target to supoprt Xcode 5Anderw Fish
Xcode 5 changed the arguments required to supoprt X64 EFIAPI so it is a new target. XCODE5 supports Xcode 5.* and Xcode 6.*, and will probably support future versions of Xcode as well. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anderw Fish <afish@apple.com> Reviewed-by: Gao, Liming <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15979 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-28License header updated to match correct format.Yingke Liu
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15971 6f19259b-4bc3-4df7-8a09-765794883524