Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5355978imm; Tue, 21 Aug 2018 10:17:21 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx1s2TUhx/9gvpf6n9ek6uVSBPtAXIhy1ejGeAYgWDqbs58vxQZGH477H7BqMuN9JH1HBhV X-Received: by 2002:a62:15c8:: with SMTP id 191-v6mr53863990pfv.194.1534871840987; Tue, 21 Aug 2018 10:17:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534871840; cv=none; d=google.com; s=arc-20160816; b=AYxF6jCxC1rWBxBk2WJzlHFdUVoe1on6xmbLC3jbBWfiD3/vawfjY1b8ZI+2jRwgAg kJbxmK4nJH9Lflm8/E1ft4dtJwAIV4CdoiuIaLWVcxjuhyOwWl99GlBGAAVQksmB/yIh OfaeAi6UC7GImABoz6Cj6FxVfciTh2Gi+XFhYBSgtwTt8q6F6qWWdyuRYt6u109QzCOM XFMI5ApP8pFmxoU9Jzv6FcFtTDbeonC25MpXWXCLkOCjIKnJVo5hEa2wdbUvj6xETODI k4nyXINrStk0woL1rpxjZfoIGzwg9c8q3xgBP9SmpaLN9E5YbqGZlzGsmmEiRph4AQBN 0z1w== 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 :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=Dt8NKNjnFYqTumjIQyKLOk7XINO5y66ZYHHMjTS1uWI=; b=JroOnSeP2t02Rkv8o7i1qb0qj0e+GjZRtK278Bpc5Bmec5OEZQctihRkD/iB6CZrsx JxLWzckEV65FW/PgPGic0Ur4qdif4tSfjLhI6+w72iPHDwvGR6WOvGeEIFQDDSHLX2lO kxYoKEsZtlIGtOB/yuxD0X7Mc8pMOA641yvzx0GyiIMUz+s1o4phpnYGQZX6wcM8mCl0 KJb96hzhKX4kCwqo0uppkGiOAzbbVDIG7s10fepRbnYiYzSTvJy00VBqyordFO+Vglj5 1m0oIPRLhXLxyaRCc7ye5F6ORwnlefur939EpEWEJard6ejCzsHYi/3m550Ef8M5msXc FWAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=XAb6bVix; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r22-v6si7529721pls.131.2018.08.21.10.17.05; Tue, 21 Aug 2018 10:17:20 -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=@google.com header.s=20161025 header.b=XAb6bVix; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727192AbeHUUSU (ORCPT + 99 others); Tue, 21 Aug 2018 16:18:20 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34272 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726780AbeHUUST (ORCPT ); Tue, 21 Aug 2018 16:18:19 -0400 Received: by mail-pg1-f193.google.com with SMTP id y5-v6so8731178pgv.1 for ; Tue, 21 Aug 2018 09:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Dt8NKNjnFYqTumjIQyKLOk7XINO5y66ZYHHMjTS1uWI=; b=XAb6bVixTf+P1rEEfh5H2iN8kNNIQZO6ecrJDTkZa6TdwYylNrD1gy2EUay4Ucin9x raOKFi2rx3fadIwVfxGzfUIEsq1iQhRpu0swx0JoE6N03HJ8ZWOUKHLT/mJHeUqUkxoa FZUaStC2B7sj2y7boJj12gdqQi4SUWATq7gVGNPqinCL27ZrB9RdCHImQHjp9VmOR7Nn XOvEtCp0GiAVHTmNqHHpChB9Aag4RYllLbQ/x1C2L+hAJMhJFnVl3Wmri7NHDqiAOayA d9PPUuiXosTxE7f5NOfm4eHm4MKRe1fS/Hx/YHEnSusfh5eWWi0h5R+wpLG/3AyxjC6k hoBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Dt8NKNjnFYqTumjIQyKLOk7XINO5y66ZYHHMjTS1uWI=; b=KzPS77U3011hwHxCaybYD/PAFo6To+NlJFI1f9PM29/KJbI6VjYRzLGJKtvkNFFh58 daNWFfV+J/AqNCu4f9LhHRxoCCqxlvwpQzNLa46m+mSAPGpoGjEotjs8QcAmRa1LWpzq usDr8vedj1wO/nwCqk+fQ2uECT5kKlkmbxLS3iKt4GlMIxMt+SZM3Ch30bmuXfpsUaBN wqU3NyK06G6kwbEKKjimv3sX9KdcIRxKS89rH1/O4CEVdkBaR4QzkW3s6boswCDRBsWp 15pHSIKXDBZCrfL3eAWIQgu0zRX0lx84ITVRbHoeR51lfr3K7l7SzowU7XzmtDeewrHo i2fg== X-Gm-Message-State: AOUpUlEzee59BHbyg4b/ilkT3PUR3yX1bcOza4cicO1J+TXk1L30sGFI /GBQTS6cLWUVtsaZAhLWMqD34h1994v2L/GP+Vm4SQ== X-Received: by 2002:a63:2352:: with SMTP id u18-v6mr9951593pgm.202.1534870643289; Tue, 21 Aug 2018 09:57:23 -0700 (PDT) MIME-Version: 1.0 References: <1534834088-15835-1-git-send-email-yamada.masahiro@socionext.com> <6b1d5081e2da107537f72125fc595229128b46e6.camel@perches.com> In-Reply-To: <6b1d5081e2da107537f72125fc595229128b46e6.camel@perches.com> From: Nick Desaulniers Date: Tue, 21 Aug 2018 09:57:11 -0700 Message-ID: Subject: Re: [PATCH] compiler-gcc: get back Clang build To: joe@perches.com 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 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 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. > 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. > See commit e501ce9 ("x86: Force asm-goto"). $ git describe --contains e501ce9 | sed 's/~.*//' v4.17-rc1 -- Thanks, ~Nick Desaulniers