Skip to content

Commit

Permalink
Added failing if assembly compiler failed
Browse files Browse the repository at this point in the history
  • Loading branch information
e2e4b6b7 committed Jan 5, 2025
1 parent a4e2976 commit 4fdbb18
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/X86_64.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1505,11 +1505,17 @@ let build cmd prog =
(Buffer.contents buf) cmd#get_runtime_path
(match cmd#march with `X86_32 -> "runtime32" | `AMD64 -> "runtime")
in
Sys.command gcc_cmdline
let result = Sys.command gcc_cmdline in
if result <> 0 then
failwith
(Printf.sprintf "Assembly compiler failed with exit code %d" result)
| `Compile ->
let cmd =
Printf.sprintf "%s %s %s -c -g %s.s" compiler compiler_flags debug_flags
cmd#basename
in
Sys.command cmd
let result = Sys.command cmd in
if result <> 0 then
failwith
(Printf.sprintf "Assembly compiler failed with exit code %d" result)
| _ -> invalid_arg "must not happen"

0 comments on commit 4fdbb18

Please sign in to comment.