>On Tue, 8 Jul 2014 02:10:37 +0200
>Aleksandar Kuktin <akuk...@gmail.com> wrote:
>
> >On Mon, 7 Jul 2014 17:41:35 +0000
> >Yoann Padioleau <p...@fb.com> wrote:
> >
> > Hi,
> > 
> > I was able to cross compile Plan9 from MacOS which is probably quite
> > similar to cross compiling from Linux.
> > 
> > The first thing was to compile the plan9 C compilers
> > on MacOS. I used https://code.google.com/p/ken-cc/ because this fork
> > of the Plan9 C compilers are easier to compile on non-plan9 OSes.
> > 
> > Then I installed plan9port which contained a few utilities that are
> > used when compiling the plan9 kernel (/bin/rc, /bin/mk).
> > 
> > [snip]
> 
> Ken-cc may be the missing piece of the puzzle for me, however it is a
> little too early to tell. Right now I'm working on compiling the
> kernel which SHOULD, theoretically, be easier then userspace since
> the kernel is far, far more hermetic than the userspace.
> 
> Anyhow, I'll be sure to post the method for doing it, should I
> eventually end up victorious.

Well, I managed to make the kernel and almost everything else I touched
compile. No idea yet on whether it will run. But libscribble is giving
me a really hard time. There is a bunch of #pragmas about incomplete
data structures that the compiler (8c from Kens suite) doesn't
understand and those are holding me back.

As for the rest, the biggest problem is a bug in Kens compiler from
code.google.com. There is a header, a.out.h, which contains a
definition/declaration (I always forget what is a definition and what is
a declaration) of a structure called Sym that is different in the two
header files. As a consequence, the compiler and assembler produce
object files whose symbol tables the archiver is unable to read. As a
consequence of that, the libraries are useless. The solution to this
was to delete the copy in src/libmach/a.out.h, and rebuild everything
with the other copy.

Since I am building everything on Unix, and am using the Unix shell
(bash in my case), I had to rewrite much of the mkfile rules,
specifically ones that deal with loops, conditionals and substituting
outputs from commands. Because all those rules are simple, this was a
trivial task. I also needed to change sed programs embedded all over
the place to be understandable to my systems sed.

Probably the biggest problem was rewriting several programs from the
aux/ directory (/sys/src/cmd/aux/). These are written to be run on Plan
9 and "porting" them to Unix had to be done by hand. Again, since they
are for the most part simple, it wasn't much of a chore. It just had to
be done.

And that wraps up this weeks events in my attempt to compile and run
Plan 9.

-- 
Svi moji e-mailovi su kriptografski potpisani. Proverite ih.
All of my e-mails are cryptographically signed. Verify them.
--
You don't need an AI for a robot uprising.
Humans will do just fine.

Attachment: signature.asc
Description: PGP signature

Reply via email to