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

Opened 3 years ago

Last modified 13 months ago

#574 new enhancement

Add *-helenos-* target to GCC

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

Description (last modified by vhotspur)

Patch GCC compiler to support a truly native *-helenos-* target.

Details
The GCC compiler was ported to HelenOS during 2013. The porting effort concentrated on running the GCC somehow in HelenOS and there was no emphasis on patching GCC to look as a native compiler. Thus, the user still needs to add -nostdlib and similar flags to it to compile anything in HelenOS.

The goal of this project is to add a *-helenos-* target to GCC that would target the Linux ABI but would use HelenOS-specific directories or predefined macros. Also, the ported GCC is rather old (4.6.3) and shall be updated to the newest version (this includes the need to add rudimentary support for C++ in HelenOS).

Follows an incomplete list of some of the features that needs to be covered
  • update to newest GCC
  • add support for C++ to HelenOS
  • add HelenOS specific defines such as __LE__ or __32_BITS__
  • get rid of Linux defines such as __unix__
  • use HelenOS include directory /inc instead of all the /usr/something that are used in Linux
  • use proper linker script
It would very nice to add a custom HelenOS -posix switch for building POSIX applications opposed to native HelenOS ones.
What Gains and Benefits will this bring?
One of the strategic goals for HelenOS is becoming self-hosting. Since most of the HelenOS code is written in C, having a portable, full-fledged native C compiler is a prerequisite to reaching this goal. Using the same compiler for cross-compilation and building HelenOS from itself is also a benefit of its own. This particular task will improve the usability of GCC when run inside HelenOS.
Difficulty
Easy to Medium. Once the student becomes acquainted with the organization of GCC source tree, the patches would be rather straightforward. Prospective applicants shall consider proposing this one together with Bazaar port.
Required skills
A successful applicant will have good skills of programming in the 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 (5)

comment:1 Changed 3 years ago by vhotspur

  • Description modified (diff)

comment:2 Changed 3 years ago by jermar

  • Milestone changed from 0.5.1 to 0.5.2

comment:3 Changed 2 years ago by jermar

  • Keywords gsoc15 added

comment:4 Changed 16 months ago by jermar

  • Keywords gsoc16 added

comment:5 Changed 13 months ago by jermar

  • Milestone 0.6.1 deleted
Note: See TracTickets for help on using tickets.