From patchwork Thu Aug 11 11:14:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 73741 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp52009qga; Thu, 11 Aug 2016 04:14:27 -0700 (PDT) X-Received: by 10.98.60.217 with SMTP id b86mr16036851pfk.129.1470914067575; Thu, 11 Aug 2016 04:14:27 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id xl3si2808368pab.117.2016.08.11.04.14.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Aug 2016 04:14:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DE1E71A1DFC; Thu, 11 Aug 2016 04:14:26 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (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 7D8351A1DF5 for ; Thu, 11 Aug 2016 04:14:25 -0700 (PDT) Received: by mail-wm0-x235.google.com with SMTP id o80so8566444wme.1 for ; Thu, 11 Aug 2016 04:14:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=PTsNZjswMvifm1jpOaz2rHalw+yjBmSyHaX2KTvy/Sk=; b=Nl/7uswKAtlH13vpK3n493QEr+a8bLDkk2gKRZpbsvFlw6UB/bITfrcSx7R+JKespN Gl3s19r6orYoIULK6XnooA1iXOJGTA4J50vgMsMNK0HMlIGR1RgyU9KidKzAFd0nq0hS nJV6nwyLHZavJUjqjVZbr3ac1mRV9OHt2U39w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PTsNZjswMvifm1jpOaz2rHalw+yjBmSyHaX2KTvy/Sk=; b=A0QyKO2oCUYsrXfCKqDOjMOBd8sY3VGaQqYoAVFeKAWv27+G2AsowX5BNpcEoBJzYN 3buTq7l15Yuy1bGdOeLJbZ7tQlLjQNczx/WMI6ocdTgYeY40Ez0F8EpRcsMQT6Cr/tTB JJmA+HQm4EKZkAHcme/puOtUmeF1A/6yJSZoljG/Cty6WnLJ28jr+xfMGhyEZmJpXLOi WF4jJ93h0Xsaky3ZE7Kno7bSzcsfkaHwEmB8wrZ+crotIwaLhnzU4vVIrc14ATeAcGas VEhRsNebfoUexnG0mQDnlhwBezQ8OQd/kx/d0WLMiuAfq+EfrWmkXav7Nxt4QYJoPF6P RagQ== X-Gm-Message-State: AEkoouuGLmcia1s9tscSULi1rQw56/22LTtP8gIwg6O+/4XocSxqAdnX4Pr2lkaP0wK7qhOj X-Received: by 10.194.82.164 with SMTP id j4mr10900616wjy.157.1470914064020; Thu, 11 Aug 2016 04:14:24 -0700 (PDT) Received: from localhost.localdomain (46.red-81-37-107.dynamicip.rima-tde.net. [81.37.107.46]) by smtp.gmail.com with ESMTPSA id q23sm2675034wme.17.2016.08.11.04.14.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Aug 2016 04:14:23 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, liming.gao@intel.com, yonghong.zhu@intel.com Date: Thu, 11 Aug 2016 13:14:14 +0200 Message-Id: <1470914055-28034-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [edk2] [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: , Cc: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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 --- BaseTools/Conf/build_rule.template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm 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}