From: Laszlo Ersek <lersek@redhat.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
edk2-devel@ml01.01.org, leif.lindholm@linaro.org
Subject: Re: [PATCH 2/2] ArmVirtPkg ARM: make relocatable PrePi users build with CLANG35
Date: Wed, 3 Aug 2016 12:00:43 +0200 [thread overview]
Message-ID: <dc607ca6-5030-7862-a581-d024d3b10b43@redhat.com> (raw)
In-Reply-To: <1470212464-28071-3-git-send-email-ard.biesheuvel@linaro.org>
On 08/03/16 10:21, Ard Biesheuvel wrote:
> 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.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> ArmVirtPkg/ArmVirtQemuKernel.dsc | 8 ++++++++
> ArmVirtPkg/ArmVirtXen.dsc | 9 +++++++++
> 2 files changed, 17 insertions(+)
>
> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> index 01a1d9b4613b..6c536d9bbd2d 100644
> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> @@ -45,6 +45,9 @@ [LibraryClasses.ARM]
> ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf
> ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.inf
>
> +[LibraryClasses.ARM.SEC]
> + ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf
> +
How does this library resolution change relate to the stated purpose of
the patch?
Thanks
Laszlo
> [LibraryClasses.common]
> ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
>
> @@ -77,6 +80,11 @@ [BuildOptions]
> 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
>
> ################################################################################
> #
> diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc
> index 5ad1bf630bda..4ebead5ba6e6 100644
> --- a/ArmVirtPkg/ArmVirtXen.dsc
> +++ b/ArmVirtPkg/ArmVirtXen.dsc
> @@ -44,6 +44,9 @@ [LibraryClasses.ARM]
> 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,12 @@ [BuildOptions]
> GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -I$(WORKSPACE)/ArmVirtPkg/Include
> GCC:*_*_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
> +
> ################################################################################
> #
> # Pcd Section - list of all EDK II PCD Entries defined by this Platform
>
next prev parent reply other threads:[~2016-08-03 10:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-03 8:21 [PATCH 0/2] ArmVirtPkg EmbeddedPkg: fix build for CLANG35/ARM Ard Biesheuvel
2016-08-03 8:21 ` [PATCH 1/2] EmbeddedPkg: make PrePiMemoryAllocationLib a SEC type library Ard Biesheuvel
2016-08-03 9:56 ` Laszlo Ersek
2016-08-03 10:00 ` Ard Biesheuvel
2016-08-03 11:21 ` Laszlo Ersek
2016-08-03 12:50 ` Ard Biesheuvel
2016-08-03 13:07 ` Leif Lindholm
2016-08-03 8:21 ` [PATCH 2/2] ArmVirtPkg ARM: make relocatable PrePi users build with CLANG35 Ard Biesheuvel
2016-08-03 10:00 ` Laszlo Ersek [this message]
2016-08-03 10:02 ` Ard Biesheuvel
2016-08-03 11:19 ` Laszlo Ersek
2016-08-03 12:51 ` Ard Biesheuvel
2016-08-03 13:46 ` [PATCH 0/2] ArmVirtPkg EmbeddedPkg: fix build for CLANG35/ARM Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dc607ca6-5030-7862-a581-d024d3b10b43@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox