forked from cil-project/cil
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate 32bit and 64bit Machdep if possible
The -m32 and -m64 arguments are x86-only, so these have to be optional.
- Loading branch information
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module C = Configurator.V1 | ||
|
||
let () = | ||
let real_gcc = ref "" in | ||
let m = ref "" in | ||
let args = Arg.[ | ||
("--real-gcc", Set_string real_gcc, ""); | ||
("-m", Set_string m, ""); | ||
] | ||
in | ||
C.main ~name:"model" ~args (fun c -> | ||
let exe = "./machdep-ml" ^ !m ^ ".exe" in | ||
let {C.Process.exit_code; stdout; stderr} = C.Process.run c !real_gcc ["-D_GNUCC"; "-m" ^ !m; "machdep-ml.c"; "-o"; exe] in | ||
if exit_code = 0 then ( | ||
let {C.Process.stdout; stderr; exit_code} = C.Process.run c exe [] in | ||
Printf.printf "Some {%s}" stdout | ||
) | ||
else | ||
Printf.printf "None" | ||
) |