Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2529706ybl; Thu, 29 Aug 2019 09:21:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxasuR8SCBi1SSa6qfAvCcoX3vGgSQkTb2tjUB2kidNoAT9s+kO0Ykwqu9SRysxLAT0k1Ci X-Received: by 2002:a65:640d:: with SMTP id a13mr9002486pgv.256.1567095716956; Thu, 29 Aug 2019 09:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567095716; cv=none; d=google.com; s=arc-20160816; b=YNc55SfT8r/4y9rq7cDM4ZQxpqH3EYyoWfAkJTUz8qL4/aJQlDgQwKg3zyIZizFztb 9pj1AycYrB/E32IxIfLZuYBUkTAHMzI+JB9mxajSfAay7lNiFyjYWO1bCWgAfhdEHzE3 3JZQRNibDaUHEsxtQQO+Ao4N+eLAwZjl+QNtLIkR5TFTebCPJMmEVH+NUCIoKsojxoZL logZ2LK01J7nlNUmOKDQMVGL45iYQukc5H5QwOSrjv2VoaTUNYqC/kcB0xsS42snLv/5 TI76zesx6v0DANXHPuJmhaHk3u2k9Y1ZIIBNFRtR0FxcoF6A+PFoPPlJJZpROovwrcCz Sv2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=E3LStifNgUuLd+VD32Zb5UxmVS77q41aK/xZU55AQsc=; b=sk1KQGQRN508dVBM4aDU7GNHAKZLohAmviEDMZ7iUzXKdUWd7huQhcd+fNm1r2vs7N 7tm97i1TWm5oxykkjqtmZP3sXgFnAd1ATxH08VkzEEIa9Gd7/I4+JoMTWOlfXPW20Pol tZzYtgItkGXNiqArrExz2afqUsxDHjLhaUDTkuB9oUfB1rIzMa9/uUS91V0twgX6GEO0 xVzs8UqWXxEWBy/wl2LPmCCNUimXSwzrCkYVA8fLkmNdBHK8b6UY0hx3i0A2lDiQQjsa C+1N1W9f2tY42wKjwEYirgMG2dJa43cKdJpFT84NlREy2jI4rdWijHGEKlc/p4wRICqC P6Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SyLK87fO; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si2385256pgi.324.2019.08.29.09.21.40; Thu, 29 Aug 2019 09:21:56 -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=@chromium.org header.s=google header.b=SyLK87fO; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727421AbfH2QUm (ORCPT + 99 others); Thu, 29 Aug 2019 12:20:42 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:39538 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727161AbfH2QUm (ORCPT ); Thu, 29 Aug 2019 12:20:42 -0400 Received: by mail-pl1-f194.google.com with SMTP id az1so828325plb.6 for ; Thu, 29 Aug 2019 09:20:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=E3LStifNgUuLd+VD32Zb5UxmVS77q41aK/xZU55AQsc=; b=SyLK87fO1ebVPt2hXv3GQL+Xzd5c8H5Pg5xXjlLWi4ihwftGmSSWTVJSAkg6v4qXPo xJeHsl+/+0ZSUriKAqzMWRg1OsqL2byhA4XaXvZXIctLo4OnTJxHgSZ8gx1YYz8TPihb Wfb5qrh5jsbzisBe0vir695rN/aRXHCq0k4UI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=E3LStifNgUuLd+VD32Zb5UxmVS77q41aK/xZU55AQsc=; b=jf0LColG7X/s0lFuIbz9hZorR5/YffLH3c9wX17KjyhWWuHkeTVE7hQjXD4X1GeKP7 3Qx5iiXgA3wUH7Rjx51NxLKLx//xCMgnzzfq2buz6DJUWGG+k511wX9Bn+3eZOhZvF4B G0nL1vy5HW2pPLo09+p8axYo93UdXDvMejP6nxzD6HGznxFlrpdw0b4BcBJ5PjQNwzFB XXmNC7uw4d3U+OkmGph2ZsAWFyzeKrJXGYgO8lK2V0ftCOyMbqrH3Zb2ZNC71/4tP/zi Ye3SrihlbJ/8OlikBPGjRBrtPQWRLj8Mu8mpi+siQ90EKFxNyEB8sHlwnN/LxQsIcT5T ar6g== X-Gm-Message-State: APjAAAXGr3GqQ9aq4831ldVMP1KT6JeBJ7YGnF3faL4DUWqZ7HzL4ytS euvkMOUTL4T3WGkYLMAffQIXSw== X-Received: by 2002:a17:902:6687:: with SMTP id e7mr10999063plk.211.1567095641909; Thu, 29 Aug 2019 09:20:41 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id l31sm3066505pgm.63.2019.08.29.09.20.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Aug 2019 09:20:40 -0700 (PDT) Date: Thu, 29 Aug 2019 09:20:38 -0700 From: Matthias Kaehlcke To: Nathan Chancellor Cc: Russell King , Nick Desaulniers , Arnd Bergmann , Stefan Agner , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] ARM: Emit __gnu_mcount_nc when using Clang 10.0.0 or newer Message-ID: <20190829162038.GC70797@google.com> References: <20190829062635.45609-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190829062635.45609-1-natechancellor@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 28, 2019 at 11:26:35PM -0700, Nathan Chancellor wrote: > 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 because the calling > convention was not correct. Now that it is fixed, add this to > the command line when clang is 10.0.0 or newer so everything > works properly. > > 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 > Signed-off-by: Nathan Chancellor > --- > arch/arm/Makefile | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/arm/Makefile b/arch/arm/Makefile > index c3624ca6c0bc..7b5a26a866fc 100644 > --- a/arch/arm/Makefile > +++ b/arch/arm/Makefile > @@ -112,6 +112,12 @@ ifeq ($(CONFIG_ARM_UNWIND),y) > CFLAGS_ABI +=-funwind-tables > endif > > +ifeq ($(CONFIG_CC_IS_CLANG),y) > +ifeq ($(shell test $(CONFIG_CLANG_VERSION) -ge 100000; echo $$?),0) > +CFLAGS_ABI +=-meabi gnu > +endif > +endif Is this also correct/needed when CONFIG_AEABI is not set?