Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generated cc command for cross compile #13661

Merged
merged 7 commits into from
Jul 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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