Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5349548imm; Tue, 21 Aug 2018 10:11:00 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyJh7gLOqA3i9f0dxTwqEVC1nOsvOJi5ZPOYDxtit3wbVpDvc5Lo1/VrYgQxdNAyP71T9ZX X-Received: by 2002:a63:4f14:: with SMTP id d20-v6mr5472914pgb.121.1534871460133; Tue, 21 Aug 2018 10:11:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534871460; cv=none; d=google.com; s=arc-20160816; b=vXfioIlGIQnksO9SyoIPvCWhjX3fLCRpXK1TA2TKHtuUTD+H6LLKVGxlSNjEIYIHIc yOGkiW5zDQllYVNv212Jl5yNA8X3LPZ8PekCDD+lZIpSJTFEFwesve8wCsv2HKSwxD2B XuK1H0FYum6veSXQAcyninpbcNNSm/gy0dfWFP/eZfclm81ZDY2DEgShGZERAvl4x1VI eaCp6LdrN9pSaw+3AOH9Ml51aZ2MwbezbWzwTfuXhZjmxO8/mEEHJK6VDWTswyZr1nUu nNSViojRU/4DZTFEOJPW/8TYfhHre+k7w25rvtmxADl8wYOyVxQr99ghCdJiuGdILibr tChg== 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 :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=sE+d/keNTxXJ28F/ND7kc66CTb6zNYaYQOZOVcwv9Hk=; b=zM6ruzIq7uDzDYLJV7hMKySTolN6nxnFJeRQqhJ23BaPiHK8CE+OqQ0o33u+qloc/P rJp4UjSH5TGW5KatNHjXavZwFz6lq+FKuwtafkTzqDkI36U0HV67zFrCy9OunTE6mG1j aejbTnWgYRRmLtkqNxdbz/PNmzvv7vTxHkbAC4MhctrsCX/1SoQ1EZUkAJ4WcCgXQO7/ hvxa8ZmkNUiGXvRH4t9HFRA9p7atxB2boEaKa28055QpWcLmzDBo0ew4dLE4wA9a7B7k zHYYOPJbw4xCLPD6YZWyUhbw0iZSqnppMFUOEpwPPIpgi+LHmtcQJRe1asvp1ZAJIHVj 8gFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=I8SfAPsL; 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 c6-v6si12667923pgn.143.2018.08.21.10.10.45; Tue, 21 Aug 2018 10:11:00 -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=@nifty.com header.s=dec2015msa header.b=I8SfAPsL; 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 S1727372AbeHUU3b (ORCPT + 99 others); Tue, 21 Aug 2018 16:29:31 -0400 Received: from conssluserg-04.nifty.com ([210.131.2.83]:57579 "EHLO conssluserg-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726813AbeHUU3a (ORCPT ); Tue, 21 Aug 2018 16:29:30 -0400 Received: from mail-ua1-f54.google.com (mail-ua1-f54.google.com [209.85.222.54]) (authenticated) by conssluserg-04.nifty.com with ESMTP id w7LH8L3x013835 for ; Wed, 22 Aug 2018 02:08:22 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com w7LH8L3x013835 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1534871302; bh=sE+d/keNTxXJ28F/ND7kc66CTb6zNYaYQOZOVcwv9Hk=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=I8SfAPsLXB6tRvM4wdjv+CUNvPRn2W7WXVfRfl1aOcOGBn+lOrlQNza0WrPmkJMuq Fq3SXcGi1cY1AK2du4PBcCw3/cuUrBj4eHsIqGSTdON4MM3uNBLSh5JWmD1SkaiJqy 7ZJk7z8fCdnvscaPReAWUA15kQ+GEk9kKf/sYCTO/G/0ZcXBqkfpbT34ndF7QXydb3 GIHzf8T+70jTyvPKfxHZX51PNWY6CyZImWHiuYNoNWqUCzwoyV1gEUhZ7C39jQp8+W xd4/BGLZYdf2aT4Fv112w3+2G/GGe4i4RBnVxgifo24LhSXZvTPpP4Zc9lrsF9skmi 7pHlXYCB3nbyQ== X-Nifty-SrcIP: [209.85.222.54] Received: by mail-ua1-f54.google.com with SMTP id i4-v6so12287650uak.0 for ; Tue, 21 Aug 2018 10:08:22 -0700 (PDT) X-Gm-Message-State: APzg51Dh+QxBNSe+IcbYEULysBiqRp6VBrE9ie7vXfarHd2veqFIkecr W3hC/XOJxZs019e3WQ6eotDPt483XuBwQRN3IhY= X-Received: by 2002:ab0:4f17:: with SMTP id n23-v6mr3516342uah.135.1534871300928; Tue, 21 Aug 2018 10:08:20 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:2642:0:0:0:0:0 with HTTP; Tue, 21 Aug 2018 10:07:40 -0700 (PDT) In-Reply-To: <6b1d5081e2da107537f72125fc595229128b46e6.camel@perches.com> References: <1534834088-15835-1-git-send-email-yamada.masahiro@socionext.com> <6b1d5081e2da107537f72125fc595229128b46e6.camel@perches.com> From: Masahiro Yamada Date: Wed, 22 Aug 2018 02:07:40 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] compiler-gcc: get back Clang build To: Joe Perches 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 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 2018-08-22 1:33 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 >> >> 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. > You cannot build x86 because asm-goto support is missing in clang. How about building arm or arm64? $ make ARCH=arm CC=clang CROSS_COMPILE=arm-linux-gnueabihf- defconfig all -- Best Regards Masahiro Yamada