From c6b6588a4821b758c8f6de4581dc71ca40dc9802 Mon Sep 17 00:00:00 2001 From: Yey007 Date: Sat, 11 May 2024 22:57:56 -0400 Subject: [PATCH] Remove Apple Silicon stuff --- README.md | 2 +- lib/user/driver.ml | 6 ++---- lib/util/platform.ml | 3 --- test/test_e2e.ml | 5 +---- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 9e1c3c8..e33e8a3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/lib/user/driver.ml b/lib/user/driver.ml index 2b785ee..0ef59f2 100644 --- a/lib/user/driver.ml +++ b/lib/user/driver.ml @@ -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 = @@ -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."; @@ -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."; diff --git a/lib/util/platform.ml b/lib/util/platform.ml index 741a7e4..bd1cdf5 100644 --- a/lib/util/platform.ml +++ b/lib/util/platform.ml @@ -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" diff --git a/test/test_e2e.ml b/test/test_e2e.ml index bce6254..78e91a7 100644 --- a/test/test_e2e.ml +++ b/test/test_e2e.ml @@ -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