Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4942303imm; Tue, 21 Aug 2018 03:47:19 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxcQOUHR5pDvHtANFEc96D/k74cXCZTsrmHTQouvEqOo4ubCJF4shcaMFiZT+R56McXTj9R X-Received: by 2002:a65:6110:: with SMTP id z16-v6mr47796354pgu.412.1534848439692; Tue, 21 Aug 2018 03:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534848439; cv=none; d=google.com; s=arc-20160816; b=CSVEbfT+1HewZb+J5gFZBh4OMYqr3hAOruiqVkPCChxVoOW7Y+adSIBjtDFF8zQ/4w P03iTzeRYWvu0j1snQp1Vdkvem187ihPJghp8BgRhBB4oyx9AuQFox8Stiamqvo58SPk jxKAHIOKG2LKlnIwBjXetZNjyOp3mgpBOMkRJwlP/h0K61yp9i0KqqLP6dwMZx/Fi50O 9gFhK++3ISU0Qt3By1sIOWb9kLo1jmcDDV8IWkVms1QtKmftzdd+Ny+6CtW0sI7ed6Dl MfxFDxRbCMfa/7MrYR/0jJ5HKxjJsgTWNu4PR5Pv/hY8IR3Ed6/4VXpRgSn0FoTtuwfR vS6Q== 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=D7AXLORiE1GXfz5CjarW0oEz7OqihSl3+ziMTHne518=; b=zrWsI5GE9s6w/T14RHw4Y2YtEMAIew/KYYJJPa37iIw+/Z2TajQA95v2/DNTyKjkWa Trh/QvzzQz3bEijE7u6VpHL6t+3IIppl8IwG+SbBlOsHP9J9D4B4S4HgowJVThFz/HSQ 7AaYGpecU2mPJltf7lO0CD28r7/ilH2JpQaEStkO1VTxErilNFWtm65SUHwywAOjxV8K 7DAtGSI7wmuNknIrrb8h6e/ElTI9pPafqKgHLhuTiVWsqFQ/kgHLMbXhJW6GuiePDrpy kNwu1wHcUGnHM2J0l2+6vAwdvlt5QnQ469/wEo5Gzk0jUWZzE2tbxsxgyZsZucvu7Q6h 3qHw== 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 b5-v6si8952654plk.176.2018.08.21.03.46.40; Tue, 21 Aug 2018 03:47:19 -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 S1727051AbeHUN7Y (ORCPT + 99 others); Tue, 21 Aug 2018 09:59:24 -0400 Received: from smtprelay0241.hostedemail.com ([216.40.44.241]:36416 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726842AbeHUN7Y (ORCPT ); Tue, 21 Aug 2018 09:59:24 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id C96EB181D3417; Tue, 21 Aug 2018 10:39:46 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3653:3865:3866:3867:3868:3871:3872:3874:4321:5007:6119:6742:7903:10004:10400:10848:11026:11232:11658:11914:12043:12294:12555:12740:12760:12895:13069:13141:13160:13229:13230:13311:13357:13439:14093:14096:14097:14181:14659:14721:21080:21451:21627:21740:30054:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.14.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:31,LUA_SUMMARY:none X-HE-Tag: prose77_8f4bcddb4ff0c X-Filterd-Recvd-Size: 2734 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf08.hostedemail.com (Postfix) with ESMTPA; Tue, 21 Aug 2018 10:39:44 +0000 (UTC) Message-ID: <7bbf0a3c97f817c81df2316fca0ec88d5a6b4302.camel@perches.com> Subject: Re: [PATCH] compiler-gcc: get back Clang build From: Joe Perches To: Masahiro Yamada , Linus Torvalds Cc: Kees Cook , Nick Desaulniers , Jonathan Corbet , Arnd Bergmann , David Woodhouse , linux-kernel@vger.kernel.org, Thomas Gleixner , Will Deacon , Geert Uytterhoeven , Ingo Molnar , Andrew Morton Date: Tue, 21 Aug 2018 03:39:43 -0700 In-Reply-To: <1534834088-15835-1-git-send-email-yamada.masahiro@socionext.com> References: <1534834088-15835-1-git-send-email-yamada.masahiro@socionext.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 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 +