diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-08-03 10:11:29 +0200 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-08-03 15:45:23 +0200 |
commit | 87ee6390cbeb2d15490943bca2978f166f213c13 (patch) | |
tree | 7312e605968ff3b6c8a2b729e410c82f925a574f /ArmVirtPkg/ArmVirtQemuKernel.dsc | |
parent | f846969796d311d01e8ba7527a6f50b5a246a9e8 (diff) | |
download | edk2-87ee6390cbeb2d15490943bca2978f166f213c13.tar.gz edk2-87ee6390cbeb2d15490943bca2978f166f213c13.tar.bz2 edk2-87ee6390cbeb2d15490943bca2978f166f213c13.zip |
ArmVirtPkg ARM: make relocatable PrePi users build with CLANG35
The clang developers have made a backward incompatible change to the
command line arguments, and have replaced '-mllvm -arm-use-movt=0'
with '-mno-movt'. This does not matter for most ARM platforms, and
therefore it has been removed from the default CLANG35/ARM CC flags
in patch 1c63516075b3 ("BaseTools CLANG35: drop problematic use-movt
and save-temps options"), but as it turns out, the relocatable PrePi
implementation used by ArmVirtQemuKernel and ArmVirtXen will fail to
build if it contains MOVT/MOVW pairs, due to the fact that these are
not runtime relocatable under ELF.
Since they are runtime relocatable under PE/COFF, and GenFw does the
right thing when encountering them, selectively controlling their
use is more appropriate than disabling them altogether. Therefore,
this patch adds the -mno-movt argument only for the platforms that
use the relocatable PrePi, and only for the module types that may
be pulled into its build.
In addition, switch to the SEC type version of ArmLib, so that
the relocatable PrePi only depends on BASE and SEC type libraries.
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>
Diffstat (limited to 'ArmVirtPkg/ArmVirtQemuKernel.dsc')
-rw-r--r-- | ArmVirtPkg/ArmVirtQemuKernel.dsc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc index 01a1d9b461..6c536d9bbd 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -45,6 +45,9 @@ ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf
ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.inf
+[LibraryClasses.ARM.SEC]
+ ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf
+
[LibraryClasses.common]
ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
@@ -77,6 +80,11 @@ GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -I$(WORKSPACE)/ArmVirtPkg/Include
*_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmVirtPkg/Include
+[BuildOptions.ARM.EDKII.SEC, BuildOptions.ARM.EDKII.BASE]
+ # Avoid MOVT/MOVW instruction pairs in code that may end up in the PIE
+ # executable we build for the relocatable PrePi. They are not runtime
+ # relocatable in ELF.
+ *_CLANG35_*_CC_FLAGS = -mno-movt
################################################################################
#
|