Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5323250imm; Tue, 21 Aug 2018 09:46:08 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzJkkuAHjsWavhXwzLaGV8S460yJPQuG75mGs9guaJlDi6BcGhBf7uM7Ab+7C2bZVSvvlT6 X-Received: by 2002:a17:902:820e:: with SMTP id x14-v6mr50437930pln.218.1534869968691; Tue, 21 Aug 2018 09:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534869968; cv=none; d=google.com; s=arc-20160816; b=PpQaOViRtLpwTF8oM+Tl91LJd/dRAyiF2fVm+Woe/sL/PazNx4VO9WzyiTWpzoVTte 1j+9g/9b1PEQw5NzZZZwB19fmJVY07FvEtM4srqSA9lnKavbUKK4mJxuFmmD8EyhRNcI a74ahvKQVmm8DXEuOfTjJ0BFTFsxwjR8NIh84UeOrtxAmG7CJ3ibbFuByZAIZxPwoAZg ohg6yD5jcVO4VtmCYaHLwnM1xb8cNw4AN1vAKVDrt5/Ncu/ysvRTH5Vu/44xuy5mj+VW arXFSLw1dqBqe8e5Ztc3VuEnmeqjsWu7ggqpx2mqvkzXUGVipDYj+NE5LJ6unnpTGOR6 m9tQ== 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=MnMk6r4wrnCJ645UY5fpMVq/xFYq7fojeKIhbXrFw28=; b=Orkp524aQ8mC+HDSAaZIcJnxh2im9fUvCjzHNKnDsstlJh4kLUZGKPDTgWJWGZ1nzD j4A2uCSBf3mNmqExaIjNRyCsFoGrmDJtxqvQ6WE/8cXazfwWFCRztnxhy4TNDEPfa2Fj mkCStdjFRIdx72HCTjRzwT5czCxtPeKmI/ecELkLgTVWw8+ZUbLU/R/Ep5VSMRFE4/6f 7/uO3mwrhAKUC7AZ4xSZzeR7EEj45QkvvvMLvgoeFrCsK9rKMFpUqk1jvuyy7oHLlRUK LYSsoa/IGiMnRHF8113n7iN/3uRIPYjNmRbMgqVjhjdfS1bcxWdBHOfozopbf1UuJdQW l99w== 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 i23-v6si8820697pgl.304.2018.08.21.09.45.53; Tue, 21 Aug 2018 09:46:08 -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 S1726715AbeHUTyb (ORCPT + 99 others); Tue, 21 Aug 2018 15:54:31 -0400 Received: from smtprelay0158.hostedemail.com ([216.40.44.158]:52870 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726553AbeHUTyb (ORCPT ); Tue, 21 Aug 2018 15:54:31 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 6E463180A8847; Tue, 21 Aug 2018 16:33:41 +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:2198:2199:2393:2559:2562:2693:2731:2828:3138:3139:3140:3141:3142:3352:3622:3653:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4321:5007:6119:6742:7875:7903:10004:10400:10848:11026:11232:11658:11914:12294:12555:12660:12740:12760:12895:13069:13141:13230:13311:13357:13439:14093:14096:14097:14181:14659:14721:21080:21627:30054:30070: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:33,LUA_SUMMARY:none X-HE-Tag: maid60_1fd6be84bc85a X-Filterd-Recvd-Size: 2605 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf10.hostedemail.com (Postfix) with ESMTPA; Tue, 21 Aug 2018 16:33:38 +0000 (UTC) Message-ID: <6b1d5081e2da107537f72125fc595229128b46e6.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 09:33:37 -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 > > If you try to build the kernel with Clang, you will get the > "Sorry, your compiler is too old - please upgrade it." > followed by a bunch of "unknown attribute" warnings. > > Add !defined(__clang__) to the minimum version check. > > Also, revive the version test blocks for versions >= 4.2.1 > in order to disable features not supported by Clang. What is the minimum clang version required to compile the kernel? What features are not supported by the minimum clang version? On my system, using clang $ clang -v clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) and $ git checkout v4.16 ; make clean ; make CC=clang defconfig ; make CC=clang HEAD is now at 0adb32858b0b... Linux 4.16 is successful but $ git checkout v4.17 ; make clean ; make CC=clang defconfig ; make CC=clang HEAD is now at 29dcea88779c... Linux 4.17 arch/x86/Makefile:184: *** Compiler lacks asm-goto support.. Stop. arch/x86/Makefile:184: *** Compiler lacks asm-goto support.. Stop.