Skip to content

Commit

Permalink
Use explictly clang-4.0 in osx and linux
Browse files Browse the repository at this point in the history
Configure default ThinLTO flags for linux
  • Loading branch information
Brian J. Cardiff committed May 6, 2017
1 parent 21de891 commit 83033fc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/compiler/crystal/compiler.cr
Expand Up @@ -300,7 +300,11 @@ module Crystal
if thin_lto
lto_cache_dir = "#{output_dir}/lto.cache"
Dir.mkdir_p(lto_cache_dir)
cc = ENV["CC"]? || "clang -flto=thin -Wl,-mllvm,-threads=#{n_threads},-cache_path_lto,#{lto_cache_dir},#{@release ? "-mllvm,-O2" : "-mllvm,-O0"}"
{% if flag?(:darwin) %}
cc = ENV["CC"]? || "clang-4.0 -flto=thin -Wl,-mllvm,-threads=#{n_threads},-cache_path_lto,#{lto_cache_dir},#{@release ? "-mllvm,-O2" : "-mllvm,-O0"}"
{% else %}
cc = ENV["CC"]? || "clang-4.0 -flto=thin -Wl,-plugin-opt,jobs=#{n_threads},-plugin-opt,cache-dir=#{lto_cache_dir} #{@release ? "-O2" : "-O0"}"
{% end %}
else
cc = CC
end
Expand Down

0 comments on commit 83033fc

Please sign in to comment.