Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2368973ybe; Tue, 3 Sep 2019 11:49:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyhHyHMN3+uC7a3gjRf20dphhRERulYkC1yqctBOHUIp6iluEjdm9Jusbh3+hmXJgSgOrw X-Received: by 2002:a17:90a:9905:: with SMTP id b5mr751316pjp.117.1567536574638; Tue, 03 Sep 2019 11:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567536574; cv=none; d=google.com; s=arc-20160816; b=d5XwGAw02RCIV3U31m0ubGP5ibh9E284f3gmwnqdNu5mbYvE0DNSpSR2RjKO8/BEA3 KC8icKRObwHHIDvnEmHm2iQfUJTj83wrF3gN0GsCADKJ7+Ku1Hx46PUYkwjrBPGaXlQd TpFU0wFZlxMSNkANf6ZNn/0nwDCK1IsUkTB2w3xL2rpJpDQrxd0uQsTTavIp849onKg4 ULSWQjQhOAAhnqkbnr0RpvrAi15M7UWBFP49ekVeBjvongCFBEfP/duuIuTWs+/KDCWH xc2aOGgxwacqzxik6I9G2aH4u8UdcmvxIPFvr8sKWPj+9cOf9qx1nQ6/RMCoGwzRylK/ qOCA== 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=IEYeijqNBx8FKsQCqztccyibS69/cramAhDtz2iOU7k=; b=x7BFLHOMG5jh8/SWBE8BTZrSPLPrV5UpZ3mDi7VlUEl5oAJTOloSaJS9PDy4j9RRGe wbsQOCrZ/dBpaZsiWqC2WJGa893m+I/1iaOY7EtQrZUjhK//jUGHU93s9KdaCEeuUzdD 6fF9Rt3IhyS2x30t3K66XE4aNrKTBG9Ke6VE9JNlgGaGqL5tE2CoTcVMA5MPYtofZHof wekw1uQ969954IIbtbOjmnR5ueFLjVGt+ZsRLZh8PqSJWsr77rbkExyWKitRCuaWRgEQ jpqLJ/4MULb+RNl0XX/RoLXZYUJ9DP6EWzOGhSqnJGCVdGZSxIiAjzLtJzqHfsEP/pEJ ymMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OyE3pxgc; 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 i71si340163pje.34.2019.09.03.11.49.19; Tue, 03 Sep 2019 11:49:34 -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=OyE3pxgc; 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 S1726377AbfICSsX (ORCPT + 99 others); Tue, 3 Sep 2019 14:48:23 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:46254 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725977AbfICSsX (ORCPT ); Tue, 3 Sep 2019 14:48:23 -0400 Received: by mail-pf1-f196.google.com with SMTP id q5so3463855pfg.13 for ; Tue, 03 Sep 2019 11:48:22 -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=IEYeijqNBx8FKsQCqztccyibS69/cramAhDtz2iOU7k=; b=OyE3pxgc7aeDvUAkSmCMjkF82tfwOvEd6uR6WwP8Y27TMiWd6UxOGWlzMn+hdx4Lyv rpIVbvfseTf6gbuZaAzdJniutKEjgVfg09dgi50K11LcjfEFIwdURoBmHyOkKq1ZsQDD vMZsxocGWcH2DwAMUDoMsv+Sj+8jZ8ecnR1Dw= 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=IEYeijqNBx8FKsQCqztccyibS69/cramAhDtz2iOU7k=; b=CCZ8ukH4pSwRLLyL5S1ut4zfAITz9gfH811X/Oaj1Ovb5MGFEg6RVfPZfQ4IDNLwPH XbAuI35miwSoj9VTjjbKQLyeWWSyhuZoZmHJxsCTtkUmBPHfC5pUej3ZvrmifedVymOd 5fTQBTfsxaQy7qv+H3BUGxcSD9SCeOeM4+VK3ad+GWTlXWc7hK4+/gxm/AHLVZE4zhXt nd9Y3XoDUPzIZ9knn740blMQ/cUvxNJmYuZoFmoQZOaiBQ82ozmOfifosAzK0kF8/tOV m+k4CCKfJNVfTVwVaJRZozV7jtEUCal3YsGd9KFKtdaN2lPq19UHGT18JGRpNmNUUEW2 J6hQ== X-Gm-Message-State: APjAAAWT5/epLrqG9mJ8iE12cif1GDWQ9WYYmGnZmfZmYy0WVA6aVDcM JKq2s0oxkPNpef89sZGOEmG3Jg== X-Received: by 2002:a63:1310:: with SMTP id i16mr31163370pgl.187.1567536502419; Tue, 03 Sep 2019 11:48:22 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id q4sm6220900pfh.115.2019.09.03.11.48.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Sep 2019 11:48:21 -0700 (PDT) Date: Tue, 3 Sep 2019 11:48:16 -0700 From: Matthias Kaehlcke To: Nathan Chancellor Cc: Russell King , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nick Desaulniers , Stefan Agner Subject: Re: [PATCH v2] ARM: Emit __gnu_mcount_nc when using Clang 10.0.0 or newer Message-ID: <20190903184816.GF70797@google.com> References: <20190829062635.45609-1-natechancellor@gmail.com> <20190831060530.43082-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190831060530.43082-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 Fri, Aug 30, 2019 at 11:05:31PM -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 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: Nick Desaulniers > Reviewed-by: Stefan Agner > Signed-off-by: Nathan Chancellor Reviewed-by: Matthias Kaehlcke