Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5361869imm; Tue, 21 Aug 2018 10:23:33 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzkaQDO2oAXYs8SUk5hcXL2Qb1BODbs1LcGNpYDy37sHgY2Dxw18EoTSanx50rqrDh7tzdm X-Received: by 2002:a63:9412:: with SMTP id m18-v6mr10656504pge.440.1534872213165; Tue, 21 Aug 2018 10:23:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534872213; cv=none; d=google.com; s=arc-20160816; b=vPKa1QJKP3bo8Yo8Z1HQ/9VyaFJ8xKpN7J1fY0bpzyu7ckIdLVrYLmUV/39YnWTMo3 wi5/JqmqIEBXBHLSplMAJkdVZRLGsgH++0f3Oj9Wb1F/sFarwYJqCV4wkUipCget6OAW BybJwNiz1WvNeHVXhT/uIaXWl8azmKLjV2R98h0/M4deIlb3W7V1FSsLpH/uupFegOdX /t7PA5FppgVxHbovBuSo2T/jKzcTERhuIZ8JM867NDQOPf2jYXNbqh/MEkt3lDleFTmy XZov94XCtgu2m7P5xSimancxqlmL3G2ICBag+OD+63sSgJAoPzfqL0Fl2rj7t7k4kxGN Entw== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=qgoF7dfBO39UWkLuxKJSQtpBxRgTkd39lcQ8f/cMrt4=; b=E8o4xIVsOi36YxjvvLbxic2WgYtIc3Qu4HICd49uO5W7Kocos7NKZIgm7u7GzPGtMR HFOJMOUcpRAeRFJE6NSmRcY1GAIkk4V1Dh/2m/sZHNu4547jjCi/BUfOvHLRlyHKLaTA wCz+mX5yBrAPUO1Ok4OC2hANJadrkobBjA41Bm5Z0JDtFGbCBbXhJfWFL+JTpcLMa/Wx O9nGv5X2cq8zHl10N8InIXX1akSoURze5E8RJvvsmA+jhS+YJmoUUWEmyTBfy70t/erC BELdsdihQZbFgS3xFMckPjKynFT/0EkyJGAprNyuS1skqGdVLkJgs82uWGBCzwpz6fbN an/A== ARC-Authentication-Results: i=1; mx.google.com; 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 u22-v6si9902699plj.434.2018.08.21.10.23.18; Tue, 21 Aug 2018 10:23:33 -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; 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 S1728268AbeHUUlf (ORCPT + 99 others); Tue, 21 Aug 2018 16:41:35 -0400 Received: from smtprelay0077.hostedemail.com ([216.40.44.77]:50203 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727617AbeHUUlf (ORCPT ); Tue, 21 Aug 2018 16:41:35 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 863BA181D3368; Tue, 21 Aug 2018 17:20:33 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2693:2828:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:5007:6119:6742:7875:7903:10004:10400:10848:11026:11232:11658:11914:12043:12294:12555:12660:12740:12760:12895:13141:13161:13229:13230:13439:14093:14096:14097:14180:14181:14659:14721:21060:21080:21451:21611:21627:21740:30054:30060:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:30,LUA_SUMMARY:none X-HE-Tag: watch83_4884ff24863b X-Filterd-Recvd-Size: 3580 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf05.hostedemail.com (Postfix) with ESMTPA; Tue, 21 Aug 2018 17:20:31 +0000 (UTC) Message-ID: <54407c50552a72c6f1e482cb71ce2a9b733038b6.camel@perches.com> Subject: Re: [PATCH] compiler-gcc: get back Clang build From: Joe Perches To: Masahiro Yamada 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 Date: Tue, 21 Aug 2018 10:20:29 -0700 In-Reply-To: References: <1534834088-15835-1-git-send-email-yamada.masahiro@socionext.com> <7bbf0a3c97f817c81df2316fca0ec88d5a6b4302.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-08-22 at 02:13 +0900, Masahiro Yamada wrote: > 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. Then those attributes should be added or overridden in compiler-clang.h.