Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3387804ybp; Sun, 6 Oct 2019 10:49:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyWYwCXQOQBdQy4dphSvjXeSQ3Jc8M2JWN/4sGcwWyFOaZUi3IghnMe8d6j1Y0ky/qrMGbM X-Received: by 2002:a50:b6aa:: with SMTP id d39mr24934317ede.16.1570384178805; Sun, 06 Oct 2019 10:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384178; cv=none; d=google.com; s=arc-20160816; b=OmwAbASATeMlN+Fmb7yIST8/k7Djk6GQH5Kg0+XPVs2UjCzRwx3tNEWV2PGE4B7m8w VRi1hwERMqs+LnqDLJwxRcsx2WictVdPnS8PpO05SeUa3dl2reyuGF2/weakqQVYBNNA dyBOohjDZGY2+vdzdz/nzmyVcA9U9Z5VAq2E5A8Dqwzat3DeXCoZmw3Q6DzVbKX4izCD hxTBcjZPOHFSIlNpPogw/QsdICpt7QdlT5RU5YWnwQqu4s530KXl7WQRfKu+/XZVz1B8 63abOQwwmBD7bJudgq6vyrrQAJ6p8FyZ5nSo/gA/HS5DwkyNom0dHf8H4t02H28E76mS iI+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=b6keAd/dPWFsD2wDtQ/Z6UKTZDR0XMmaLGsJoxUSniM=; b=nW4Qj3BKLjKZAHmh+cYoabsb+7xiohmLBiBeNSaloVcuRNKIVsVexPrBAHPZhX4q44 scTvGc2BVI50BN4m5S0Xs1Qgg2uJjJOGs0sNATQXbDABBVMiqHBarDQBog30ho//hN1/ P+9he6ZeWjLXZ7CULQeJJzTf4nssXlbvFoTOGRGMMyHzBxOrN45JeoiFlt9uueEpfKgh R7JAp639i8YAZnL6uIlof7U/K4ucvQ+ZItsR6TLmBPa8d1LG6Ot7rTrlUX/WALvhQZmY h5Uoort4/CtnPMWuq8/KwOz759cDMX6bZbl9l3HirzF8vdLWgbp97lINDO/hEfy4El6c DX0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mBWR5aPu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v19si5864050eja.352.2019.10.06.10.49.15; Sun, 06 Oct 2019 10:49:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mBWR5aPu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731591AbfJFRny (ORCPT + 99 others); Sun, 6 Oct 2019 13:43:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:43914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731584AbfJFRnw (ORCPT ); Sun, 6 Oct 2019 13:43:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CDC0020700; Sun, 6 Oct 2019 17:43:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383830; bh=jgjxV17hWXr5NUkzNmqQV2rMGWVCCgrhAuf9KnqIIKA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mBWR5aPu8hrFou6Yt+/vGP9AAimO1xOcIrXlgKZzfcsFv0AjqvdW99SQNTystRKRm J3WF5oN2HlW2kAkCRrCFhiC9/yOywhXM/B5c9TLVpVACrdsj8EL/RdEy3gK8+Ua6AY /bvq6EGrc763mBLUARaFh+TwWbmKL+MaNRilBsdo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Kaehlcke , Nick Desaulniers , Stefan Agner , Nathan Chancellor , Russell King , Sasha Levin Subject: [PATCH 5.3 111/166] ARM: 8905/1: Emit __gnu_mcount_nc when using Clang 10.0.0 or newer Date: Sun, 6 Oct 2019 19:21:17 +0200 Message-Id: <20191006171222.748731912@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171212.850660298@linuxfoundation.org> References: <20191006171212.850660298@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit b0fe66cf095016e0b238374c10ae366e1f087d11 ] Currently, multi_v7_defconfig + CONFIG_FUNCTION_TRACER fails to build with clang: arm-linux-gnueabi-ld: kernel/softirq.o: in function `_local_bh_enable': softirq.c:(.text+0x504): undefined reference to `mcount' arm-linux-gnueabi-ld: kernel/softirq.o: in function `__local_bh_enable_ip': softirq.c:(.text+0x58c): undefined reference to `mcount' arm-linux-gnueabi-ld: kernel/softirq.o: in function `do_softirq': softirq.c:(.text+0x6c8): undefined reference to `mcount' arm-linux-gnueabi-ld: kernel/softirq.o: in function `irq_enter': softirq.c:(.text+0x75c): undefined reference to `mcount' arm-linux-gnueabi-ld: kernel/softirq.o: in function `irq_exit': softirq.c:(.text+0x840): undefined reference to `mcount' arm-linux-gnueabi-ld: kernel/softirq.o:softirq.c:(.text+0xa50): more undefined references to `mcount' follow clang can emit a working mcount symbol, __gnu_mcount_nc, when '-meabi gnu' is passed to it. Until r369147 in LLVM, this was broken and caused the kernel not to boot with '-pg' because the calling convention was not correct. Always build with '-meabi gnu' when using clang but ensure that '-pg' (which is added with CONFIG_FUNCTION_TRACER and its prereq CONFIG_HAVE_FUNCTION_TRACER) cannot be added with it unless this is fixed (which means using clang 10.0.0 and newer). Link: https://github.com/ClangBuiltLinux/linux/issues/35 Link: https://bugs.llvm.org/show_bug.cgi?id=33845 Link: https://github.com/llvm/llvm-project/commit/16fa8b09702378bacfa3d07081afe6b353b99e60 Reviewed-by: Matthias Kaehlcke Reviewed-by: Nick Desaulniers Reviewed-by: Stefan Agner Signed-off-by: Nathan Chancellor Signed-off-by: Russell King Signed-off-by: Sasha Levin --- arch/arm/Kconfig | 2 +- arch/arm/Makefile | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 5e2c68e9dd6e2..b587a3b3939ab 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -82,7 +82,7 @@ config ARM select HAVE_FAST_GUP if ARM_LPAE select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL && !CC_IS_CLANG - select HAVE_FUNCTION_TRACER if !XIP_KERNEL + select HAVE_FUNCTION_TRACER if !XIP_KERNEL && (CC_IS_GCC || CLANG_VERSION >= 100000) select HAVE_GCC_PLUGINS select HAVE_HW_BREAKPOINT if PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7) select HAVE_IDE if PCI || ISA || PCMCIA diff --git a/arch/arm/Makefile b/arch/arm/Makefile index c3624ca6c0bca..9b3d4deca9e4e 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -112,6 +112,10 @@ ifeq ($(CONFIG_ARM_UNWIND),y) CFLAGS_ABI +=-funwind-tables endif +ifeq ($(CONFIG_CC_IS_CLANG),y) +CFLAGS_ABI += -meabi gnu +endif + # Accept old syntax despite ".syntax unified" AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W) -- 2.20.1