Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5362415imm; Tue, 21 Aug 2018 10:24:08 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy+iIshvTup50EqZS/JySFGFY7SPBzhoVcsN/d6ewRDRXi3AyJ+j0v+tr19HClj5LZnZ8oZ X-Received: by 2002:a62:8acd:: with SMTP id o74-v6mr54059446pfk.12.1534872248684; Tue, 21 Aug 2018 10:24:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534872248; cv=none; d=google.com; s=arc-20160816; b=ty2pr6O0fe0DKHv+09MnX+wtvPWVB7rNSdIttyDeRV9BZuZIODDqZ01hVe46BorbB1 XgC7gZKmYpPgl9uq1WSYLnW4p8kvR9MSNQT08WZ2O/clPXil33mRC7kEDxK0oNO4HZ1n dshaaZ9RvIEvvKg8Oq1GVaK6Gtl/b6u5Aqu7484nyF+DmFjfJDvDWhq7+XMupXISP+mV y+5OOzh+Qj99JKB6UG2z9VHMvjBgV6LgfUHed0k/JN5g82nIDsQgqcwEDU3J1evBKFy0 DxYBO/ySrXBYJul2wd2Uf145DhiqovFiC6W6sb35l5qzCIqTI0rB5MfLCPo2+70QfdRO Z5Bw== 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=h0sKWpwASsNpHnTN1GADFIOZ03HPqXfN4jT0XIUOEaA=; b=zeAQ4bvsGWJYmVG0GqNTX7xZf3MlE7NEdfHJXIt+eNuh0B75D9r6oVEQaY4HEItW2T sgRw2vpzlECIznP2gxOs8odnlibtAjFd6jWv64xkAuC9gHoG5GXlr/t0KCNXjcsJYuFF 1/8k3HtLFyDMuMG/HtB1uN5b67amQpM7w7IVmPlYGlamAzFfOZmWPpzbwMZcIXqMtolX 0JxGZuBB759EkB66/87Mdz33oYYdKkd6gAoUdy/ed7ngVYTk598SBFGPjUI+OQGi8aLg 1/j3YEBcPP7bTOJRVTsDPirgao2KpWEsYWlM/LQMwMz63Bfss58uifYdSUwd3adxF0Yg khew== 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 b7-v6si10915283pgq.334.2018.08.21.10.23.53; Tue, 21 Aug 2018 10:24: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 S1726850AbeHUUnv (ORCPT + 99 others); Tue, 21 Aug 2018 16:43:51 -0400 Received: from smtprelay0202.hostedemail.com ([216.40.44.202]:50572 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726612AbeHUUnv (ORCPT ); Tue, 21 Aug 2018 16:43:51 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id D77BF181D340F; Tue, 21 Aug 2018 17:22:48 +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:2198:2199:2393:2553:2559:2562:2693:2731:2828:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4321:4362:5007:6119:6742:7875:7903:9010:10004:10400:10848:11026:11232:11658:11914:12555:12660:12663:12740:12760:12895:13141:13161:13229:13230:13439:14093:14097:14181:14659:14721:21080:21451:21627:21740:30041:30054:30070:30090: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:2,LUA_SUMMARY:none X-HE-Tag: rifle85_1841de001f10d X-Filterd-Recvd-Size: 3491 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf09.hostedemail.com (Postfix) with ESMTPA; Tue, 21 Aug 2018 17:22:46 +0000 (UTC) Message-ID: Subject: Re: [PATCH] compiler-gcc: get back Clang build From: Joe Perches To: Nick Desaulniers Cc: Masahiro Yamada , Linus Torvalds , Kees Cook , Jonathan Corbet , Arnd Bergmann , dwmw@amazon.co.uk, LKML , Thomas Gleixner , Will Deacon , Geert Uytterhoeven , Ingo Molnar , Andrew Morton Date: Tue, 21 Aug 2018 10:22:45 -0700 In-Reply-To: References: <1534834088-15835-1-git-send-email-yamada.masahiro@socionext.com> <6b1d5081e2da107537f72125fc595229128b46e6.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 Tue, 2018-08-21 at 09:57 -0700, Nick Desaulniers wrote: > On Tue, Aug 21, 2018 at 9:33 AM Joe Perches wrote: > > > > 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? > > Depends on the architecture and which kernel version/LTS branch you're > using. I'm trying to backport fixes to LTS branches, but sometimes a > compiler upgrade is required. I know that's not great, but I'm > actively trying to fix it. Can you enumerate these dependencies please. > > What features are not supported by the minimum clang version? And enumerate this too please. Uglifying the compiler-gcc file to support clang features that can be overridden in compiler-clang.h instead is not a good way to fix compilation for clang. But still, whatever features in the various clang versions that need accommodation also need listing out in compiler-clang.h, not in compiler-gcc.h > $ git describe --contains e501ce9 | sed 's/~.*//' > v4.17-rc1 Thanks, but I know this. The question remains, if clang can't compile v4.17, why does it immediately matter for v4.19? Why wouldn't overriding the clang __GNUC_ #defines in compiler-gcc.h work acceptably with adding whatever is necessary to compiler-clang.h? I'll experiment with a compiler-clang.h patch.