From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B7EEC3A59F for ; Thu, 29 Aug 2019 16:20:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1485B2189D for ; Thu, 29 Aug 2019 16:20:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DN7zITom"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="SyLK87fO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1485B2189D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gO7tqidHm3++YEOve0z9Iox16WRdZe9q2QKMkTdDpqY=; b=DN7zITom6UOBHQ rRTpKNzWDoIE09VVjbda8wBtbekVlqm2jSu3NbX7mmxHic9JDWYPNx6+wqACa/J56Xo6SQBGHHRyP 3CCG6BZqI7vCNqIDZlayqdN3HmyJ9ZEKc0BqjKYM7j3CuzvYmCAtNBxYHv0mBHHZrDTynQ+x7lSZ0 PudHsDMzlXajjTeevrP670ET5xVMXrJr5QSxgrSy2Uj88p6rWEYkTDOZ6ClI1JQkJ24OXu+ZGdVtS /vR7qDQ8cLHAuLzP8FVDWjV6K9ftRhOtzOHX0Vabae1uAUPkdbAPsG2M5IMXL3Yv19GEWdFN7vghq xWdcABdMzvncDlf37SNQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i3NAF-0008Sy-5D; Thu, 29 Aug 2019 16:20:47 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i3NAB-0008SJ-Li for linux-arm-kernel@lists.infradead.org; Thu, 29 Aug 2019 16:20:45 +0000 Received: by mail-pl1-x643.google.com with SMTP id f19so1812956plr.3 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=j8Gt/5OaNIkbPKUJbKrapa+w9mlrwtbbSVtXAUtJYbHv/wcOqgTKUxyl0MstkxtLH/ Kl6JgH1tt7AbFpaPcbnA+XuOLOlPxSmg00wJdZnQ7LpmzrKj0qDySmASvbGLtIbbnqZQ 8xw4wMS1HV34JO3Am4+unJQCx2oUwRUkLd8Fcr6+IJBh30KwB7qhhni77sXyrizr5ZOK 8pOjuxTGeoAaoCMUzDT4nbiOoPHINkaqqvdAwzHd7o5zYm0MM790JCLgAd+xWx42W0bZ WOt0qbU3LV1Uu807qq9RUeiXB2iFvsoQfASZTGicmesRPGBuIkPEQp/1NPxX2Gb0LE93 KrPw== X-Gm-Message-State: APjAAAUoVVpDQA1bXYoblJk7Z7/qKR3kje6GSjb3IF5BhuZHrIibGO2D JAmjrnlAit0VzymKzDqXciZ4rQ== X-Google-Smtp-Source: APXvYqwleG6EymW65DUzWthhf5rXPA5DDgri7wDXOjOC5MovzTOlHopdNSCr5aARJSPQDlerA0ahAQ== 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 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-Disposition: inline In-Reply-To: <20190829062635.45609-1-natechancellor@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190829_092043_737751_E40505F1 X-CRM114-Status: GOOD ( 16.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Nick Desaulniers , Russell King , Stefan Agner , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel