summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-mathematics/octave/files/octave-4.0.0-llvm-3.5.patch')
-rw-r--r--sci-mathematics/octave/files/octave-4.0.0-llvm-3.5.patch130
1 files changed, 130 insertions, 0 deletions
diff --git a/sci-mathematics/octave/files/octave-4.0.0-llvm-3.5.patch b/sci-mathematics/octave/files/octave-4.0.0-llvm-3.5.patch
new file mode 100644
index 000000000000..31b1bed74e2d
--- /dev/null
+++ b/sci-mathematics/octave/files/octave-4.0.0-llvm-3.5.patch
@@ -0,0 +1,130 @@
+diff -r 3797df921988 configure.ac
+--- a/configure.ac Wed Apr 29 17:09:24 2015 -0700
++++ b/configure.ac Sun May 03 22:48:56 2015 +0200
+@@ -815,8 +815,13 @@
+ AC_MSG_NOTICE([using -isystem for LLVM headers])])
+
+ dnl Use -isystem so we don't get warnings from llvm headers
+- LLVM_CPPFLAGS="$LLVM_INCLUDE_FLAG `$LLVM_CONFIG --includedir`"
+- LLVM_CXXFLAGS=
++ AX_CHECK_COMPILE_FLAG([-std=c++11],[
++ LLVM_CPPFLAGS="-std=c++11 $LLVM_INCLUDE_FLAG `$LLVM_CONFIG --includedir`"
++ LLVM_CXXFLAGS="-std=c++11"
++ ],[
++ LLVM_CPPFLAGS="$LLVM_INCLUDE_FLAG `$LLVM_CONFIG --includedir`"
++ LLVM_CXXFLAGS=
++ ])
+ LLVM_LDFLAGS="-L`$LLVM_CONFIG --libdir`"
+
+
+@@ -860,6 +865,8 @@
+ OCTAVE_LLVM_CALLINST_ADDATTRIBUTE_API
+ OCTAVE_LLVM_RAW_FD_OSTREAM_API
+ OCTAVE_LLVM_LEGACY_PASSMANAGER_API
++ OCTAVE_LLVM_DATALAYOUTPASS_API
++
+ AC_LANG_POP(C++)
+ CPPFLAGS="$save_CPPFLAGS"
+ CXXFLAGS="$save_CXXFLAGS"
+diff -r 3797df921988 libinterp/corefcn/jit-typeinfo.cc
+--- a/libinterp/corefcn/jit-typeinfo.cc Wed Apr 29 17:09:24 2015 -0700
++++ b/libinterp/corefcn/jit-typeinfo.cc Sun May 03 22:48:56 2015 +0200
+@@ -1208,7 +1208,7 @@
+ for (int op = 0; op < octave_value::num_binary_ops; ++op)
+ {
+ llvm::Twine fn_name ("octave_jit_binary_any_any_");
+- fn_name = fn_name + llvm::Twine (op);
++ fn_name.concat( llvm::Twine (op) );
+
+ fn = create_internal (fn_name, any, any, any);
+ fn.mark_can_error ();
+diff -r 3797df921988 libinterp/corefcn/pt-jit.cc
+--- a/libinterp/corefcn/pt-jit.cc Wed Apr 29 17:09:24 2015 -0700
++++ b/libinterp/corefcn/pt-jit.cc Sun May 03 22:48:56 2015 +0200
+@@ -59,6 +59,7 @@
+
+ #include <llvm/Bitcode/ReaderWriter.h>
+ #include <llvm/ExecutionEngine/ExecutionEngine.h>
++#include <llvm/ExecutionEngine/MCJIT.h>
+ #include <llvm/ExecutionEngine/JIT.h>
+
+ #ifdef LEGACY_PASSMANAGER
+@@ -83,6 +84,7 @@
+ #include <llvm/IRBuilder.h>
+ #endif
+
++#include <llvm/Support/FileSystem.h>
+ #include <llvm/Support/raw_os_ostream.h>
+ #include <llvm/Support/TargetSelect.h>
+
+@@ -2077,7 +2079,11 @@
+ module_pass_manager->add (llvm::createAlwaysInlinerPass ());
+
+ #ifdef HAVE_LLVM_DATALAYOUT
++#ifdef HAVE_LLVM_DATALAYOUTPASS
++ pass_manager->add (new llvm::DataLayoutPass (*engine->getDataLayout ()));
++#else
+ pass_manager->add (new llvm::DataLayout (*engine->getDataLayout ()));
++#endif
+ #else
+ pass_manager->add (new llvm::TargetData (*engine->getTargetData ()));
+ #endif
+@@ -2192,7 +2198,7 @@
+ std::string error;
+ #ifdef RAW_FD_OSTREAM_ARG_IS_LLVM_SYS_FS
+ llvm::raw_fd_ostream fout ("test.bc", error,
+- llvm::sys::fs::F_Binary);
++ llvm::sys::fs::F_Text);
+ #else
+ llvm::raw_fd_ostream fout ("test.bc", error,
+ llvm::raw_fd_ostream::F_Binary);
+diff -r 3797df921988 m4/acinclude.m4
+--- a/m4/acinclude.m4 Wed Apr 29 17:09:24 2015 -0700
++++ b/m4/acinclude.m4 Sun May 03 22:48:56 2015 +0200
+@@ -1784,10 +1784,11 @@
+ [AC_LANG_PUSH(C++)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
++ #include <llvm/Support/FileSystem.h>
+ #include <llvm/Support/raw_os_ostream.h>
+ ]], [[
+ std::string str;
+- llvm::raw_fd_ostream fout ("", str, llvm::sys::fs::F_Binary);
++ llvm::raw_fd_ostream fout ("", str, llvm::sys::fs::F_Text);
+ ]])],
+ octave_cv_raw_fd_ostream_arg_is_llvm_sys_fs=yes,
+ octave_cv_raw_fd_ostream_arg_is_llvm_sys_fs=no)
+@@ -1828,6 +1829,33 @@
+ fi
+ ])
+ dnl
++dnl Check for llvm::DataLayoutPass API
++dnl
++AC_DEFUN([OCTAVE_LLVM_DATALAYOUTPASS_API], [
++ AC_CACHE_CHECK([check for LLVM::DataLayoutPass],
++ [octave_cv_datalayoutpass],
++ [AC_LANG_PUSH(C++)
++ save_LIBS="$LIBS"
++ LIBS="$LLVM_LIBS $LIBS"
++ AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM([[
++ #include <llvm/IR/DataLayout.h>
++ ]], [[
++ llvm::Module *module;
++ llvm::DataLayoutPass *datalayoutpass;
++ datalayoutpass = new llvm::DataLayoutPass (module)
++ ]])],
++ octave_cv_datalayoutpass=yes,
++ octave_cv_datalayoutpass=no)
++ LIBS="$save_LIBS"
++ AC_LANG_POP(C++)
++ ])
++ if test $octave_cv_datalayoutpass = yes; then
++ AC_DEFINE(HAVE_LLVM_DATALAYOUTPASS, 1,
++ [Define to 1 if LLVM::DataLayoutPass exists.])
++ fi
++])
++dnl
+ dnl Check for ar.
+ dnl
+ AC_DEFUN([OCTAVE_PROG_AR], [