Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
HertzDevil committed Oct 18, 2024
1 parent b98413d commit 8040165
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/compiler/crystal/compiler.cr
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ module Crystal

private def linker_command(program : Program, object_names, output_filename, output_dir, expand = false)
if program.has_flag? "msvc"
lib_flags = program.lib_flags
lib_flags = program.lib_flags(@cross_compile)
lib_flags = expand_lib_flags(lib_flags) if expand

object_arg = Process.quote_windows(object_names)
Expand Down Expand Up @@ -469,14 +469,14 @@ module Crystal
{linker, cmd, nil}
elsif program.has_flag? "wasm32"
link_flags = @link_flags || ""
{"wasm-ld", %(wasm-ld "${@}" -o #{Process.quote_posix(output_filename)} #{link_flags} -lc #{program.lib_flags}), object_names}
{"wasm-ld", %(wasm-ld "${@}" -o #{Process.quote_posix(output_filename)} #{link_flags} -lc #{program.lib_flags(@cross_compile)}), object_names}
elsif program.has_flag? "avr"
link_flags = @link_flags || ""
link_flags += " --target=avr-unknown-unknown -mmcu=#{@mcpu} -Wl,--gc-sections"
{DEFAULT_LINKER, %(#{DEFAULT_LINKER} "${@}" -o #{Process.quote_posix(output_filename)} #{link_flags} #{program.lib_flags}), object_names}
{DEFAULT_LINKER, %(#{DEFAULT_LINKER} "${@}" -o #{Process.quote_posix(output_filename)} #{link_flags} #{program.lib_flags(@cross_compile)}), object_names}
elsif program.has_flag?("win32") && program.has_flag?("gnu")
link_flags = @link_flags || ""
lib_flags = program.lib_flags
lib_flags = program.lib_flags(@cross_compile)
lib_flags = expand_lib_flags(lib_flags) if expand
cmd = %(#{DEFAULT_LINKER} #{Process.quote_windows(object_names)} -o #{Process.quote_windows(output_filename)} #{link_flags} #{lib_flags})

Expand All @@ -499,7 +499,7 @@ module Crystal
else
link_flags = @link_flags || ""
link_flags += " -rdynamic"
{DEFAULT_LINKER, %(#{DEFAULT_LINKER} "${@}" -o #{Process.quote_posix(output_filename)} #{link_flags} #{program.lib_flags}), object_names}
{DEFAULT_LINKER, %(#{DEFAULT_LINKER} "${@}" -o #{Process.quote_posix(output_filename)} #{link_flags} #{program.lib_flags(@cross_compile)}), object_names}
end
end

Expand Down

0 comments on commit 8040165

Please sign in to comment.