id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,field_blocks,field_dependson,field_seealso 574,Add *-helenos-* target to GCC,Vojtech Horky,Jiří Zárevúcky,"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 [http://vh.alisma.cz/blog/2013/11/06/gcc-for-helenos-sitrep/ similar flags to it] to compile anything in HelenOS. [[br]][[br]] 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). [[br]][[br]] 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 [ticket:573 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:: - [wiki:DeveloperDocs#Clanguage] - [http://gcc.gnu.org GCC, The GNU Compiler Collection] - [http://wiki.osdev.org/OS_Specific_Toolchain OSDev: OS Specific Toolchain] - [changeset:mainline,1741.1.23 Adding basic support for *-helenos-* target to the toolchain] - [http://vh.alisma.cz/blog/2013/01/24/towards-gcc-for-helenos Blog] [http://vh.alisma.cz/blog/2013/01/27/towards-gcc-for-helenos-2-libgmp posts] [http://vh.alisma.cz/blog/2013/02/13/towards-gcc-for-helenos-3-libmpfr about] [http://vh.alisma.cz/blog/2013/11/06/gcc-for-helenos-sitrep GCC] [http://vh.alisma.cz/blog/2013/11/07/gcc-for-helenos-todo porting] - [http://vh.alisma.cz/blog/2013/03/30/introducing-helenos-coastline Blog] [http://vh.alisma.cz/blog/2013/12/08/helenos-coastline-updates-status-matrix posts] about helper scripts for porting software to HelenOS - GCC internals - [http://gcc.gnu.org/onlinedocs/gccint/Driver.html Controlling the Compilation Driver] - [http://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/Spec-Files.html Spec file details] - [http://stackoverflow.com/questions/7493620/inhibit-default-library-paths-with-gcc How to inhibit default library paths] Possible mentors:: HelenOS Core Team, Vojtech Horky",enhancement,closed,major,0.8.0,helenos/app/other,mainline,fixed,,,,,#413