From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 675471A1DED for ; Thu, 11 Aug 2016 05:18:22 -0700 (PDT) Received: by mail-wm0-x22b.google.com with SMTP id i5so12230804wmg.0 for ; Thu, 11 Aug 2016 05:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kkmnR2LKa2wEUn1tCRJggkQG/R7K5VmswNToP7K6dwI=; b=C62QsMIEKOPY0u7F3URku/fr47Ax47BeQaisdkUCcW0UU51bv/1Jn22XbZuNco56Q5 3lCWihQYGww7f1TMTq09IdkAF0imoSvieaoL2szImN7lkp66HI92BbvWCd/1Z6Jf5RVm KvggjBVkY7aO1XfcmHuBwe7HE2nQ2CpOxAq+c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kkmnR2LKa2wEUn1tCRJggkQG/R7K5VmswNToP7K6dwI=; b=Kg3IDKGMrjf0NNcQAWJuu3lTk0cX3rIybl7YllsmmiCP8qo7mey+mZ2Q+HMWauveV9 1ERosgARMr+Fdw4kaNWa3/ZBx8MT5AoyL5VVTsZDUIsKrqmmRYIgCc1LLKLD9R9fIdAP dMDiuFoj4c4meTuF1PTwiMdfb8Hg3bmcwoAi9glnew6LdOgmuWoAvmLS8QaX8d/P78KS 2JJMCj3CMySHjM3pHDpROU8veq/tSD9vjaeaW+WteCsZfoKaz6ScalHBL+JAYg0zkSyN ZlEPLTB8jZQNYLywwBaocBDVI39mvlgSo7084O/ebFCILIX6IiwbR3ItVnOCBZRELpll w/nw== X-Gm-Message-State: AEkoousz33wzYcvlWNLPQrGfFD2Bd5PXb1oRUlFg1IiDhX9Ia5Pi6hwDSY8xlfZ4VvuSvOtY X-Received: by 10.28.57.131 with SMTP id g125mr8277305wma.31.1470917900924; Thu, 11 Aug 2016 05:18:20 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id i3sm2455995wjd.31.2016.08.11.05.18.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Aug 2016 05:18:20 -0700 (PDT) Date: Thu, 11 Aug 2016 13:18:18 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, liming.gao@intel.com, yonghong.zhu@intel.com Message-ID: <20160811121818.GA31760@bivouac.eciton.net> References: <1470914055-28034-1-git-send-email-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <1470914055-28034-1-git-send-email-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH 1/2] BaseTools ARM AARCH64: pass CC flags to linker for XIP modules as well 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: Thu, 11 Aug 2016 12:18:22 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 11, 2016 at 01:14:14PM +0200, Ard Biesheuvel wrote: > Commit 478f50990a ("BaseTools GCC: add the compiler flags to the linker > command line") added the compiler flags to the linker command line, > which is required for LTO to function correctly, since it involves code > generation at link time. > > This patch failed to update the build rules for XIP modules on AARCH64, > which not only requires the ordinary CC flags but also the XIP CC flags > to prevent the LTO backend to, e.g., emit code that does not adhere to > the strict alignment rules we impose for code that may execute with the > MMU off. > > So update the XIP link rules as well. Since AARCH64 and ARM are not > supported by any toolchains in the GCCLD build rule family, drop the > reference to GCCLD while we're at it. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm > --- > BaseTools/Conf/build_rule.template | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule.template > index 6191957e0e70..7e2c6a96583d 100755 > --- a/BaseTools/Conf/build_rule.template > +++ b/BaseTools/Conf/build_rule.template > @@ -310,7 +310,7 @@ > "$(DLINK)" $(DLINK_FLAGS) -o ${dst} $(DLINK_SPATH) -filelist $(STATIC_LIBRARY_FILES_LIST) $(DLINK2_FLAGS) > > > -[Static-Library-File.SEC.AARCH64, Static-Library-File.PEI_CORE.AARCH64, Static-Library-File.PEIM.AARCH64] > +[Static-Library-File.SEC.AARCH64, Static-Library-File.PEI_CORE.AARCH64, Static-Library-File.PEIM.AARCH64,Static-Library-File.SEC.ARM, Static-Library-File.PEI_CORE.ARM, Static-Library-File.PEIM.ARM] > > *.lib > > @@ -320,8 +320,8 @@ > > $(DEBUG_DIR)(+)$(MODULE_NAME).dll > > - > - "$(DLINK)" -o ${dst} $(DLINK_FLAGS) $(DLINK_XIPFLAGS) -Wl,--start-group,@$(STATIC_LIBRARY_FILES_LIST),--end-group $(DLINK2_FLAGS) > + > + "$(DLINK)" -o ${dst} $(DLINK_FLAGS) $(DLINK_XIPFLAGS) -Wl,--start-group,@$(STATIC_LIBRARY_FILES_LIST),--end-group $(CC_FLAGS) $(CC_XIPFLAGS) $(DLINK2_FLAGS) > "$(OBJCOPY)" $(OBJCOPY_FLAGS) ${dst} > > > -- > 2.7.4 >