From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yoann Padioleau To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Date: Mon, 7 Jul 2014 17:41:35 +0000 Message-ID: <000F4E23-C3D9-481E-AF1F-48049B01E168@fb.com> References: <20140705151359.70ebad14@ikilid> In-Reply-To: Content-Type: multipart/alternative; boundary="_000_000F4E23C3D9481EAF1F48049B01E168fbcom_" MIME-Version: 1.0 Subject: Re: [9fans] Cross-compiling Plan 9 Topicbox-Message-UUID: 012caa78-ead9-11e9-9d60-3106f5b1d025 --_000_000F4E23C3D9481EAF1F48049B01E168fbcom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I was able to cross compile Plan9 from MacOS which is probably quite simila= r 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 v= ariables: export KENCC=3D/home/pad/kencc # need to modify plan9/src/cmd/mk/shell.c and put rcshell as default shell export PLAN9=3D/usr/local/plan9 export PATH=3D$PLAN9/bin:$KENCC/bin:$PATH #for 8._cp to be found and called PATH=3D$PATH:. export objtype=3D386 #export objtype=3Darm export cputype=3D386 Then I did a few modifications to plan9 Labs and was able to compile and ru= n 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 > wrote: On 5 July 2014 14:13, Aleksandar Kuktin > 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 ma= chine 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 distribu= table shape. It might reappear as a side effect of some work on the compiler suite. It's similar to the wa= y Inferno's kernel is cross compiled using the Plan 9 compilers hosted by some other OS, but needs a fe= w special twists to deal with the Plan 9 source tree. --_000_000F4E23C3D9481EAF1F48049B01E168fbcom_ Content-Type: text/html; charset="us-ascii" Content-ID: <965D7E6DC497CE45AA34DDBF8CE71CC8@fb.com> Content-Transfer-Encoding: quoted-printable
Hi,

I was able to cross compile Plan9 from MacOS which is probably quite s= imilar
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 us= ed
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 environm= ent variables:
export KENCC=3D/home/pad/kencc
# need to modify plan9/src/cmd/mk/shell.c and put rcshell as default s= hell
export PLAN9=3D/usr/local/plan9

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

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

export objtype=3D386
#export objtype=3Darm
export cputype=3D386

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

My forks:


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


On 5 July 2014 14:13, Aleksandar Kuktin <akuktin@gmail.co= m> 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 ma= chine 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 su= ite. It's similar to the way Inferno's kernel is cross
compiled using the Plan 9 compilers hosted by so= me other OS, but needs a few special twists to
deal with the Plan 9 source tree.


--_000_000F4E23C3D9481EAF1F48049B01E168fbcom_--