linux kernel compliation : Is it possible to compile it by other compiler?
Loïc Grenié
loic.grenie at gmail.com
Mon Sep 21 09:39:30 UTC 2009
2009/9/21 freeburn <hossain at finder-lbs.com>:
> have you ever compiled linux kernel by compilers other than gcc?
>
> i had a argument with one my friend about "linux" vs "gnu/linux", then
> this stuff suddenly came to our mind. i've always compiled linux kernel
> by gcc. i know in theory any c complier with necessary "lib"s should
> compile linux kernel. but is it practically possible? or have u ever
> done it?
It's not really possible. From "Documentation/HOWTO":
The kernel is written using GNU C and the GNU toolchain. While it
adheres to the ISO C89 standard, it uses a number of extensions that are
not featured in the standard. The kernel is a freestanding C
environment, with no reliance on the standard C library, so some
portions of the C standard are not supported. Arbitrary long long
divisions and floating point are not allowed. It can sometimes be
difficult to understand the assumptions the kernel has on the toolchain
and the extensions that it uses, and unfortunately there is no
definitive reference for them. Please check the gcc info pages (`info
gcc`) for some information on them.
The kernel can only be compiled with a (reasonably recent) gcc. There are
some subtle points in the source where gcc (as a compiler: C->object) is
needed and gnu ld is definitely needed to link the kernel.
Loïc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20090921/e22ea641/attachment.html>
More information about the ubuntu-users
mailing list