Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp731230pxb; Tue, 2 Feb 2021 17:00:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3aVixaRF3RErx8d+deOdYNYDIIyah6r4uJaPcMawmCb5vbpiLrR4dpa25Z/88ZqXlf3pu X-Received: by 2002:a17:906:490d:: with SMTP id b13mr631702ejq.307.1612314012299; Tue, 02 Feb 2021 17:00:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612314012; cv=none; d=google.com; s=arc-20160816; b=bcFcKT+dMoxtMOsP74CmvQnO7smEs7oAinsGY26JUIBIEUYtPJ3JGkPa99d/g2ILFK qAc3g4gKEeQVTUxcHELNdGrOe1dDMdUBiPTQnYLkBSlWG9pl50vzJhXP4S9sSlPACsYC rOxIqFo36dLRP77/3l/zmdzzx4L5bD3rFiCaJkNyc/MECBzV+EVR8Itcu+CIe+N3WWAd oOWSTpu1e32q8hiTspd1tmpYHqFkVnlD1NnewFRRgU3YuGGXhTZuAJV9j7/4VuX5qp2I iCw8uRhuI1408Dt+OUMMf5+/se35Y7N+Vo+aMmypTBdUMKepMDIX2Xr9BAJYH1w7MtrU 8qlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=gbGDaRHE/uS9Z3URw4bM0VFfq6tUjcRrV8LmlcK6bZw=; b=PhNeE3z4Ng9LMzts1viARf3Iipt9ios40CVjSOo67dZjttPz8xHWKec2BUg4F+IluJ BpaV0UJRsGvte2CKuVRzeVilA1ZFJXQe+11wBQqFKKJzr2yd/EGwrZ5CT+Be6aCY4VPK LV5xIN5WjsfwWVy66ySTXciAHooz8gdXMVTuDuoeull7JdA2yus+PII+N0nRLzV8skFO cx401f4OeXWyBoj8NaJjrRcRNooVN9CdpO54KFXxGscpFKw/SNJKG7Ye6+tYhBp11T74 uJVWoPnDaIqmM1f/rey/UTUbgcgVOm4A3ZzxCGkUsGcQ223l7DjogLHqjKJUZtgkNjje nv+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z95si219074ede.403.2021.02.02.16.59.47; Tue, 02 Feb 2021 17:00:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236367AbhBBXVo (ORCPT + 99 others); Tue, 2 Feb 2021 18:21:44 -0500 Received: from mx2.suse.de ([195.135.220.15]:41120 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232756AbhBBXVm (ORCPT ); Tue, 2 Feb 2021 18:21:42 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 787CAB125; Tue, 2 Feb 2021 23:20:59 +0000 (UTC) Date: Tue, 2 Feb 2021 23:20:59 +0000 (UTC) From: Michael Matz To: linux-kbuild@vger.kernel.org cc: Willy Tarreau , Amy Parker , Borislav Petkov , linux-kernel@vger.kernel.org, linux-gcc@vger.kernel.org Subject: Re: Alternative compilers to GCC/Clang In-Reply-To: <20210202212048.GG18075@zn.tnic> Message-ID: References: <20210202053307.GB28542@1wt.eu> <20210202201920.GA18106@zn.tnic> <20210202210039.GB29751@1wt.eu> <20210202212048.GG18075@zn.tnic> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Tue, 2 Feb 2021, Borislav Petkov wrote: > + Micha. Huh, someone found my video ;-) > > > > > > attributes for example), but is far from being able to compile > > > > > > a kernel A _current_ kernel maybe :) Some 4.6 x86-64 kernel in qemu in a certain config plus a little patches definitely does work. Slowly, but usable. See the repo Boris mentioned. > > > > It's definitely something to work towards - but I don't know if kernel > > > > advancements requiring newer GCC versions will go slow enough to allow > > > > TCC improvements to arise. This isn't just something like with Clang > > > > where a few tweaks to files and to Clang itself did the trick. > > > > > > Maybe this'll help you find something to do: > > > > > > https://www.youtube.com/watch?v=iU0Z0vBKrtQ > > > > > > Yes, it would be lovely to be able to compile the kernel with tcc but it > > > is not going to be trivial. As tcc is so simple it's actually not too much hassle, the biggest roadblocks should be gone; the usage of inline asm in the kernel is ... creative ... and hence the single pass nature of TCC and the C-asm integration pose some challenges ;) Also anything that requires inlining to remove dead but non-conforming code (like calling undefined functions) needs an alternative like macros expanding to zero, instead of a function returning zero. (I even have an limited inliner for tcc, but I didn't like it too much) (My interest was tcc, not kernel development, which is why I never did anything with that 4.6 kernel, I wanted to retain a stable and big known source base for tcc hackery. If someone is interested in kernel compiling that can change the picture of course; I think I at least remember most of the reasons for the kernel patches I had to do to make my tcc hackery easier :) ). > It would be good to start forward-porting and integrating some of the > fixes and even extend tcc to handle some of the gnuisms we're using in > the kernel so that we can build the kernel with it too. > > I can imagine having CONFIG_TCC - as long as that doesn't get too > intrusive and get in the way of things - and those who wanna build the > kernel with it, can enable it. For example... Ciao, Michael.