Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5356590imm; Tue, 21 Aug 2018 10:17:54 -0700 (PDT) X-Google-Smtp-Source: AA+uWPz/FRCB5utfGigArzUAAu5koXzZkLb+nUQmuO5Yb5Bw96YHWGD9TgVs3L92eabSGHuD1cEg X-Received: by 2002:a62:3184:: with SMTP id x126-v6mr53975686pfx.49.1534871874678; Tue, 21 Aug 2018 10:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534871874; cv=none; d=google.com; s=arc-20160816; b=HvI2CQLMB53Nf04apXBtAggVSoNAdp1l29jMc/0rY3PMvfORWx7X+2nrmJWV/fD1/q Zkxc8LngdLn2vfP2T3p1GIPBQqwrpQa6cvcy8eNfkImSwVXWLXXOYopkRuv3+7zL3yOE PXriFFcq20Y4nwK8KjIjokbVi3RUOkVo74Ue6NgdkKxSO7gW1iGGv9SEUMD/5DNLSyaI 5NrLwHvib3CM1zPFnAdLwJtqcQbf/vv7in6fM+HqJ9AT4EFRktOwQPFFadVnt/GG+6q0 qWTFRjSPbUzOwzVv/djhNTaE/rr28vliIH0NiEUIl+ACe9rqlcfh+H8YPOI5bak0pm7f VoNQ== 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 :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=MDvsiiJ9XaLqAljq0qyR++mP3TkgV+0DPh+aeblEEEQ=; b=hVtJ6qMStXCwlFy41zWK73m1nnCNUtkPfwPT1fmMVogYjMzXJ8htc3mJNkTwQKpy6t tk+irXTwDqnyJk6PH1whsYZqFezR6vnRPfpGnMr+y8gtBPE/WBkpDuc9A46UcdS9Tkff KdwT2vQY4S7D1J91+gw0USF2BAAQdFcscNgV3t0kDx8ijD99JDK3JhQWiyevxxkInhfh iZQBUBnrvxYuIWbXzUnxkV0Yluas5cdibHTlcLQWjBiOai/wX3XmXiitn5KuZkdLizgd SRoJumY2E7ADnUWRqMDxhAVgJBBIOlD5g21XNWjk5kQTgXFz4yDP2q2exrKgwECXtor1 K1Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=cZwAsAuc; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z19-v6si12344914pgi.388.2018.08.21.10.17.39; Tue, 21 Aug 2018 10:17:54 -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=@nifty.com header.s=dec2015msa header.b=cZwAsAuc; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726989AbeHUUfm (ORCPT + 99 others); Tue, 21 Aug 2018 16:35:42 -0400 Received: from conssluserg-01.nifty.com ([210.131.2.80]:36307 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726609AbeHUUfm (ORCPT ); Tue, 21 Aug 2018 16:35:42 -0400 Received: from mail-ua1-f41.google.com (mail-ua1-f41.google.com [209.85.222.41]) (authenticated) by conssluserg-01.nifty.com with ESMTP id w7LHEWXJ010878 for ; Wed, 22 Aug 2018 02:14:32 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com w7LHEWXJ010878 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1534871673; bh=MDvsiiJ9XaLqAljq0qyR++mP3TkgV+0DPh+aeblEEEQ=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=cZwAsAuclnNIR/uV4H9dMXTVA7u03NSA0AwN40vDlARNkGisVS4xDmLEblP4G3KCa vocNQ4Gwvb6dY929i0vLLBCdM56qQvIi5JebKA8wXO8pE4YaQ3luP9YXeZAKl93M2d OECIcoFol15qmLXChVT6UzBEQv3wYhQRXCMF2r3lQo1t68b1zm/cQvAXHi97a5+gwe cphfuIOFIzHZs/hembxfYiHawxRPpEWM8Y5iDel6bwIjWHLxN5RclepH2+LNKWy84u 0wCwORw8pobcKULrLNFcBchAWxaPP5KjKdNfa9tVfQ9gR3k2vwgaCbYhYswO9tpKBa a/Iilsstmy+hA== X-Nifty-SrcIP: [209.85.222.41] Received: by mail-ua1-f41.google.com with SMTP id m13-v6so12282603uaq.7 for ; Tue, 21 Aug 2018 10:14:32 -0700 (PDT) X-Gm-Message-State: AOUpUlGRbVywPEfHp5OHkr1ctOJ8a4HdyK96dlLcwkioW2AeMCD+euxQ F+LmYx861sqRdFfJkHvB0ZK7AylEM2UJq15xZ9Y= X-Received: by 2002:ab0:6a6:: with SMTP id g35-v6mr34042715uag.16.1534871671562; Tue, 21 Aug 2018 10:14:31 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:2642:0:0:0:0:0 with HTTP; Tue, 21 Aug 2018 10:13:51 -0700 (PDT) In-Reply-To: <7bbf0a3c97f817c81df2316fca0ec88d5a6b4302.camel@perches.com> References: <1534834088-15835-1-git-send-email-yamada.masahiro@socionext.com> <7bbf0a3c97f817c81df2316fca0ec88d5a6b4302.camel@perches.com> From: Masahiro Yamada Date: Wed, 22 Aug 2018 02:13:51 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] compiler-gcc: get back Clang build To: Joe Perches Cc: Linus Torvalds , Kees Cook , Nick Desaulniers , Jonathan Corbet , Arnd Bergmann , David Woodhouse , Linux Kernel Mailing List , Thomas Gleixner , Will Deacon , Geert Uytterhoeven , Ingo Molnar , Andrew Morton 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 Hi Joe, 2018-08-21 19:39 GMT+09:00 Joe Perches : > On Tue, 2018-08-21 at 15:48 +0900, Masahiro Yamada wrote: >> Commit cafa0010cd51 ("Raise the minimum required gcc version to 4.6") >> missed the fact that is included by Clang >> as well as by GCC. >> >> Clang actually defines __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__ >> and it looks like GCC 4.2.1. >> >> $ scripts/gcc-version.sh -p clang >> 040201 > > Perhaps this would work, but I can't test it as > my clang version doesn't otherwise build a defconfig > and errors out with > > $ make CC=clang > arch/x86/Makefile:179: *** Compiler lacks asm-goto support.. Stop. > > --- > include/linux/compiler-gcc.h | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h > index 3e70b7d4e9ed..3a06ad823fa4 100644 > --- a/include/linux/compiler-gcc.h > +++ b/include/linux/compiler-gcc.h > @@ -3,6 +3,23 @@ > #error "Please don't include directly, include instead." > #endif > > +/* > + * Override clang compiler version #defines > + * > + * compiler_types.h always #includes compiler-gcc.h before compiler-clang,h > + * but clang sets these __GNUC version #defines to 4.2.1. > + * This breaks the gcc minimum version of 4.6.0, so override the clang > + * definitions to 4.6.0 > + */ > +#ifdef __clang__ > + #undef __GNUC__ > + #undef __GNUC_MINOR__ > + #undef __GNUC_PATCHLEVEL__ > + #define __GNUC__ 4 > + #define __GNUC_MINOR__ 6 > + #define __GNUC_PATCHLEVEL__ 0 > +#endif > + > This patch does not work. It only addresses the "# error Sorry, your compiler is too old - please upgrade it." part. Attributes unsupported by Clang must be ifdef'ed out. Otherwise, you will see lots of unknown attribute warnings. -- Best Regards Masahiro Yamada