Opened 11 years ago

Closed 6 years ago

Last modified 6 years ago

#574 closed enhancement (fixed)

Add *-helenos-* target to GCC

Reported by: Vojtech Horky Owned by: Jiří Zárevúcky
Priority: major Milestone: 0.8.0
Component: helenos/app/other Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also: #413

Description (last modified by Vojtech Horky)

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 (10)

comment:1 by Vojtech Horky, 11 years ago

Description: modified (diff)

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

Milestone: 0.5.10.5.2

comment:3 by Jakub Jermář, 10 years ago

Keywords: gsoc15 added

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

Keywords: gsoc16 added

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

Milestone: 0.6.1

comment:6 by Jiří Zárevúcky, 7 years ago

Keywords: gsoc14 gsoc15 gsoc16 gsoc17 removed
Milestone: 0.7.2
Owner: set to Jiří Zárevúcky
Status: newassigned

Working on this.

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

Milestone: 0.7.2

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

Can this be closed now?

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

Resolution: fixed
Status: assignedclosed

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

Milestone: 0.8.0
Note: See TracTickets for help on using tickets.