Complete kolibri gcc cross-compiler

Post here questions, problems and suggestions in English language
  • Hello maruiszp,

    I think you have the barebone basics correct regarding the path you should take for constructing a cross compiler.

    I've already built an ELF32 version of the executable. As I have some other tasks to deal with at the moment (like C layer etc), maybe it would save you some time to continue the work I have already done.
    The cross compiler I wrote was based on the latest binutils/GCC combination I could find to be working at the time I wrote it (about a month ago, so pretty recent I believe).

    I was writing a tutorial / HOWTO on how to get a cross compiler built for kolibrios, so maybe it might help you.

    PS - Are you a prospective student who wants to apply for GSoC 2016? (Just curious)
    ---
    Check out the Netsurf Web Browser for KolibriOS.
    Read the wiki and happy hacking with KolibriOS!
  • ashmew2 wrote:Hello maruiszp,

    I think you have the barebone basics correct regarding the path you should take for constructing a cross compiler.

    I've already built an ELF32 version of the executable. As I have some other tasks to deal with at the moment (like C layer etc), maybe it would save you some time to continue the work I have already done.
    The cross compiler I wrote was based on the latest binutils/GCC combination I could find to be working at the time I wrote it (about a month ago, so pretty recent I believe).

    I was writing a tutorial / HOWTO on how to get a cross compiler built for kolibrios, so maybe it might help you.

    PS - Are you a prospective student who wants to apply for GSoC 2016? (Just curious)
    I am currently a UK college student (18), and I wasn't thinking of applying to GSoC.

    Do you have a link to the tutorial you mentioned?

    I am currently working on my own hobby OS but I can contribute my code to KolibriOS too.
  • Hello!

    To clarify what I said earlier, it is not exactly a tutorial , but more of an experience about what I went through.
    You probably know all of this if you have your own hobby OS, but here it goes...If not you, I hope this helps someone..

    Please check the attached files to this post.

    As far as newlib is concerned, I was looking into porting it, but a port is already available on kolibriOS SVN tree inside contrib/ . I think i will contribute to this port rather than create a new one. I think it would be a sane choice for you (or anyone else..) as well in case you want to hack around with newlib.

    If you have any criticism or views on the diff / instructions , let me know . I'll be glad to improve it so it is helpful for someone else / myself.

    DISCLAIMER: This was the first cross compiler I tried to build, so you might find some options are a complete mess or stuff that probably shouldn't even be there..but then, you wouldn't know until you try.
    DISCLAIMER2: Currently, it does not create kolibri Executables..but only regular ELF32 executables that can be worked with some linker magic. But please note that the preferred format is PE instead of ELF32 (Currently)

    Regards,
    ashmew2
    Attachments
    Downloaded 249 times
    gcc-diff.diff (544 Bytes)
    Downloaded 252 times
    Downloaded 255 times
    ---
    Check out the Netsurf Web Browser for KolibriOS.
    Read the wiki and happy hacking with KolibriOS!
  • It looks like your GCC patch does not inlcude a config/gcc/kolibri.h file. Did you add one?

    I can probably get the cross-compiler to output Kolibri executables directly if that helps.
  • mariuszp wrote:It looks like your GCC patch does not inlcude a config/gcc/kolibri.h file. Did you add one?

    I can probably get the cross-compiler to output Kolibri executables directly if that helps.
    Ah, I missed the kolibri.h file. Please find it attached to this post.
    It was added to this location: ./gcc-5.2.0/gcc/config/kolibri.h .

    You will add support to build kolibri executables directly? :D That's great. By all means, feel free to hack this cross compiler and make it better.

    In case you decide to share your work with me (or you are welcome to do it yourself), I'd be glad to push this to the SVN trunk and use it in my projects as well.

    Regards.
    Attachments
    kolibri.h (763 Bytes)
    Downloaded 242 times
    ---
    Check out the Netsurf Web Browser for KolibriOS.
    Read the wiki and happy hacking with KolibriOS!
  • Hello, I have attached a modified version of "kolibri.h" as well as some support files. kolibri_head.o goes into your kolibri sysroot lib directory (sorry, I wrote it in NASM assembly; translation, if necessary, should be trivial, it's literally just the Kolibri executable header with some placeholders that the linker will resolve). kolibri.ld goes into /usr/lib/ (I couldn't figure out how to put it in the kolibri sysroot) [as specified in kolibri.h]. I did not have to try this yet. If you have time, please try this out and tell me how it goes, I can fix any bugs. I'll try myself either today or tomorrow.
    Attachments
    kolibri.zip (1.69 KiB)
    Downloaded 254 times
  • mariuszp wrote:Hello, I have attached a modified version of "kolibri.h" as well as some support files. kolibri_head.o goes into your kolibri sysroot lib directory (sorry, I wrote it in NASM assembly; translation, if necessary, should be trivial, it's literally just the Kolibri executable header with some placeholders that the linker will resolve). kolibri.ld goes into /usr/lib/ (I couldn't figure out how to put it in the kolibri sysroot) [as specified in kolibri.h]. I did not have to try this yet. If you have time, please try this out and tell me how it goes, I can fix any bugs. I'll try myself either today or tomorrow.
    Did you get around to trying this yet? Does it work?
    ---
    Check out the Netsurf Web Browser for KolibriOS.
    Read the wiki and happy hacking with KolibriOS!
  • The binutils patch you provided fails to build "eelf_i386_kolibri.o".
    It will probably be easier if you try my additions to your already-existing build.
  • Who is online

    Users browsing this forum: No registered users and 9 guests