4 ms·
>You shouldn't need non-GCC compilers to compile Linux Huh? What relationship the Linux kernel and GCC has? They're independent projects. It might be handy/ni
by coldtea 4y ago
>You shouldn't need non-GCC compilers to compile Linux
Huh? What relationship the Linux kernel and GCC has?
They're independent projects. It might be handy/nice/convenient to not need non-GCC compilers to compile Linux, but it's not like it's some license requirement or project obligation on behalf of Linux
- flohofwoe 4y agoIt should be rephrased to "Rust support in Linux shouldn't require two separate compiler toolchains", e.g. either the Rust toolchain can also compile the C parts, or the C toolchain can also compile the Rust parts (can Linux actually be built with a different C compiler than GCC yet? I thought it relies on specific GCC behaviour?)
- mauricioc 4y agoThis is not an equivalent rephrasing. Although I make some pragmatic compromises every now and then, I think the GNU mission is important, and historically Linux has been an important part of the GNU system. GCC's copyleft license is a big ideological advantage for me, and, although I like the option of using LLVM, I think being forced to use LLVM is a step backwards.
- monocasa 4y agoIt can be built with llvm too; there was a lot of work put into llvm to support gccisms.
- turbinerneiter 4y agoIt's a weird phrasing, but I agree on the compiler topic, maybe for other reasons: an important project like Linux should not really on a single compiler. I think it is good to have the ability to use either GCC or LLVM to build the kernel. That ensures that you don't accidentally rely on a compiler bug, no lock-in, ... . For C and C++ code you want to be able to build with different compilers. I think that also makes sense for Rust, the language and the compiler should be two separate things and there should be multiple compiler suppliers. Are there arguments why this would be less relevant for Rust than C?
- jcranmer 4y agoClang has been a viable compiler for only about a decade--a third of Linux's existence--and could itself build Linux only a few years ago. Prior to clang's existence, Linus is on record as saying that he didn't care about compatibility with other compilers, which at the time would have been something like Sun's C compiler. So it's very much against the historical policy of the Linux kernel to not be tied into a single compiler, even if it is a welcome change in policy.
- R0b0t1 4y agoMoving Linux and FOSS away from GCC runs the risk of enabling the mass adoption in industry of LLVM/Clang and the drying up of open source commits to either project once Clang is in a place where it does not generally require community contributions.
- sillystuff 4y agoGCC supports quite a few more architectures than llvm. Kernels for these archs would not be able to use Rust in the current state. So, this will limit rust to platform specific drivers until either llvm is at parity for gcc for archs that linux is available on, or gcc's rust front-end is fully capable of compiling any rust code in the kernel. In addition to the large maintenance effort for llvm to support so many additional back-ends, there is a non-negligible number of folks who would be very opposed to being forced to use a non-gpl compliler to build a gpl kernel. https://en.wikipedia.org/wiki/GNU_Compiler_Collection#Architectures https://en.wikipedia.org/wiki/GNU_Compiler_Collection#Archit... https://en.wikipedia.org/wiki/LLVM#Back_ends https://en.wikipedia.org/wiki/LLVM#Back_ends https://en.wikipedia.org/wiki/List_of_Linux-supported_computer_architectures#Releases https://en.wikipedia.org/wiki/List_of_Linux-supported_comput...
- bitwize 4y agoLinux has long been written to be compiled specifically with gcc, including the use of GNU extensions. If other compilers implement compatible features such that they can compile the kernel, fine. But gcc has been the supported compiler.