From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Cc: Ard Biesheuvel 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: [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 11:14:25 -0000 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(-) 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