From 878644dc1086a748e96eafba759da3767e4eb054 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 27 Jul 2020 12:49:17 +0200 Subject: [PATCH] Apply upstream patch to fix build with GCC 10 --- .../patches/0002-Hide-internal-symbols.patch | 8 ++-- ...h-libm-and-libdl-to-fix-underlinking.patch | 4 +- ...-and-X-libraries-to-fix-underlinking.patch | 4 +- debian/patches/0006-Add-SONAME.patch | 4 +- ...-not-build-with-SSE2-enabled-on-i386.patch | 4 +- ...move-executable-bits-from-json-files.patch | 17 -------- debian/patches/0008-use-libsimde-dev.patch | 40 +++++++++++++++++++ ...0009-deps-glad-Fix-build-with-GCC-10.patch | 29 ++++++++++++++ debian/patches/0009-use-libsimde-dev.patch | 29 -------------- debian/patches/series | 4 +- 10 files changed, 83 insertions(+), 60 deletions(-) delete mode 100644 debian/patches/0008-rmtp-services-Remove-executable-bits-from-json-files.patch create mode 100644 debian/patches/0008-use-libsimde-dev.patch create mode 100644 debian/patches/0009-deps-glad-Fix-build-with-GCC-10.patch delete mode 100644 debian/patches/0009-use-libsimde-dev.patch diff --git a/debian/patches/0002-Hide-internal-symbols.patch b/debian/patches/0002-Hide-internal-symbols.patch index a2a7bfb..352e578 100644 --- a/debian/patches/0002-Hide-internal-symbols.patch +++ b/debian/patches/0002-Hide-internal-symbols.patch @@ -9,10 +9,10 @@ Subject: Hide internal symbols 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/deps/obs-scripting/CMakeLists.txt b/deps/obs-scripting/CMakeLists.txt -index 0421ec9..165b2d9 100644 +index 7dd316f..6a88b12 100644 --- a/deps/obs-scripting/CMakeLists.txt +++ b/deps/obs-scripting/CMakeLists.txt -@@ -193,6 +193,18 @@ add_library(obs-scripting SHARED +@@ -200,6 +200,18 @@ add_library(obs-scripting SHARED ${SWIG_LUA_RUNTIME} ) @@ -32,10 +32,10 @@ index 0421ec9..165b2d9 100644 libobs ${LUAJIT_LIBRARIES} diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt -index 84889e6..5ebd1eb 100644 +index 0b592d7..b59ba58 100644 --- a/libobs/CMakeLists.txt +++ b/libobs/CMakeLists.txt -@@ -481,6 +481,11 @@ target_compile_options(libobs +@@ -491,6 +491,11 @@ target_compile_options(libobs PUBLIC ${ARCH_SIMD_FLAGS}) diff --git a/debian/patches/0004-Link-with-libm-and-libdl-to-fix-underlinking.patch b/debian/patches/0004-Link-with-libm-and-libdl-to-fix-underlinking.patch index 5b96741..81476eb 100644 --- a/debian/patches/0004-Link-with-libm-and-libdl-to-fix-underlinking.patch +++ b/debian/patches/0004-Link-with-libm-and-libdl-to-fix-underlinking.patch @@ -7,10 +7,10 @@ Subject: Link with libm and libdl to fix underlinking 1 file changed, 5 insertions(+) diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt -index 5ebd1eb..21f3522 100644 +index b59ba58..a562a88 100644 --- a/libobs/CMakeLists.txt +++ b/libobs/CMakeLists.txt -@@ -234,6 +234,11 @@ elseif(UNIX) +@@ -244,6 +244,11 @@ elseif(UNIX) ${PULSEAUDIO_LIBRARY}) endif() diff --git a/debian/patches/0005-Link-with-xcb-and-X-libraries-to-fix-underlinking.patch b/debian/patches/0005-Link-with-xcb-and-X-libraries-to-fix-underlinking.patch index d6d97ee..47b393f 100644 --- a/debian/patches/0005-Link-with-xcb-and-X-libraries-to-fix-underlinking.patch +++ b/debian/patches/0005-Link-with-xcb-and-X-libraries-to-fix-underlinking.patch @@ -7,7 +7,7 @@ Subject: Link with xcb and X libraries to fix underlinking 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt -index 21f3522..bfb74f3 100644 +index a562a88..8f12482 100644 --- a/libobs/CMakeLists.txt +++ b/libobs/CMakeLists.txt @@ -13,8 +13,8 @@ endif() @@ -21,7 +21,7 @@ index 21f3522..bfb74f3 100644 if (XCB_XINPUT_FOUND) set(USE_XINPUT "1") else() -@@ -211,12 +211,17 @@ elseif(UNIX) +@@ -221,12 +221,17 @@ elseif(UNIX) endif() include_directories( diff --git a/debian/patches/0006-Add-SONAME.patch b/debian/patches/0006-Add-SONAME.patch index 1622547..a9f15df 100644 --- a/debian/patches/0006-Add-SONAME.patch +++ b/debian/patches/0006-Add-SONAME.patch @@ -7,10 +7,10 @@ Subject: Add SONAME 1 file changed, 5 insertions(+) diff --git a/deps/obs-scripting/CMakeLists.txt b/deps/obs-scripting/CMakeLists.txt -index 165b2d9..506abf2 100644 +index 6a88b12..a86262e 100644 --- a/deps/obs-scripting/CMakeLists.txt +++ b/deps/obs-scripting/CMakeLists.txt -@@ -205,6 +205,11 @@ if(UNIX) +@@ -212,6 +212,11 @@ if(UNIX) PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") endif() diff --git a/debian/patches/0007-Do-not-build-with-SSE2-enabled-on-i386.patch b/debian/patches/0007-Do-not-build-with-SSE2-enabled-on-i386.patch index 539a0c0..bc138af 100644 --- a/debian/patches/0007-Do-not-build-with-SSE2-enabled-on-i386.patch +++ b/debian/patches/0007-Do-not-build-with-SSE2-enabled-on-i386.patch @@ -7,10 +7,10 @@ Subject: Do not build with SSE2 enabled on i386 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5ea2c5f..95b49b4 100644 +index b56c2bb..1dabd39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -113,7 +113,7 @@ else () +@@ -118,7 +118,7 @@ else () string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_SYSTEM_PROCESSOR) endif () diff --git a/debian/patches/0008-rmtp-services-Remove-executable-bits-from-json-files.patch b/debian/patches/0008-rmtp-services-Remove-executable-bits-from-json-files.patch deleted file mode 100644 index a69ed19..0000000 --- a/debian/patches/0008-rmtp-services-Remove-executable-bits-from-json-files.patch +++ /dev/null @@ -1,17 +0,0 @@ -From: Sebastian Ramacher -Date: Wed, 25 Mar 2020 21:58:13 +0100 -Subject: rmtp-services: Remove executable bits from json files - ---- - plugins/rtmp-services/data/package.json | 0 - plugins/rtmp-services/data/services.json | 0 - 2 files changed, 0 insertions(+), 0 deletions(-) - mode change 100755 => 100644 plugins/rtmp-services/data/package.json - mode change 100755 => 100644 plugins/rtmp-services/data/services.json - -diff --git a/plugins/rtmp-services/data/package.json b/plugins/rtmp-services/data/package.json -old mode 100755 -new mode 100644 -diff --git a/plugins/rtmp-services/data/services.json b/plugins/rtmp-services/data/services.json -old mode 100755 -new mode 100644 diff --git a/debian/patches/0008-use-libsimde-dev.patch b/debian/patches/0008-use-libsimde-dev.patch new file mode 100644 index 0000000..a9291be --- /dev/null +++ b/debian/patches/0008-use-libsimde-dev.patch @@ -0,0 +1,40 @@ +From: "Michael R. Crusoe" +Date: Mon, 27 Jul 2020 12:46:48 +0200 +Subject: Use the simd everywhere headers from libsimde-dev + +--- + libobs/CMakeLists.txt | 7 ------- + libobs/util/sse-intrin.h | 2 +- + 2 files changed, 1 insertion(+), 8 deletions(-) + +diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt +index 8f12482..d42702f 100644 +--- a/libobs/CMakeLists.txt ++++ b/libobs/CMakeLists.txt +@@ -186,13 +186,6 @@ elseif(UNIX) + + if(NEEDS_SIMDE) + set(libobs_PLATFORM_HEADERS +- util/simde/check.h +- util/simde/hedley.h +- util/simde/mmx.h +- util/simde/simde-arch.h +- util/simde/simde-common.h +- util/simde/sse.h +- util/simde/sse2.h + util/threading-posix.h) + else() + set(libobs_PLATFORM_HEADERS +diff --git a/libobs/util/sse-intrin.h b/libobs/util/sse-intrin.h +index 8136c92..bde2029 100644 +--- a/libobs/util/sse-intrin.h ++++ b/libobs/util/sse-intrin.h +@@ -19,7 +19,7 @@ + + #if NEEDS_SIMDE + +-#include "simde/sse2.h" ++#include + + #define __m128 simde__m128 + #define _mm_setzero_ps simde_mm_setzero_ps diff --git a/debian/patches/0009-deps-glad-Fix-build-with-GCC-10.patch b/debian/patches/0009-deps-glad-Fix-build-with-GCC-10.patch new file mode 100644 index 0000000..27c0433 --- /dev/null +++ b/debian/patches/0009-deps-glad-Fix-build-with-GCC-10.patch @@ -0,0 +1,29 @@ +From: Jimi Huotari +Date: Sun, 9 Feb 2020 05:23:55 +0200 +Subject: deps/glad: Fix build with GCC-10 + +GCC-10 defaults to '-fno-common' [1], which triggers issues with +defining global variables multiple times. To fix the build, use +'extern' to turn the first definition of 'gladGetProcAddressPtr' +into a declaration. + +1. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85678 + +Closes https://github.com/obsproject/obs-studio/issues/2828 +--- + deps/glad/src/glad_glx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/deps/glad/src/glad_glx.c b/deps/glad/src/glad_glx.c +index 7c55b9f..58086f1 100644 +--- a/deps/glad/src/glad_glx.c ++++ b/deps/glad/src/glad_glx.c +@@ -35,7 +35,7 @@ static void* libGL; + + #ifndef __APPLE__ + typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*); +-PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; ++extern PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; + #endif + + static diff --git a/debian/patches/0009-use-libsimde-dev.patch b/debian/patches/0009-use-libsimde-dev.patch deleted file mode 100644 index 1a27581..0000000 --- a/debian/patches/0009-use-libsimde-dev.patch +++ /dev/null @@ -1,29 +0,0 @@ -Author: Michael R. Crusoe -Subject: Use the simd everywhere headers from libsimde-dev ---- obs-studio.orig/libobs/util/sse-intrin.h -+++ obs-studio/libobs/util/sse-intrin.h -@@ -19,7 +19,7 @@ - - #if NEEDS_SIMDE - --#include "simde/sse2.h" -+#include - - #define __m128 simde__m128 - #define _mm_setzero_ps simde_mm_setzero_ps ---- obs-studio.orig/libobs/CMakeLists.txt -+++ obs-studio/libobs/CMakeLists.txt -@@ -186,13 +186,6 @@ - - if(NEEDS_SIMDE) - set(libobs_PLATFORM_HEADERS -- util/simde/check.h -- util/simde/hedley.h -- util/simde/mmx.h -- util/simde/simde-arch.h -- util/simde/simde-common.h -- util/simde/sse.h -- util/simde/sse2.h - util/threading-posix.h) - else() - set(libobs_PLATFORM_HEADERS diff --git a/debian/patches/series b/debian/patches/series index 5588b63..d572bc5 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -5,5 +5,5 @@ 0005-Link-with-xcb-and-X-libraries-to-fix-underlinking.patch 0006-Add-SONAME.patch 0007-Do-not-build-with-SSE2-enabled-on-i386.patch -0008-rmtp-services-Remove-executable-bits-from-json-files.patch -0009-use-libsimde-dev.patch +0008-use-libsimde-dev.patch +0009-deps-glad-Fix-build-with-GCC-10.patch