public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: linux-kbuild@vger.kernel.org
Cc: Willy Tarreau <w@1wt.eu>, Amy Parker <enbyamy@gmail.com>,
	Borislav Petkov <bp@alien8.de>,
	linux-kernel@vger.kernel.org, linux-gcc@vger.kernel.org
Subject: Re: Alternative compilers to GCC/Clang
Date: Tue, 2 Feb 2021 23:20:59 +0000 (UTC)	[thread overview]
Message-ID: <alpine.LSU.2.20.2102022304070.10104@wotan.suse.de> (raw)
In-Reply-To: <20210202212048.GG18075@zn.tnic>

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.

  parent reply	other threads:[~2021-02-02 23:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 23:31 Alternative compilers to GCC/Clang Amy Parker
2021-02-02  5:33 ` Willy Tarreau
2021-02-02 16:26   ` Amy Parker
2021-02-02 19:11     ` Amy Parker
2021-02-02 20:19       ` Borislav Petkov
2021-02-02 21:00         ` Willy Tarreau
2021-02-02 21:20           ` Borislav Petkov
2021-02-02 21:41             ` Willy Tarreau
2021-02-02 23:20             ` Michael Matz [this message]
2021-03-10  8:53   ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LSU.2.20.2102022304070.10104@wotan.suse.de \
    --to=matz@suse.de \
    --cc=bp@alien8.de \
    --cc=enbyamy@gmail.com \
    --cc=linux-gcc@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox