Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3ac5902

Browse files
committedMar 26, 2016
Begin support for LLVM 3.6+.
1 parent 93228c4 commit 3ac5902

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+202
-710
lines changed
 

‎.travis.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ before_install:
1111
- echo $LANG
1212
- echo $LC_ALL
1313
- if [ $TRAVIS_OS_NAME == linux ]; then ./scripts/llvm.sh; fi
14-
- if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install llvm35 && brew link --force llvm35; fi
14+
- if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install llvm; fi
1515
- gem update --system
1616
- gem --version
1717
before_script:
1818
- travis_retry bundle
19-
- ./configure
19+
if [ $TRAVIS_OS_NAME == linux ]; then travis_retry ./configure --llvm-config=llvm-config-3.6; fi
20+
if [ $TRAVIS_OS_NAME == osx ]; then travis_retry ./configure; fi
2021
script: rake ci
2122
after_success:
2223
- if [ $TRAVIS_BRANCH == $TRAVIS_TAG ]; then ./scripts/deploy.sh release github website triggers; fi

‎configure

+12-30
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ class Configure
5858
@gem = nil
5959

6060
# LLVM settings
61-
@llvm_enabled = true
6261
@llvm_path = nil
6362
@llvm_system_name = get_system_name
6463
@llvm_configure = nil
@@ -336,10 +335,6 @@ class Configure
336335

337336
o.doc "\n LLVM settings"
338337

339-
o.on "--disable-llvm", "Don't build with LLVM" do
340-
@llvm_enabled = false
341-
end
342-
343338
o.on "--system-name", "NAME", "Name of OS (eg fedora-8, ubuntu-10.04)" do |name|
344339
@llvm_system_name = name
345340
end
@@ -565,11 +560,6 @@ class Configure
565560
end
566561

567562
def setup_llvm
568-
unless @llvm_enabled
569-
@log.write "WARNING: LLVM disabled."
570-
return false
571-
end
572-
573563
@log.print " Checking for 'llvm-config': "
574564

575565
config = @llvm_configure
@@ -583,8 +573,8 @@ class Configure
583573
if macports?
584574
config = macports_llvm_config
585575
else
586-
out = Bundler.with_clean_env { `brew --prefix llvm35` }.chomp
587-
config = "#{out}/bin/llvm-config-3.5" if $?.success?
576+
out = Bundler.with_clean_env { `brew --prefix llvm` }.chomp
577+
config = "#{out}/bin/llvm-config" if $?.success?
588578
end
589579
end
590580
end
@@ -604,8 +594,8 @@ class Configure
604594
unless failed
605595
parts = version.sub(/svn$/, "").split(".").map { |i| i.to_i }
606596
api_version = ("%d%02d" % parts[0..1]).to_i
607-
if api_version < 300 or api_version > 305
608-
@log.write "only LLVM 3.0-3.5 is supported"
597+
if api_version < 306
598+
@log.write "only LLVM 3.6+ is supported"
609599
else
610600
@log.write "found! (version #{version} - api: #{api_version})"
611601
@llvm = :config
@@ -666,19 +656,16 @@ int main() { LLVMContext &Context = getGlobalContext(); }
666656
def check_llvm_flags
667657
flags = '--ldflags'
668658

669-
if @llvm_api_version >= 305
670-
# Starting with LLVM 3.5 the --system-libs option is required in order to
671-
# link against libraries such as zlib. Prior to 3.5 this was handled by
672-
# --ldflags.
673-
flags << ' --system-libs'
674-
end
659+
@llvm_cxxflags << " -std=c++11"
660+
661+
# Starting with LLVM 3.5 the --system-libs option is required in order to
662+
# link against libraries such as zlib. Prior to 3.5 this was handled by
663+
# --ldflags.
664+
flags << ' --system-libs'
675665

676666
# Generate the actual flags. For whatever reason llvm-config also includes
677667
# newlines in the output, so lets get rid of those while we're at it.
678668
@llvm_ldflags = `#{@llvm_configure} #{flags}`.strip.gsub("\n", ' ')
679-
680-
# We use some C++11 features in the VM source, so we need to enable support.
681-
@llvm_cxxflags << " -std=c++11"
682669
end
683670

684671
def env(which)
@@ -717,7 +704,7 @@ int main() { LLVMContext &Context = getGlobalContext(); }
717704
check_tool_version @cc, '-dumpversion', [4, 1]
718705
check_tool_version @cxx, '-dumpversion', [4, 1]
719706

720-
unless @cc == "clang" and @cxx == "clang++"
707+
unless @cc =~ /clang/ and @cxx =~ /clang\+\+/
721708
@log.deprecated <<-EOM
722709
Support for compilers other than clang/clang++ is deprecated and will be
723710
removed soon. If your platform does not have support for clang/clang++,
@@ -1532,10 +1519,6 @@ int main() { return tgetnum(""); }
15321519
def write_configure_files
15331520
@log.write "\nWriting configuration files..."
15341521

1535-
unless @llvm_enabled
1536-
@llvm_configure = ""
1537-
end
1538-
15391522
@bin_links.delete @program_name
15401523

15411524
config_settings = {
@@ -1544,7 +1527,6 @@ int main() { return tgetnum(""); }
15441527
:build_make => @make,
15451528
:build_rake => @rake,
15461529
:build_perl => @perl,
1547-
:llvm_enabled => @llvm_enabled,
15481530
:llvm_path => @llvm_path,
15491531
:llvm_system_name => @llvm_system_name,
15501532
:llvm_configure => @llvm_configure,
@@ -2073,7 +2055,7 @@ Available commands are:
20732055
# Query MacPorts for the path to the latest installed version of
20742056
# llvm-config that is within the range of supported LLVM versions.
20752057
def macports_llvm_config
2076-
supported_versions = (3.0 .. 3.5)
2058+
supported_versions = (3.6..3.9)
20772059
installed_ports = `port installed | egrep -o 'llvm-[^ ]+'`.split
20782060
latest_usable_port = installed_ports.sort.select do |fname|
20792061
version = fname.match(/-\K.*/)[0].to_f

0 commit comments

Comments
 (0)