aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/shims/super
diff options
context:
space:
mode:
authorAlex Wang2016-09-24 23:56:54 -0400
committerAlex Wang2016-11-18 08:54:09 -0500
commit3e4544025d664fe381be96bf2526f08b7464e3cb (patch)
tree23fb992f838c19177378727f246d1004a3e80cd2 /Library/Homebrew/shims/super
parent5e073f1f404f2d2aaf16c30f224bdec91741fba8 (diff)
downloadbrew-3e4544025d664fe381be96bf2526f08b7464e3cb.tar.bz2
Prefer brewed Clang over gcc-6 for needs :openmp
Clang has fully implemented OpenMP support as of LLVM 3.7, so if OpenMP is required by a formula gcc is no longer the only choice of compiler. Clang should be preferred over gcc because using gcc meant linking against libstdc++, which is ABI incompatible with libc++. This may be unnoticeable for some users, but it causes other builds to fail, e.g. pstoedit when imagemagick was built with OpenMP. pstoedit is required for the octave formula, so for some users this could be a significant problem.
Diffstat (limited to 'Library/Homebrew/shims/super')
-rwxr-xr-xLibrary/Homebrew/shims/super/cc6
l---------Library/Homebrew/shims/super/llvm_clang1
l---------Library/Homebrew/shims/super/llvm_clang++1
3 files changed, 7 insertions, 1 deletions
diff --git a/Library/Homebrew/shims/super/cc b/Library/Homebrew/shims/super/cc
index 1552f412d..167fe8c21 100755
--- a/Library/Homebrew/shims/super/cc
+++ b/Library/Homebrew/shims/super/cc
@@ -58,6 +58,8 @@ class Cmd
@tool ||= case @arg0
when "ld" then "ld"
when "cpp" then "cpp"
+ when /llvm_(clang(\+\+)?)/
+ "#{ENV["HOMEBREW_PREFIX"]}/opt/llvm/bin/#{$1}"
when /\w\+\+(-\d(\.\d)?)?$/
case ENV["HOMEBREW_CC"]
when /clang/
@@ -154,7 +156,7 @@ class Cmd
/^-O[0-9zs]?$/, "-fast", "-no-cpp-precomp",
"-pedantic", "-pedantic-errors", "-Wno-long-double",
"-Wno-unused-but-set-variable"
- when "-fopenmp", "-lgomp", "-mno-fused-madd", "-fforce-addr", "-fno-defer-pop",
+ when "-mno-fused-madd", "-fforce-addr", "-fno-defer-pop",
"-mno-dynamic-no-pic", "-fearly-inlining", /^-f(?:no-)?inline-functions-called-once/,
/^-finline-limit/, /^-f(?:no-)?check-new/, "-fno-delete-null-pointer-checks",
"-fcaller-saves", "-fthread-jumps", "-fno-reorder-blocks", "-fcse-skip-blocks",
@@ -163,6 +165,8 @@ class Cmd
"-fuse-linker-plugin", "-frounding-math"
# clang doesn't support these flags
args << arg unless tool =~ /^clang/
+ when "-fopenmp", "-lgomp"
+ args << arg if tool =~ /^llvm_clang/
when "--fast-math"
arg = "-ffast-math" if tool =~ /^clang/
args << arg
diff --git a/Library/Homebrew/shims/super/llvm_clang b/Library/Homebrew/shims/super/llvm_clang
new file mode 120000
index 000000000..2652f5f42
--- /dev/null
+++ b/Library/Homebrew/shims/super/llvm_clang
@@ -0,0 +1 @@
+cc \ No newline at end of file
diff --git a/Library/Homebrew/shims/super/llvm_clang++ b/Library/Homebrew/shims/super/llvm_clang++
new file mode 120000
index 000000000..2652f5f42
--- /dev/null
+++ b/Library/Homebrew/shims/super/llvm_clang++
@@ -0,0 +1 @@
+cc \ No newline at end of file