Opened 11 years ago

Last modified 8 years ago

#517 new enhancement

Port the clang (LLVM) compiler to HelenOS

Reported by: Vojtech Horky Owned by:
Priority: major Milestone:
Component: helenos/app/other Version: mainline
Keywords: gsoc13, gsoc14, gsoc15, socis15, gsoc16, gsoc17 Cc:
Blocker for: Depends on:
See also: #413

Description (last modified by Martin Decky)

Port the clang (C frontend to LLVM) compiler to run in HelenOS.

Integrate a reasonably recent version of clang into HelenOS so that it can be used to compile C programs from within HelenOS.

clang is partially written in C++ and thus it would be necessary to introduce a rudimentary support for C++ into HelenOS libraries. The first requirement is a C++ cross-compiler but that is already prepared by the toolchain script. Next is support for some C++ constructs in HelenOS libraries (exceptions and stack unwinding) that is missing but shall not be that difficult to add. Last thing is the STL but there are many implementations around and it shall not be a big problem to find some BSD-licensed that would be easily portable. Performance of the STL is currently not an issue, the main factor shall be the simplicity of bringing it into HelenOS.
What Gains and Benefits will this bring?
One of the strategic goals for HelenOS is becoming self-hosting. During previous GSoC, a PCC compiler (Portable C compiler) was ported to HelenOS but it is not possible to compile all sources with it, while clang is able to compile kernel completely and there are only very minor issues with few userspace files. Thus, having clang it would be possible to compile whole HelenOS inside HelenOS (there is already a working port of GNU binutils in HelenOS).

There is a parallel effort to bring GCC to HelenOS and it would be very nice to have the possibility to choose between more compilers when compiling HelenOS.
Required skills
A successful applicant will have good skills of programming in the C and C++ language and the ability to survive in a non-standard non-POSIX application environment. The applicant should also be familiar with the basic concepts behind compilers and the build toolchain.
Possible mentors
HelenOS Core Team, Vojtech Horky

Change History (7)

comment:1 by Vojtech Horky, 11 years ago

See also: #413
Type: defectenhancement

comment:2 by Vojtech Horky, 11 years ago

Description: modified (diff)

comment:3 by Martin Decky, 11 years ago

Description: modified (diff)

comment:4 by Vojtech Horky, 10 years ago

Keywords: gsoc14 added

comment:5 by Jakub Jermář, 9 years ago

Keywords: gsoc15 added

comment:6 by Martin Decky, 9 years ago

Keywords: socis15 added

comment:7 by Jakub Jermář, 8 years ago

Keywords: gsoc16 added
Note: See TracTickets for help on using tickets.