2011/9/19 ron minnich <rminn...@gmail.com>:
> On Thu, Sep 15, 2011 at 8:46 PM, Jens Staal <staal1...@gmail.com> wrote:
>
>> Alternatively - would a newlib approach be a better bet to get
>> binutils/gcc going? I have been trying to read up on it and to try to
>> locate the syscall information I need from plan9 libc. If anyone got
>> any pointers on how to do this, it would be appreciated :)
>
> I was unsure of the cross compiler idea. Was this to run on linux to
> create plan 9 binaries?
>
> If you really want to do that, just go ahead and port the plan 9 c
> compilers etc. to unix. I did the amd64 linker in about 10 minutes.
> It's very straightforward C code, far easier to port than the sort of
> stuff you find in the GNU world -- someone once complained on this
> list that Plan  9 C code was some sort of "old usage" or something --
> they did not realize that was a *virtue*. The ?c would be a bit longer
> to do but probably not much. Then you can compile all Plan 9 code on
> Unix-like systems to target Plan 9.
>
> That may not be what you meant.
>
> ron
>
>


Actually it was the complete opposite that I wanted :)
The aim I had was basically to compile legacy lunix applications for
Plan9 on a lunix host. For hobby development such a cross compiler +
9vx could be a really nice environment to cut your teeth on while
figuring out the right way to do things.

I have been playing with trying to compile some legacy lunix
applications under APE with or without the old gcc (anyone else
experience a crashed 9vx when you try to use gcc?). Often stuff fail
due to configure scripts expecting GNU sed, autoconf etc (the gmake
port works nicely!)... I guess the "right" way would be to try to dig
through what they want to do and make a real mk file to compile it
instead, but I hoped for a lazier approach ;)

So what I was thinking (perhaps naively) was first to "just" compile
the ported gcc/binutils (/n/sources/extra/gcc) (which should have all
the executeable information for Plan9 in it) + the GCC-ified APE libs
on Linux as a cross compiler for Plan9 (and thus NOT have to worry
about porting all of GNU to APE first...).

After trying to learn about cross compilers I saw this thing about
newlib, where it seems like you can make a cross compiler suspiciously
easily [1, 2]. But as I said previously. I am a complete noob on this
and unfortunately very limited time to actually make it work, but if
someone got something similar done before (I suppose the initial GCC
port was cross compiled from a lunix host of some kind?), it would be
interesting to get it working (and preferrably on an "as modern"
version of GCC as possible).

[1] http://wiki.osdev.org/Porting_Newlib
[2] http://wiki.osdev.org/Boomstick

Reply via email to