Opened 8 years ago

Closed 6 years ago

#654 closed enhancement (fixed)

C++ support

Reported by: Vojtech Horky Owned by:
Priority: major Milestone: 0.7.2
Component: helenos/unspecified Version: mainline
Keywords: gsoc16, gsoc17 Cc:
Blocker for: Depends on:
See also:

Description

Implement support for C++ in HelenOS to allow compilation and execution of C++ programs.

Details
Currently the only language that is fully supported for development of applications for HelenOS is plain C. While C is a good choice for kernel and low-level services, for more complex applications C++ might be a better choice. The goal of this ticket is to bring support for C++ to HelenOS, from toolchain installation to run-time support in HelenOS.

HelenOS toolchain script already installs a C++ compiler (g++). Still some minor changes might be needed (probably in the form of configure options).

Since all HelenOS components (kernel, userspace servers and utilities) are currently written in C, the build process compiles all source files with a C compiler. It would be necessary to add support for compilation of C++ programs, e.g. by automatic detection of .cpp files among the sources or by a manually specified flag.

Next step is adding the run-time support for C++. The C++ compiler expects that a system library implementats functions needed for the support of exceptions (namely support for stack unwinding) and run-time type identification. There are two options: port the GCC-provided libraries or write implementation from scratch. The first option would probably require extensive patching as HelenOS is a non-POSIX environment but it would bring a full-fledged support. On the other hand, rudimentary support can be written from scratch and extra functionality might be added later, in an on-demand manner.

Last step towards full C++ support is STL with std::string, containers and streams. Again, it is possible to write the library from scratch or port an existing solution.
What Gains and Benefits will this bring?
The obvious benefit when this task is completed is the ability to execute C++ programs inside HelenOS. That would give HelenOS developers more flexibility in development of new utilities and servers as another language would be supported. By adding the C++ support it would also be possible to upgrade the GCC version we currently use inside HelenOS (i.e. not the cross-compiler but the native compiler available through Coastline), bringing HelenOS one-more step closer to being self-hosted.
Difficulty
medium to high
Required skills
A successful applicant will have good skills of programming in the C and C++ languages and the ability to survive in a non-standard non-POSIX application environment. Understanding of compiler internals would be beneficial.
Documentation
Possible mentors
HelenOS Core Team, Vojtech Horky

Change History (2)

comment:1 by Jiri Svoboda, 6 years ago

Can we close this ticket now?

comment:2 by Jakub Jermář, 6 years ago

Milestone: 0.7.2
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.