commit 519df3df2478b01167f6563c586e17f07a423949
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Fri Jan 19 09:13:45 2018 +0000
Fix llvm-5 build issue
lightspark.spec | 4 ++-
llvm5.patch | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 97 insertions(+), 1 deletion(-)
---
diff --git a/lightspark.spec b/lightspark.spec
index 9051499..ebfdab7 100644
--- a/lightspark.spec
+++ b/lightspark.spec
@@ -34,6 +34,8 @@ Source0:
https://github.com/lightspark/lightspark/archive/%{name}-%{versi
%endif
Patch0: lightspark-0.7.2-fix_ffmpeg_include_dir.patch
+# Patch based on
https://github.com/lightspark/lightspark/commit/1f6a694b17db9631e13caa32b...
+Patch1: llvm5.patch
# Build fails on ppc64 and ppc64le, temporarily disable them
#
https://github.com/lightspark/lightspark/issues/283
@@ -99,7 +101,7 @@ This is the Chromium compatible plugin for %{name}.
%setup -q -n %{name}-%{name}-%{version}
%endif
%patch0 -p1 -b .ffmpeg-include-dir
-
+%patch1 -p1 -b .llvm5
%build
%cmake -DPLUGIN_DIRECTORY="%{_libdir}/mozilla/plugins" \
diff --git a/llvm5.patch b/llvm5.patch
new file mode 100644
index 0000000..964b21c
--- /dev/null
+++ b/llvm5.patch
@@ -0,0 +1,94 @@
+From 1f6a694b17db9631e13caa32b58778d1812dd27b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ludger=20Kr=C3=A4mer?= <dbluelle(a)onlinehome.de>
+Date: Sun, 17 Sep 2017 11:18:55 +0200
+Subject: [PATCH] fix compilation with llvm 5.0 fixes
+
https://github.com/lightspark/lightspark/issues/308
+
+---
+ CMakeLists.txt | 3 +++
+ conf/FindLLVM.cmake | 47 ++++--------------------------------------
+ src/scripting/abc_codesynt.cpp | 6 +++++-
+ 3 files changed, 12 insertions(+), 44 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fa0305196..dab5e8aac 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -248,6 +248,9 @@ ENDIF(NOT ${LLVM_STRING_VERSION} VERSION_LESS 3.7)
+ IF(NOT ${LLVM_STRING_VERSION} VERSION_LESS 3.8)
+ ADD_DEFINITIONS(-DLLVM_38)
+ ENDIF(NOT ${LLVM_STRING_VERSION} VERSION_LESS 3.8)
++IF(NOT ${LLVM_STRING_VERSION} VERSION_LESS 5.0)
++ ADD_DEFINITIONS(-DLLVM_50)
++ENDIF(NOT ${LLVM_STRING_VERSION} VERSION_LESS 5.0)
+ INCLUDE(FindZLIB REQUIRED)
+ INCLUDE(FindFreetype REQUIRED)
+ IF(NOT(ENABLE_GLES2))
+diff --git a/conf/FindLLVM.cmake b/conf/FindLLVM.cmake
+index 4af70a070..ad08c2f27 100644
+--- a/conf/FindLLVM.cmake
++++ b/conf/FindLLVM.cmake
+@@ -41,24 +41,14 @@
+ if (LLVM_INCLUDE_DIR)
+ set(LLVM_FOUND TRUE)
+ else (LLVM_INCLUDE_DIR)
+-
++ file(GLOB LLVM_SEARCHPATHS /usr/lib/llvm*/bin)
+ find_program(LLVM_CONFIG_EXECUTABLE
+ NAMES llvm-config
+ PATHS
+ /opt/local/bin
+ /opt/llvm/2.7/bin
+ /opt/llvm/bin
+- /usr/lib/llvm-2.7/bin
+- /usr/lib/llvm-2.8/bin
+- /usr/lib/llvm-2.9/bin
+- /usr/lib/llvm-3.0/bin
+- /usr/lib/llvm-3.1/bin
+- /usr/lib/llvm-3.2/bin
+- /usr/lib/llvm-3.3/bin
+- /usr/lib/llvm-3.4/bin
+- /usr/lib/llvm-3.5/bin
+- /usr/lib/llvm-3.6/bin
+- /usr/lib/llvm-3.7/bin
++ ${LLVM_SEARCHPATHS}
+ )
+
+ find_program(LLVM_GCC_EXECUTABLE
+@@ -68,7 +58,7 @@
+ /opt/llvm/2.7/bin
+ /opt/llvm/bin
+ /Developer/usr/bin
+- /usr/lib/llvm-2.7/bin
++ ${LLVM_SEARCHPATHS}
+ )
+
+ find_program(LLVM_GXX_EXECUTABLE
+@@ -78,8 +68,7 @@
+ /opt/llvm/2.7/bin
+ /opt/llvm/bin
+ /Developer/usr/bin
+- /usr/lib/llvm/llvm/gcc-4.2/bin
+- /usr/lib/llvm-2.7/bin
++ ${LLVM_SEARCHPATHS}
+ )
+
+ if(LLVM_GCC_EXECUTABLE)
+
+diff --git a/src/scripting/abc_codesynt.cpp b/src/scripting/abc_codesynt.cpp
+index a613da56f..7e52c1dd5 100644
+--- a/src/scripting/abc_codesynt.cpp
++++ b/src/scripting/abc_codesynt.cpp
+@@ -1901,7 +1901,11 @@ SyntheticFunction::synt_function
method_info::synt_method(SystemState* sys)
+ constant = llvm::ConstantInt::get(ptr_type, (uintptr_t)this);
+ llvm::Value* th = llvm::ConstantExpr::getIntToPtr(constant, voidptr_type);
+
+- llvm::Function::ArgumentListType::iterator it=llvmf->getArgumentList().begin();
++#ifdef LLVM_50
++ auto it=llvmf->arg_begin();
++#else
++ auto it=llvmf->getArgumentList().begin();
++#endif
+ //The first and only argument to this function is the call_context*
+ #ifdef LLVM_38
+ llvm::Value* context=&(*it);