Linked by Thom Holwerda on Tue 26th Oct 2010 20:36 UTC, submitted by tyrione
Linux Clang can build a kernel now. "The kernel can successfully boot to runlevel 5 (aka X + networking) on the Macbook, both on bare metal and in Qemu. The kernel can successfully boot to runlevel 3 on a secondary test machine, a microATX desktop box (Intel Atom). I haven't tried to start X on this box yet. The kernel can self-host; I am currently running a 'fourth generation' self-hosted Linux kernel built by a 'fourth generation' Clang."
Thread beginning with comment 447238
To read all comments associated with this story, please click here.
Not quite.
by rexstuff on Tue 26th Oct 2010 20:52 UTC
rexstuff
Member since:
2007-04-06

The post notes that neither VDSO or the boot code build correctly with clang. The poster modified the build system to compile these two vital components with GCC. So no, clang can't quite build a working Linux kernel on its own yet.

Aside from this, I find it a bit surprising how dependent on GCC the Linux kernel is. I do not think it behooves an open-source operating system to be so compiler-specific. Open source is supposed to be about choice, right? (Among other things)

Reply Score: 7

RE: Not quite.
by GatoLoko on Tue 26th Oct 2010 21:34 in reply to "Not quite."
GatoLoko Member since:
2005-11-13

The post notes that neither VDSO or the boot code build correctly with clang. The poster modified the build system to compile these two vital components with GCC. So no, clang can't quite build a working Linux kernel on its own yet.


You haven't read the full thread, have you? On a reply [1], the same author says those things, and other that were failing, can be compiled now.

[1] http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-October/011744.html

Edited 2010-10-26 21:35 UTC

Reply Parent Score: 2

RE: Not quite.
by subterrific on Tue 26th Oct 2010 21:49 in reply to "Not quite."
subterrific Member since:
2005-07-10

http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-October/011744.html

"VDSO compiles with Clang."
"The boot subsystem can be built with Clang."

Reply Parent Score: 3

RE: Not quite.
by Bill Shooter of Bul on Wed 27th Oct 2010 02:35 in reply to "Not quite."
Bill Shooter of Bul Member since:
2006-07-14

What else would Linus have used in the late 80's early 90's? Naturally, they grew up together.

Edited 2010-10-27 02:35 UTC

Reply Parent Score: 2

RE[2]: Not quite.
by rexstuff on Wed 27th Oct 2010 04:44 in reply to "RE: Not quite."
rexstuff Member since:
2007-04-06

Fair enough. But 'the late 80's and early 90's' was 20 years ago, now (I know, it's shocking to me too). That is a lot of time to grow beyond meager beginnings.

Furthermore, the Linux kernel prides itself on portability almost as much as NetBSD (which is eclipsed in actual portability by Linux). Given that there are other free C compilers out there (icc, pcc, etc), you would think that Linux would have parted would GCC dependency a long time ago. Compiler dependent code strikes me as just as poor form as architecture dependent code.

Reply Parent Score: 1

RE: Not quite.
by Neolander on Wed 27th Oct 2010 05:10 in reply to "Not quite."
Neolander Member since:
2010-03-08

The post notes that neither VDSO or the boot code build correctly with clang. The poster modified the build system to compile these two vital components with GCC. So no, clang can't quite build a working Linux kernel on its own yet.

Aside from this, I find it a bit surprising how dependent on GCC the Linux kernel is. I do not think it behooves an open-source operating system to be so compiler-specific. Open source is supposed to be about choice, right? (Among other things)

Try to code a kernel and you'll find out why it's hard not to become compiler-specific in some way.

ASM, packed attributes... No standard exists for these currently.

Reply Parent Score: 4

RE: Not quite.
by miker on Wed 27th Oct 2010 13:59 in reply to "Not quite."
miker Member since:
2009-07-08

Aside from this, I find it a bit surprising how dependent on GCC the Linux kernel is. I do not think it behooves an open-source operating system to be so compiler-specific. Open source is supposed to be about choice, right? (Among other things)


Until recently there was no choice. Before, GCC was the only open source compile worth using (for this purpose). There used to be a ton of good commercial compilers, but most of them have been supplanted by GCC, and it wouldn't be reasonable to expect them to be supported.

Reply Parent Score: 1