Commit 928d038 1 parent 8a4ff68 commit 928d038 Copy full SHA for 928d038
File tree 12 files changed +174
-66
lines changed
12 files changed +174
-66
lines changed Original file line number Diff line number Diff line change 1
1
(lang dune 3 .3)
2
2
3
3
( cram enable)
4
+
5
+ ( generate_opam_files true )
6
+
7
+ ( package
8
+ (name Lama)
9
+ (synopsis " TODO" )
10
+ ( depends posix-uname) )
Original file line number Diff line number Diff line change
1
+ (rule
2
+ (target runtime.a)
3
+ (mode
4
+ (promote (until-clean)))
5
+ (deps Makefile gc.c gc.h runtime_common.h runtime.c runtime.h printf.S)
6
+ (action
7
+ (run make)))
Original file line number Diff line number Diff line change
1
+ RUNTIME =runtime32.a
1
2
2
- all : gc_runtime.o runtime.o
3
- ar rc runtime.a gc_runtime.o runtime.o
3
+ .DEFAULT := $(RUNTIME )
4
+
5
+ $(RUNTIME ) : gc_runtime.o runtime.o
6
+ ar rc $@ gc_runtime.o runtime.o
4
7
5
8
gc_runtime.o : gc_runtime.s
6
9
$(CC ) -g -fstack-protector-all -m32 -c gc_runtime.s
Original file line number Diff line number Diff line change
1
+ (rule
2
+ (target runtime32.a)
3
+ (mode
4
+ (promote (until-clean)))
5
+ (deps Makefile gc_runtime.s runtime.c runtime.h)
6
+ (action
7
+ (run make)))
Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ let[@ocaml.warning "-32"] main =
12
12
cmd#dump_AST (snd prog);
13
13
cmd#dump_source (snd prog);
14
14
match cmd#get_mode with
15
- | `Default | `Compile -> ignore @@ X86_64. build cmd prog
15
+ | `Default | `Compile -> (
16
+ match cmd#march with
17
+ | `X86_32 -> ignore @@ X86_32. build cmd prog
18
+ | `AMD64 -> ignore @@ X86_64. build cmd prog)
16
19
| `BC -> SM.ByteCode. compile cmd (SM. compile cmd prog)
17
20
| _ ->
18
21
let rec read acc =
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ class options args =
43
43
val i = ref 1
44
44
val infile = ref (None : string option )
45
45
val outfile = ref (None : string option )
46
+ val march = ref `AMD64
46
47
val runtime_path = runtime_path_
47
48
val paths = ref [ runtime_path_ ]
48
49
val mode = ref (`Default : [ `Default | `Eval | `SM | `Compile | `BC ] )
@@ -79,6 +80,8 @@ class options args =
79
80
raise
80
81
(Commandline_error " Path expected after '-I' specifier" )
81
82
| Some path -> self#add_include_path path)
83
+ | "-march=amd64" -> march := `AMD64
84
+ | "-march=x86" -> march := `X86_32
82
85
| "-s" -> self#set_mode `SM
83
86
| "-b" -> self#set_mode `BC
84
87
| "-i" -> self#set_mode `Eval
@@ -139,6 +142,8 @@ class options args =
139
142
Some args.(j))
140
143
else None
141
144
145
+ method march : [ `AMD64 | `X86_32 ] = ! march
146
+ method get_debug = " "
142
147
method get_mode = ! mode
143
148
144
149
method get_output_option =
You can’t perform that action at this time.
0 commit comments