Skip to content

Commit

Permalink
Remove Apple Silicon stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Yey007 committed May 12, 2024
1 parent b95ae9b commit c6b6588
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
![CI Status](https://github.com/ethanuppal/cs3110_compiler/actions/workflows/ci.yaml/badge.svg)

> "x86 is simple trust me bro"
> Last updated: 2024-05-11 21:58:07.969005
> Last updated: 2024-05-11 22:57:08.209799
```
$ ./main -h
Expand Down
6 changes: 2 additions & 4 deletions lib/user/driver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ let compile paths _flags build_dir_loc =
Util.write_file asm_file_name (Asm.AssemblyFile.to_nasm asm_file);

let platform = Platform.get_platform () in
let cmd_prefix = Platform.command_prefix platform in

(* Run NASM *)
let object_format =
Expand All @@ -76,8 +75,7 @@ let compile paths _flags build_dir_loc =
| None -> failwith "Could not determine object file format."
in
let nasm_command =
Printf.sprintf "%s nasm -f %s %s -o build.o" cmd_prefix object_format
asm_file_name
Printf.sprintf "nasm -f %s %s -o build.o" object_format asm_file_name
in
if Sys.command nasm_command <> 0 then failwith "Failed to run NASM.";

Expand All @@ -92,7 +90,7 @@ let compile paths _flags build_dir_loc =
Util.merge_paths [ Project_root.path; "lib/runtime"; runtime_folder_name ]
in
let clang_command =
Printf.sprintf "%s clang build.o %s/* -o a.out" cmd_prefix runtime_lib_loc
Printf.sprintf "clang build.o %s/* -o a.out" runtime_lib_loc
in
if Sys.command clang_command <> 0 then failwith "Failed to run clang.";

Expand Down
3 changes: 0 additions & 3 deletions lib/util/platform.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ let get_platform () =
else Unknown);
}

let command_prefix platform =
if platform.os = MacOS && platform.cpu_arch = Arm then "arch -x86_64" else ""

let object_format platform =
match platform.os with
| Linux -> Some "elf64"
Expand Down
5 changes: 1 addition & 4 deletions test/test_e2e.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ let make_e2e_test filename source () =
let expected = Test_snapshots.ir_transform filename source in
Driver.compile [ filename ] [] (Some test_bin);
let actual =
Util.get_command_output
((Platform.get_platform () |> Platform.command_prefix)
^ " "
^ Util.merge_paths [ test_bin; "build_dir/a.out" ])
Util.get_command_output (Util.merge_paths [ test_bin; "build_dir/a.out" ])
in
(check string) "Compiled output should match IR simulator" expected actual

Expand Down

0 comments on commit c6b6588

Please sign in to comment.