From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B61CC1A1E1E for ; Wed, 3 Aug 2016 03:00:45 -0700 (PDT) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4AB36793E0; Wed, 3 Aug 2016 10:00:45 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-59.phx2.redhat.com [10.3.116.59]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u73A0hcG016052; Wed, 3 Aug 2016 06:00:44 -0400 To: Ard Biesheuvel , edk2-devel@ml01.01.org, leif.lindholm@linaro.org References: <1470212464-28071-1-git-send-email-ard.biesheuvel@linaro.org> <1470212464-28071-3-git-send-email-ard.biesheuvel@linaro.org> From: Laszlo Ersek Message-ID: Date: Wed, 3 Aug 2016 12:00:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1470212464-28071-3-git-send-email-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 03 Aug 2016 10:00:45 +0000 (UTC) Subject: Re: [PATCH 2/2] ArmVirtPkg ARM: make relocatable PrePi users build with CLANG35 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2016 10:00:45 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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 > --- > 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 >