Skip to content

Commit

Permalink
Fix generated cc command for cross compile (crystal-lang#13661)
Browse files Browse the repository at this point in the history
Co-authored-by: Johannes Müller <[email protected]>
  • Loading branch information
2 people authored and Blacksmoke16 committed Dec 11, 2023
1 parent b42b422 commit 7b2e955
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/compiler/crystal/compiler.cr
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,9 @@ module Crystal

target_machine.emit_obj_to_file llvm_mod, output_filename
end

_, command, args = linker_command(program, [output_filename], output_filename, nil)
object_names = [output_filename]
output_filename = output_filename.rchop(unit.object_extension)
_, command, args = linker_command(program, object_names, output_filename, nil)
print_command(command, args)
end

Expand Down Expand Up @@ -684,7 +685,7 @@ module Crystal
getter original_name
getter llvm_mod
getter? reused_previous_compilation = false
@object_extension : String
getter object_extension : String

def initialize(@compiler : Compiler, program : Program, @name : String,
@llvm_mod : LLVM::Module, @output_dir : String, @bc_flags_changed : Bool)
Expand Down

0 comments on commit 7b2e955

Please sign in to comment.