This adds support for building for the IA32 and X64 architectures to the
CLANG35 toolchain.
NOTE: this is build tested only, using OvmfPkg/OvmfIa32.dsc and
OvmfPkg/OvmfX64.dsc. Especially X64 needs more testing, presumably, due to
the va_list and ms_abi issues that exist for GCC/X64 as well.
The first four patches fix issues in the code, some of which are only
detected by clang-3.7, but I have included them for completeness.
Patch #5 makes GenFw ignore R_X86_64_NONE relocations early, since they
will trigger the SHN_UNDEF check that follows
Patch #6 adds the -target option to all preprocessor invocations. Since clang
support all targets in a single binary, this is necessary to make sure the
builtin defines are set correctly.
Patch #7 adds the -gnu/-gnueabi suffix to the AARCH64 and ARM target triplets.
This is necessary since we are combining Clang with the GNU linker, and some
versions of clang may be configured by default for another linker (e.g., Xcode)
Patch #8 adds the toolchain definitions to tools_def.template
On a system that has multiple versions of clang installed, you can override
the version to use by setting
export CLANG35_BIN=/usr/lib/llvm-3.X/bin/
for X in { 5 .. 8 }
Ard Biesheuvel (8):
MdePkg/BaseLib: do not rely on undefined behavior in arithmetic shift
MdeModulePkg: use VA_COPY for assigning va_list types
PcAtChipsetPkg: remove unitialized variable warnings
PcAtChipsetPkg: make preprocessor constants explicitly unsigned
BaseTools/GenFw: allow SHN_UNDEF symbol references in R_X86_64_NONE
relocs
BaseTools CLANG35: use -target in PP flags as well
BaseTools CLANG35: use GNU target triplets explicitly
BaseTools CLANG35: add support for IA32 and X64
BaseTools/Conf/tools_def.template | 76 +++++++++++++++++---
BaseTools/Scripts/GccBase.lds | 3 +
BaseTools/Source/C/GenFw/Elf64Convert.c | 8 +++
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 4 +-
MdePkg/Library/BaseLib/Math64.c | 2 +-
PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c | 52 +++++++-------
6 files changed, 104 insertions(+), 41 deletions(-)
--
2.5.0
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel