Follow us on Google+ Follow us on Facebook Follow us on Twitter

Opened 4 years ago

Last modified 15 months ago

#517 new enhancement

Port the clang (LLVM) compiler to HelenOS

Reported by: vhotspur 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 decky)

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

Details
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.
Difficulty
Medium
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.
Documentation
Possible mentors
HelenOS Core Team, Vojtech Horky

Change History (7)

comment:1 Changed 4 years ago by vhotspur

  • See also set to #413
  • Type changed from defect to enhancement

comment:2 Changed 4 years ago by vhotspur

  • Description modified (diff)

comment:3 Changed 4 years ago by decky

  • Description modified (diff)

comment:4 Changed 3 years ago by vhotspur

  • Keywords gsoc14 added

comment:5 Changed 2 years ago by jermar

  • Keywords gsoc15 added

comment:6 Changed 2 years ago by decky

  • Keywords socis15 added

comment:7 Changed 15 months ago by jermar

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