aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/compilers.rb
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/compilers.rb
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/compilers.rb')
-rw-r--r--Library/Homebrew/compilers.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb
index fdfcab817..9ee847db0 100644
--- a/Library/Homebrew/compilers.rb
+++ b/Library/Homebrew/compilers.rb
@@ -3,9 +3,10 @@ module CompilerConstants
GNU_GCC_VERSIONS = %w[4.3 4.4 4.5 4.6 4.7 4.8 4.9 5 6 7].freeze
GNU_GCC_REGEXP = /^gcc-(4\.[3-9]|[5-7])$/
COMPILER_SYMBOL_MAP = {
- "gcc-4.0" => :gcc_4_0,
- "gcc-4.2" => :gcc,
- "clang" => :clang,
+ "gcc-4.0" => :gcc_4_0,
+ "gcc-4.2" => :gcc,
+ "clang" => :clang,
+ "llvm_clang" => :llvm_clang,
}.freeze
COMPILERS = COMPILER_SYMBOL_MAP.values +
@@ -86,7 +87,7 @@ class CompilerSelector
Compiler = Struct.new(:name, :version)
COMPILER_PRIORITY = {
- clang: [:clang, :gcc, :gnu, :gcc_4_0],
+ clang: [:clang, :gcc, :gnu, :gcc_4_0, :llvm_clang],
gcc: [:gcc, :gnu, :clang, :gcc_4_0],
gcc_4_0: [:gcc_4_0, :gcc, :gnu, :clang],
}.freeze