Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1235174ybl; Fri, 30 Aug 2019 14:16:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqIa3n3VinhQ2r3qdvC30RUp+nOlAlBLhh3jAgEj66MlLJMPA7T5xFEKl1tbdKnhNI4pms X-Received: by 2002:aa7:96ee:: with SMTP id i14mr20542096pfq.217.1567199779144; Fri, 30 Aug 2019 14:16:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567199779; cv=none; d=google.com; s=arc-20160816; b=o4B1C/TRTQwFh+h3LxupRPRNxeSljU7h8LL8ysAYmrOxleB/RMDsCMeC0cCwcnd1tV ndNartodz9Su54ozc58mG3KGVBUxLA54OI14gpFHr7CRkgGd8DcEj+XSMZI/e7ruuWV3 eXRjlhYJlGmxCGV1zlV1e6IF2a1FkqZYryZRO/KUtNMz977BHLuyrMubu/5AcKRgZCaq sPf2E6wRbnvzBUtXDsai+VQN2nx+0/dJws+8vVIw49VMmKKHc20CVYqBnY6P7PEnOVB/ e9jaBXPb2HOooXu9nyOJf9qwKaX0OUt5zKwazFpmP9PBj6eN6pR1JRCnXA2wxzzPyQa+ twew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=1J0sxNta1Y7TX28deVqyjMgnkCtYfR2j9BgKqBFiKOI=; b=RHnq9Nq53lmWeDPKgK9ofdSb8mVBxvDhhaWd5hiMkg2Pqgv34mU2MTOWikwB27+wVs QYegaWHgzTImA298gkqAQK8GOGUS/4JZMIS3V9jeecS1PgAH/qS5wA4B1+Ln22dD2dp2 oBya1ZAvc0TrGv4yh3ezSfcskMj00J9Fpf96yiqGV7Wf9NL0Xy/943mXcUnFizqtctvZ aEYuRNyCc7j4U9SIcZ8AR40cz1+iRwlBQ3TDSrhwt7e4VTPGQsTjGCH6snYoLSHNpJhL e3AwhF9IJXF0vdBJr94Q/hFLChoZGUCQh0NV1unVSdoaDvzmaUrQFghCexPiKq+ItuwI Euew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=EW99Eqkb; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9si5161419pgm.59.2019.08.30.14.16.03; Fri, 30 Aug 2019 14:16:19 -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=@google.com header.s=20161025 header.b=EW99Eqkb; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728182AbfH3VN6 (ORCPT + 99 others); Fri, 30 Aug 2019 17:13:58 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:39312 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727991AbfH3VN4 (ORCPT ); Fri, 30 Aug 2019 17:13:56 -0400 Received: by mail-pf1-f193.google.com with SMTP id a67so2129379pfa.6 for ; Fri, 30 Aug 2019 14:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1J0sxNta1Y7TX28deVqyjMgnkCtYfR2j9BgKqBFiKOI=; b=EW99Eqkb2zHXK7i7yXBZZtK9zRekFpro7wkDVkT8jfrTEuhsHNSMSJTm1WE0sl8IP1 O9547obfMg3vuk02KqBj7Td0E5/UZH8fqLopjyWlA5RZyTTGD0MfnMYYWEDioGWlGJPy pUJCmlQq4PbW3OK/H46tZgJ2xYaTxHRf/pgWiv+/v+Pw3RRUd1sAr8M5QIuqAutHCSJt 88UzyhvcAfiu0c0rbJhcawlbu/D3eYbdVfLkmHBplnTh54UCPFZrSRsFb4iaN6yGWAd1 z2t31TgBWtbuekEgty9l+b+5d3OraQCLjjdNZKx71u8nrvagywgYhV/cpu0TylmduSgq 3fMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1J0sxNta1Y7TX28deVqyjMgnkCtYfR2j9BgKqBFiKOI=; b=XgPiz5m9ywd21sZRPLu1imwDsavFrVNkXBNVH5IdVkuqAO5rD6CJ7DPpPtdcrmnIOp bI89gk1wFhZKooN0os80Oei//3IvC+4ygXDSacNcXMC4UrJhnJdAcGvRD7R9BMtUbnOq ZgjX+JIglXRhbuHW5ow4teahPQ+nP7I+Z164r4OW6Ea1ATbiZZ5cXU3eZ+GLS9FTs4cE /JIyOhfquMxLaQHb/3e1geTckZmaYNrfLRjM2oxhNl8fayevd5neFnGDX0YtKNcnuimc +Jebf81WirLrhC4wj0Mo/diUMsEkxX0/tbWAAMLXK5T+pXJ0gqSxIl0rhstYasBC6/kz +plA== X-Gm-Message-State: APjAAAV1sp7WCps54BZuY70RbQYofg8qiSyfushZEGWKTq1KdqAlK6EU XhtNjZL2UezZ0QQY6o5lkgPtZ4mZbLF4n68OO9JFcg== X-Received: by 2002:a63:6193:: with SMTP id v141mr3690361pgb.263.1567199635468; Fri, 30 Aug 2019 14:13:55 -0700 (PDT) MIME-Version: 1.0 References: <20190829062635.45609-1-natechancellor@gmail.com> <20190829193432.GA10138@archlinux-threadripper> <885bb20c11f0cb004e5eeda7b0ca6d16@agner.ch> <20190830172824.GA119107@archlinux-threadripper> In-Reply-To: <20190830172824.GA119107@archlinux-threadripper> From: Nick Desaulniers Date: Fri, 30 Aug 2019 14:13:44 -0700 Message-ID: Subject: Re: [PATCH] ARM: Emit __gnu_mcount_nc when using Clang 10.0.0 or newer To: Nathan Chancellor Cc: Stefan Agner , Russell King , Arnd Bergmann , Matthias Kaehlcke , Linux ARM , LKML , clang-built-linux Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 30, 2019 at 10:28 AM Nathan Chancellor wrote: > > On Thu, Aug 29, 2019 at 01:57:35PM -0700, Nick Desaulniers wrote: > > On Thu, Aug 29, 2019 at 1:21 PM Stefan Agner wrote: > > > > > > On 2019-08-29 21:34, Nathan Chancellor wrote: > > > > On Thu, Aug 29, 2019 at 10:55:28AM -0700, Nick Desaulniers wrote: > > > >> On Wed, Aug 28, 2019 at 11:27 PM Nathan Chancellor > > > > I will test with or without CONFIG_AEABI like Matthias asked and I will > > > > implement your Kconfig suggestion if it passes all of my tests. The > > > > reason that I did it this way is because I didn't want a user to end up > > > > with a non-booting kernel since -meabi gnu works with older versions of > > > > clang at build time, the issue happens at boot time but the Kconfig > > > > suggestion + cc-option should fix that. > Disabling CONFIG_AEABI does not work with clang, I get a ton of failures > around undefined references to __aeabi_idivmod and __aeabi_uidivmod. I > don't think this is worth looking into given that CONFIG_AEABI is not > selectable when CONFIG_CPU_V6 or CONFIG_CPU_V7 is selected, which is > what we primarily care about.. We currently build and boot > multi_v5_defconfig but it has CONFIG_AEABI set in it. As a result, I > don't think we need to care about it with this patch. The plan of record is to never support !CONFIG_AEBI (ie OABI) w/ Clang. See also my commit currently in linux-next: ARM: 8875/1: Kconfig: default to AEABI w/ Clang https://github.com/ClangBuiltLinux/linux/issues/482 so !AEABI is a moot point. If we ever changed our minds, then yes we should additionally guard on !CONFIG_AEABI, but I feel like that's a highly unlikely scenario at this point. > > This diff would also solve the issue without the need for the version > check in the Makefile, as it is the combination of -meabi gnu and -pg > that causes the boot issue and -pg gets added when > CONFIG_FUNCTION_TRACER is enabled. Would that be preferred? I do not > think adding cc-option is necessary given that we know GCC universally > does not support this flag; there is no point in adding a small penalty > with cc-option to either compiler. > > Cheers, > Nathan > > ================================================ > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index a98c7af50bf0..440ad41e77e4 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -83,7 +83,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 a43fc753aa53..23c2bf0fbd30 100644 > --- a/arch/arm/Makefile > +++ b/arch/arm/Makefile > @@ -115,6 +115,10 @@ ifeq ($(CONFIG_ARM_UNWIND),y) > CFLAGS_ABI +=-funwind-tables > endif > > +ifeq ($(CONFIG_CC_IS_CLANG),y) > +CFLAGS_ABI +=-meabi gnu > +endif Reviewed-by: Nick Desaulniers > + > # Accept old syntax despite ".syntax unified" > AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W) > -- Thanks, ~Nick Desaulniers