Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1123279ybm; Wed, 22 May 2019 17:59:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLki+n1BUm8WTfpHzdpJPaf7HQvow/P4wqkaWhlklFEq0WLwIF6ojZCPDWwwYWdZuLTy7J X-Received: by 2002:a17:902:bd94:: with SMTP id q20mr71545054pls.146.1558573158023; Wed, 22 May 2019 17:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558573158; cv=none; d=google.com; s=arc-20160816; b=X5gvgiKGwXDwZK0lbuC8nY3c7BbZognURDeploM2fUrEKpkjMa9kQeKlVq5SXV9pbt 1Gcw2F8VWABRJCb/Hbckvy4irtdQsMbY2YFikk9ZdwH5gCSlqVxyT1NwkiA5zfytQzGD 7Qbokp/AOTDoySWpEJAVQLdR9hiKORxrTKozkDQJ9iAVVnRQiCPOz9bCA39XF8eF+UYc lbnwlSP73D3p7XCDKYQUCNaioI2NZdX7kbkAWfJ8sdqEWS+R3LKpR6u9eZY8Bp/2uBV2 mA68K607IYnifsUIXK48fUQI39Zrlga6m5DNe5XTvZxXxE9gnw4Qb1rIYjyLWTjdPWo/ itYw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=OCcxFZ8u217pCLU2+Z7QXQBb4BZSJxt773aXmFVctu0=; b=wun/WzVWPEShV438bCaTKUwhPbzW9W+iapjHv/gbF9JO1ACMomWRB0giHsW4CFaBF4 bBeW9bl6PfjF1xju2FeyVGscY062A3ggiC0/5HnycreiETc1Fy6bk5W05iIhaBQka+zQ DPcVqPsY+t5UA4Pl7BfkRfHG3vrVruiTXzNeUsgmELnFLw9Ik2pbFnDuLXoEp53j3SaI YkNgjhu2S96PBh6rfJ1N0Iv8uReqTiEb6V/d7SDhJ8IZGoficuVTjWzbo0m25YeAz9in KGxcB09EXgfmk5R4WXT7XbxPg+4zZowzsQDGa8L1NwZdNykJdQSz4lCn5viGze4tLYlZ m2xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b="lrXxW/5u"; 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=android.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16si27504583pfr.229.2019.05.22.17.59.02; Wed, 22 May 2019 17:59:18 -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=@android.com header.s=20161025 header.b="lrXxW/5u"; 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=android.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729656AbfEWA5T (ORCPT + 99 others); Wed, 22 May 2019 20:57:19 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:37949 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727305AbfEWA5T (ORCPT ); Wed, 22 May 2019 20:57:19 -0400 Received: by mail-pg1-f195.google.com with SMTP id v11so2177917pgl.5 for ; Wed, 22 May 2019 17:57:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OCcxFZ8u217pCLU2+Z7QXQBb4BZSJxt773aXmFVctu0=; b=lrXxW/5uiapy3w5HtMfhyB3Bk6NFY9FVuWaL71RTtfJPQMsRDPNUJ7ipQQta880l5N 8GpHNpjXdvqbRNY+BQ07w0p05xblGT3W5Ka+LFkYA2Huk3F0A6Ztn4p1oSeVkpdpoxLE LdAXKWYp/K9oGn3cDvAwA1Fr6ekNdwdeBAKUtMMSxb+WkpnKgkxcqTZODoWSQJfA9tUs cpYaq0PTzWmljBUSbDbC3aXbPRLGwxCP3t3uxoTq5tZxmd7gMpoPfBTAovC8hsRFxImI 3WUaej/Bo6ywL+QHNzw0QifPZAJ1sdx+u8r/4xhLepgfejmyLaTGb6mA+w27EglaPq0x CWVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OCcxFZ8u217pCLU2+Z7QXQBb4BZSJxt773aXmFVctu0=; b=T4mHdbOVqovq87SN7kBTDMhH7oTq5tWSmCCaBVXoG8ySEuUsTCzT1s7sr26tx9IS4D kaYxlNjKrue7Z5pOv5HNUe+2m7KykFD4BQCx+X958H84Os5v/jqCrLBBVX7ijAydJPXw EwS+7stUaZv/cPeagBUAui6aUqE2W/llPgNmn5ceOOn1ZcTnV4Q73OKf2clAAKIVuLkJ ZzHDx5aADEIGpajiP7fKaxVV1ezkZYoN9yrqQnDNdLzXq0rXOijUQ1Ae/MwMggbCF7Dy 6BAVqceeumcwKtDNe0BlbaOr0YQUZSnDMtTGKW/f4YI0ympyP16xjU5WAHv/9xhyLGRL HSvg== X-Gm-Message-State: APjAAAVdZhlb5Ac52RcO18tPJmaOyT+LJNmEuSiARA+oMiNr7eeEaeoG bHcwzhLGajMauTnTvuikgCJEVQ== X-Received: by 2002:a62:164f:: with SMTP id 76mr100964441pfw.172.1558573038480; Wed, 22 May 2019 17:57:18 -0700 (PDT) Received: from trong0.mtv.corp.google.com ([2620:0:1000:1601:acd:159c:264f:41eb]) by smtp.gmail.com with ESMTPSA id d13sm23716909pfh.113.2019.05.22.17.57.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 17:57:17 -0700 (PDT) From: Tri Vo To: linux@armlinux.org.uk, yamada.masahiro@socionext.com Cc: ndesaulniers@google.com, stefan@agner.ch, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tri Vo Subject: [PATCH] ARM: disable FUNCTION_TRACER when building with Clang Date: Wed, 22 May 2019 17:56:57 -0700 Message-Id: <20190523005657.170008-1-trong@android.com> X-Mailer: git-send-email 2.21.0.1020.gf2820cf01a-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang needs "-meabi gnu" flag to emit calls to "__gnu_mcount_nc". Otherwise, it inserts calls to undefined "mcount". kernel/softirq.o: In function `_local_bh_enable': ... undefined reference to `mcount' "-meabi gnu" resolves link failures. However, Clang does not implement calls to "__gnu_mcount_nc" correctly. It does not save the link register on the stack, which corrupts the stack. The resulting kernel does not boot. Disable FUNCTION_TRACER support when building with Clang. Link: https://github.com/ClangBuiltLinux/linux/issues/35 Suggested-by: Stefan Agner Signed-off-by: Tri Vo --- arch/arm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 8869742a85df..7a1804392795 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -75,7 +75,7 @@ config ARM select HAVE_EXIT_THREAD 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_CLANG select HAVE_GCC_PLUGINS select HAVE_HW_BREAKPOINT if PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7) select HAVE_IDE if PCI || ISA || PCMCIA -- 2.21.0.1020.gf2820cf01a-goog