9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Yoann Padioleau <pad@fb.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Cross-compiling Plan 9
Date: Mon,  7 Jul 2014 17:41:35 +0000	[thread overview]
Message-ID: <000F4E23-C3D9-481E-AF1F-48049B01E168@fb.com> (raw)
In-Reply-To: <CAOw7k5h2auV4Y0b5CZ17Y+UzeichF=du6w8X-M0e0dUWjwAMKA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2058 bytes --]

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).

Then I setup a few symlinks at the root e.g.

/lib -> /home/pad/plan9/root/lib
/386 -> /home/pad/plan9/root/386
/sys -> /home/pad/plan9/sys

Finally I have a env.sh that I source that contains important environment variables:
export KENCC=/home/pad/kencc
# need to modify plan9/src/cmd/mk/shell.c and put rcshell as default shell
export PLAN9=/usr/local/plan9

export PATH=$PLAN9/bin:$KENCC/bin:$PATH

#for 8._cp to be found and called
PATH=$PATH:.

export objtype=386
#export objtype=arm
export cputype=386

Then I did a few modifications to plan9 Labs and was able to compile and run everything
under qemu.

My forks:
https://github.com/aryx/fork-kencc
https://github.com/aryx/fork-plan9


On Jul 5, 2014, at 7:02 AM, Charles Forsyth <charles.forsyth@gmail.com<mailto:charles.forsyth@gmail.com>>
 wrote:


On 5 July 2014 14:13, Aleksandar Kuktin <akuktin@gmail.com<mailto:akuktin@gmail.com>> wrote:

Are there any pointers or short instructions or a HOWTO or something
similar on the art of cross-compiling Plan 9 from Linux?

It would be easier to compile using 9vx under Linux, or a virtual plan 9 machine in qemu under Linux.
It is possible to cross-compile directly, but I've only built and used that environment twice myself
(once for Solaris, once for Linux), and it isn't any longer in any distributable shape. It might reappear
as a side effect of some work on the compiler suite. It's similar to the way Inferno's kernel is cross
compiled using the Plan 9 compilers hosted by some other OS, but needs a few special twists to
deal with the Plan 9 source tree.



[-- Attachment #2: Type: text/html, Size: 3705 bytes --]

  reply	other threads:[~2014-07-07 17:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-05 13:13 Aleksandar Kuktin
2014-07-05 13:22 ` Jacob Todd
2014-07-05 14:02 ` Charles Forsyth
2014-07-07 17:41   ` Yoann Padioleau [this message]
2014-07-07 18:21     ` Skip Tavakkolian
2014-07-07 18:33       ` Charles Forsyth
2014-07-07 18:34     ` Charles Forsyth
2014-07-07 18:47       ` Yoann Padioleau
2014-07-07 19:51         ` Charles Forsyth
2014-07-08  0:10     ` Aleksandar Kuktin
2014-07-09  0:10       ` kokamoto
2014-07-09  7:24         ` Charles Forsyth
2014-07-10  2:02           ` kokamoto
2014-07-13 19:11       ` Aleksandar Kuktin
2014-07-14 22:19         ` David du Colombier
2014-07-14 22:31           ` Yoann Padioleau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=000F4E23-C3D9-481E-AF1F-48049B01E168@fb.com \
    --to=pad@fb.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).