From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753432AbdK2XpX (ORCPT ); Wed, 29 Nov 2017 18:45:23 -0500 Received: from mail-pl0-f65.google.com ([209.85.160.65]:41073 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753309AbdK2XpB (ORCPT ); Wed, 29 Nov 2017 18:45:01 -0500 X-Google-Smtp-Source: AGs4zMbLC4Po58EArBStJ6+5QKgLUGYeLOjqhQzHADxf+wDfHWAc2xMkKgTLbGjCkpOJi+hq35NAnQ== From: Sami Tolvanen To: Alex Matveev , Andi Kleen , Ard Biesheuvel , Greg Hackmann , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Rutland , Masahiro Yamada , Maxim Kuvyrkov , Michal Marek , Nick Desaulniers , Yury Norov , Matthias Kaehlcke , Nicholas Piggin Cc: Sami Tolvanen Subject: [PATCH 6/7] arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold Date: Wed, 29 Nov 2017 15:44:41 -0800 Message-Id: <20171129234442.655-7-samitolvanen@google.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171129234442.655-1-samitolvanen@google.com> References: <20171129234442.655-1-samitolvanen@google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some versions of GNU gold are known to produce broken code with --fix-cortex-a53-843419 as explained in this bug: https://sourceware.org/bugzilla/show_bug.cgi?id=21491 If ARM64_ERRATUM_843419 is disabled and we're using GNU gold, pass --no-fix-cortex-a53-843419 to the linker to ensure the erratum fix is not used even if the linker is configured to enable it by default. This change also adds a warning if the erratum fix is enabled and gold version <1.14 is used. Signed-off-by: Sami Tolvanen --- arch/arm64/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 82a0df6e865e..81a12713f7af 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -26,10 +26,19 @@ ifeq ($(CONFIG_ARM64_ERRATUM_843419),y) ifeq ($(call ld-option, --fix-cortex-a53-843419),) $(warning ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum) else + ifeq ($(call gold-ifversion, -lt, 114000000, y), y) +$(warning This version of GNU gold may generate incorrect code with --fix-cortex-a53-843419;\ + see https://sourceware.org/bugzilla/show_bug.cgi?id=21491) + endif LDFLAGS_vmlinux += --fix-cortex-a53-843419 endif endif +ifeq ($(CONFIG_ARM64_ERRATUM_843419),) +# https://sourceware.org/bugzilla/show_bug.cgi?id=21491 +LDFLAGS_GOLD += --no-fix-cortex-a53-843419 +endif + KBUILD_DEFCONFIG := defconfig # Check for binutils support for specific extensions -- 2.15.0.531.g2ccb3012c9-goog