Skip to content

Commit d2eea5b

Browse files
author
Andy Ray
committed
compiling instructions and tag
1 parent 7f9e10d commit d2eea5b

File tree

1 file changed

+52
-1
lines changed

1 file changed

+52
-1
lines changed

Diff for: rpi/CompilingOcaml.md

+52-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,34 @@ mkdir /usr/ports
6363
mount <ip_addr_of_server>:/home/.../freebsd/fs/ports /var/ports
6464
```
6565

66+
# Compiling ports
67+
68+
Generally you do
69+
70+
```
71+
$ cd /usr/ports/<package>
72+
$ make install clean
73+
```
74+
75+
You can find dpendancies with targets like
76+
77+
```
78+
$ make missing
79+
$ make build-depends-list
80+
$ make run-depends-list
81+
```
82+
83+
This is useful to plan your day...some stuff takes *forever* to build.
84+
85+
Once you have some packages you can
86+
87+
```
88+
$ pkg create -a -o <dir>
89+
```
90+
91+
To generate binary packages which should be installable with the `pkg` util
92+
on a clean build.
93+
6694
# Compiling OCaml
6795

6896
I am using the official 4.01.0 release tarball initially.
@@ -96,7 +124,7 @@ and preprocess. Changing to `cc` gets this compiled.
96124
cc -c -DSYS_freebsd -DMODEL_armv6 -o arm.o arm.S
97125
```
98126

99-
Finally we modify asmcomp/arch.ml at the very top so that `Config.sysytem = "freebsd"`
127+
Finally we modify asmcomp/arm/arch.ml at the very top so that `Config.system = "freebsd"`
100128
maps to EABI.
101129

102130
Now we can run `make opt` and get a native code compiler. However, on running it we get
@@ -128,3 +156,26 @@ File "caml_startup", line 1:
128156
Error: Error during linking
129157
```
130158

159+
## Fixes
160+
161+
Created a new section at the top of arm.S specifically for SYS_freebsd which sets
162+
armv6 + softfp.
163+
164+
Change the configure script to use `cc -c` for both AS and ASPP.
165+
166+
This now builds an ocamlopt which generates binaries - and they run!
167+
168+
Not much testing yet but I have built OPAM and it will at least print
169+
its help screen.
170+
171+
## Next steps
172+
173+
* Release the freebsd opam binaries on the github page.
174+
* Compile ocaml with world.opt to get the native `.opt` compilers
175+
* Create a patch for 4.01.0 so I can push a compiler target for
176+
freebsd 10-release to opam and actually `-init` it.
177+
* binary compiler release as per 4.01.0+ocp-bin
178+
* Compile git
179+
* See if there is somewhere we can store binary packages
180+
181+

0 commit comments

Comments
 (0)