summaryrefslogtreecommitdiff
path: root/debian/patches/07_gcc-5.3.patch
blob: 23a516520692f79791101c6b22a7272803b143ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: Workaround GCC 5.3 issues.
 See:
  https://github.com/nothings/stb/issues/280
  https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1568899
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65612
 Compiler bug was fixed in 6.0
Author: David Yip <yipdw@member.fsf.org>
Origin: other, https://gitlab.peach-bun.com/pinion/SFML/commit/3383b4a472f0bd16a8161fb8760cd3e6333f1782

--- a/src/SFML/Graphics/CMakeLists.txt
+++ b/src/SFML/Graphics/CMakeLists.txt
@@ -148,6 +148,13 @@ add_definitions(-DSTBI_FAILURE_USERMSG)
 # when gcc is used; otherwise saving PNGs may crash in stb_image_write
 if(SFML_COMPILER_GCC)
     set_source_files_properties(${SRCROOT}/ImageLoader.cpp PROPERTIES COMPILE_FLAGS -fno-strict-aliasing)
+
+endif()
+
+# see https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1568899
+if(SFML_COMPILER_GCC AND BUILD_SHARED_LIBS)
+    message(WARNING "Applying workaround for https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1568899")
+    list(APPEND GRAPHICS_EXT_LIBS "-lgcc_s -lgcc")
 endif()
 
 # define the sfml-graphics target