From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752229AbdEFJ5S (ORCPT ); Sat, 6 May 2017 05:57:18 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36805 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751469AbdEFJ5K (ORCPT ); Sat, 6 May 2017 05:57:10 -0400 Date: Sat, 6 May 2017 11:57:06 +0200 From: Ingo Molnar To: Matthias Kaehlcke Cc: Linus Torvalds , Peter Zijlstra , Michael Davidson , Thomas Gleixner , Peter Anvin , grundler@chromium.org, Linux Kernel Mailing List , ghackmann@google.com, Kees Cook , "linux-tip-commits@vger.kernel.org" Subject: Re: [tip:x86/urgent] x86/mm/kaslr: Use the _ASM_MUL macro for multiplication to work around Clang incompatibility Message-ID: <20170506095706.pzmeplmjrs2yoio3@gmail.com> References: <20170501224741.133938-1-mka@chromium.org> <20170505102555.ysjep3foplmhspux@hirez.programming.kicks-ass.net> <20170505175039.hf3jx4ljuyzzgxdn@gmail.com> <20170505184405.GB128305@google.com> <20170505205249.GC128305@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170505205249.GC128305@google.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Matthias Kaehlcke wrote: > El Fri, May 05, 2017 at 12:30:20PM -0700 Linus Torvalds ha dit: > > > On Fri, May 5, 2017 at 11:44 AM, Matthias Kaehlcke wrote: > > > > > > Indeed, I expect 4.12 (with this patch ...) to build with Clang for a > > > x86 defconfig (with tons of warnings). ARM64 is very close. > > > > Does it actually *work*, rather than just build? > > Unfortunately I can't make an universal affirmation here. The systems for which > I currently develop run a 4.4ish kernel with the clang patches on top. Both x86 > and ARM64 boot, the peripherals work and I haven't encountered any specific > problems yet. Automated tests to assess or detect regressions are still pending. > > Does it work on all possible hardware configurations and use cases? Almost > certainly not. However I think here is where having basic upstream support for > clang can help by allowing more people to evaluate it on their systems without > requiring a whole bunch of random out-of-tree patches, which also makes it > easier to contribute back. So my impression too was that Clang was 'very close' to being usable by users to build a working Linux kernel in practice (on x86), and at this point the kernel can certainly accomodate a Clang quirk or two to bridge the chicken-and-egg problem of who supports whom first. Note that I did NAK ugly Clang hacks in the recent past, so this tentative pledge of support (on the x86 arch side) is not unconditional. Peter is also right about proper asm goto compatibility probably being a preprequisite of any major distro going to Clang. ( I see Clang also as a way for the GCC folks to get their act together - the advantages of competition and all that. GCC has the better license after all, IMHO. ) Thanks, Ingo