Print this page
README.xbuild update
Split |
Close |
Expand all |
Collapse all |
--- old/./README.xbuild
+++ new/./README.xbuild
1 1 _ _ _
2 2 (_) | |_ _ _ __ ___ ___ ___ ___ _ __ __ _ _ __ _ __ ___
3 3 | | | | | | | '_ ` _ \ / _ \/ __| / _ \| '_ \ / _` | '__| '_ ` _ \
4 4 | | | | |_| | | | | | | (_) \__ \ | (_) | | | | | (_| | | | | | | | |
5 5 |_|_|_|\__,_|_| |_| |_|\___/|___/ \___/|_| |_| \__,_|_| |_| |_| |_|
6 6
7 7
8 8 Welcome brave fool. Don't Panic! The writer of this README is an even bigger
9 9 fool than you could be (even if old Ben wonders if those who follow fools are
10 10 more foolish).
11 11
12 12 So here's where you get started building illumos on ARM.
13 13
14 14 Step 1) You need to get a build environment set up. There's the easy way and the
15 15 fun way.
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
16 16
17 17 Easy way:
18 18
19 19 cd $HOME
20 20 curl -O https://fingolfin.org/illumos/arm/armtc.tar.gz
21 21 pfexec tar xvzf armtc.tar.gz -C /
22 22 find /opt/armtc
23 23
24 24 Fun way:
25 25
26 -Clone this repository again and do a normal i386 on i386 build.
26 +Using a normal i386 on i386 build:
27 +cd usr/src
28 +dmake setup
29 +cd cmd/sgs
30 +dmake install
31 +
27 32 mkdir -p /opt/armtc/lib/amd64 /opt/armtc/usr/bin/amd64
28 33 cd /opt/armtc/lib/
29 34 ln -s amd64 64
30 35 cd ../usr/bin
31 36 ln -s amd64 64
32 37
33 38 Then from your proto area, install the following:
34 39 o /usr/bin/ld
35 40 o /usr/bin/amd64/ld
36 41 o /lib/libld.so.4
37 42 o /lib/amd64/libld.so.4
38 43 o /lib/liblddbg.so.4
39 44 o /lib/amd64/liblddb.so.4
40 45 o /lib/libelf.so.1
41 46 o /lib/amd64/libelf.so.1
42 47
43 48 Now that's all set go grab illumos-arm-extra (git clone
44 49 gitosis@zelgadis.fingolfin.org:illumos-arm-extra.git) and build that. You'll
45 50 need something like:
46 51
47 52 gmake ARCH=arm STRAP=strap LD_ALTEXEC=/opt/armtc/usr/bin/ld install
48 53
49 54 Once that's done, you'll need to fix up the rpath there. so from the root of
50 55 that workspace run:
51 56
52 57 ./tools/setrpath proto-arm/usr/ /opt/armtc/usr/lib:/opt/gcc/4.4.4/lib:/lib:/usr/lib
53 58
54 59 Finally, you can copy all of that into your arm compiler toolchain directory
55 60 (use pfexec / sudo as appropriate):
56 61
57 62 cp -r proto-arm/usr /opt/armtc/
58 63
59 64 Step 2) Set up illumos.sh
60 65
61 66 In a fresh workspace, you're going to want to set up your illumos.sh with the
62 67 following:
63 68
64 69 # Enable GCC 4 default
65 70 export __GNUC="";
66 71 export CW_NO_SHADOW=1
67 72 export MACH=arm;
68 73 export NATIVE_MACH=i386;
69 74 export BUILD64="#"
70 75
71 76 # Re-set all this MACH-based crud
72 77 REF_PROTO_LIST=$PARENT_WS/usr/src/proto_list_${MACH}; export REF_PROTO_LIST
73 78 ROOT="$CODEMGR_WS/proto/root_${MACH}"; export ROOT
74 79 PARENT_ROOT=$PARENT_WS/proto/root_$MACH; export PARENT_ROOT
75 80 PKGARCHIVE="${CODEMGR_WS}/packages/${MACH}/nightly"; export PKGARCHIVE
76 81 unset GCC_ROOT GNU_ROOT CW_GCC_DIR
77 82 export i386_GCC_ROOT=/opt/gcc/4.4.4
78 83 export arm_GCC_ROOT=/opt/armtc/usr
79 84 export i386_GNU_ROOT=/usr/sfw
80 85 export arm_GNU_ROOT=/opt/armtc/usr/gnu
81 86
82 87 #
83 88 # XXX our gcc isn't called ./usr/bin/gcc fix it up via CW env vars for now.
84 89 #
85 90 export CW_arm_GCC=/opt/armtc/usr/bin/arm-pc-solaris2.11-gcc-4.6.3
86 91
87 92 #
88 93 # XXX We need to set CPP to our specific cpp, not the generic /usr/ccs/lib/cpp
89 94 # as that's rather, well, x86.
90 95 #
91 96 export CPP=/opt/armtc/usr/lib/cpp
92 97 export AW_CPP=/opt/armtc/usr/lib/cpp
93 98 export LD_ALTEXEC=/opt/armtc/usr/bin/ld
94 99
95 100 Step 3) Start your build engines
96 101
97 102 Once you've done that, you're doing to need to need to use the *new* bldenv to
98 103 get started building. For the first time you can go ahead and do something like:
99 104
100 105 cd usr/src
101 106 ksh93 ./tools/scripts/bldenv.sh ../../illumos.sh
102 107
103 108 This is really just a bit of a bootstrapping weirdness. Once that's done you can
104 109 go ahead and continue on.
105 110
106 111 As a part of this you should see an important two lines:
107 112
108 113 Cross-building enabled
109 114 Targeting arm on i386
110 115
111 116 If you don't, stop. illumos.sh is not configured correctly.
112 117
113 118
114 119 Once you have that you can get going. Start off with a resounding:
115 120
116 121 dmake setup
117 122
118 123 Following this, you can build the kernel as far as we have it for ARM
119 124
120 125 cd uts; dmake install
121 126
122 127 You now have a lovely unix and boot_archive pair in bcm2835/unix (raspberry
123 128 pi) and qvpb/unix (qemu versatilepb). These should be booted with a kernel
124 129 command line mimicing that of the boot_archive (regardless of the path of the
125 130 unix you actually provide). For example: kernel /platform/bcm2835/kernel/unix
126 131 -Bconsole=text
127 132
↓ open down ↓ |
91 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX