Fix 33149: LLVM caused startup crash on linux systems using Mesa llvmpipe.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 21 Nov 2012 22:28:15 +0000 (22:28 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 21 Nov 2012 22:28:15 +0000 (22:28 +0000)
Now we hide the LLVM symbols with an ld version script to avoid conflicts.

CMakeLists.txt
build_files/buildbot/config/user-config-glibc211-i686.py
build_files/buildbot/config/user-config-glibc211-x86_64.py
build_files/buildbot/config/user-config-glibc27-i686.py
build_files/buildbot/config/user-config-glibc27-x86_64.py
build_files/scons/config/linux-config.py
source/creator/blender.map [new file with mode: 0644]

index 3ca01a8a28b400271aef4335ddb3842d3e7a1972..751c2dd548ec50d94019084a81e7ade6d2d1cde8 100644 (file)
@@ -759,6 +759,9 @@ if(UNIX AND NOT APPLE)
                else()
                        message(FATAL_ERROR "LLVM not found.")
                endif()
+
+               # Fix for conflict with Mesa llvmpipe
+               set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--version-script=${CMAKE_SOURCE_DIR}/source/creator/blender.map")
        endif()
 
        if(WITH_CYCLES_OSL)
@@ -821,7 +824,7 @@ if(UNIX AND NOT APPLE)
                endif()
        endif()
 
-       set(PLATFORM_LINKFLAGS "-pthread")
+       set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -pthread")
 
        # lfs on glibc, all compilers should use
        add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
index 2b1af3567733e0a0f162adeef3699774a08e2e64..e5afa2afe13ec93ec6640aac534dbf3e37a90c41 100644 (file)
@@ -162,4 +162,4 @@ WITH_BF_OCEANSIM = True
 BF_DEBUG = False
 REL_CCFLAGS = ['-O2', '-msse', '-msse2']  # C & C++
 PLATFORM_LINKFLAGS = ['-lrt']
-BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive']
+BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']
index dbae44af66f680bb4d0e3e31f47647a366eeb572..dc901d25a92303e5443603a1acb31f6539c46b42 100644 (file)
@@ -161,4 +161,4 @@ WITH_BF_OCEANSIM = True
 BF_DEBUG = False
 REL_CCFLAGS = ['-O2', '-msse', '-msse2']  # C & C++
 PLATFORM_LINKFLAGS = ['-lrt']
-BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive']
+BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']
index c8e144e8a7f0bd550f58171f2b04bdfe87ff5e58..dd3a63d0fd737253a303a0532a36608a3b0e2155 100644 (file)
@@ -147,4 +147,4 @@ WITH_BF_OCEANSIM = True
 BF_DEBUG = False
 REL_CCFLAGS = ['-O2']  # C & C++
 PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib32']
-BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive']
+BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']
index 9541908d4ed9800dbe889e41b4cd181ed5064ef1..d9e50d258bce403c1a06c406f2f13c21fc4878d9 100644 (file)
@@ -146,4 +146,4 @@ WITH_BF_OCEANSIM = True
 BF_DEBUG = False
 REL_CCFLAGS = ['-O2', '-msse', '-msse2']  # C & C++
 PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib64']
-BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive']
+BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']
index 0ffd9ca9cc649247986e37b5a81e56d52b49bea2..038a9bc421d1022d2b0331852cda5c2e7d41238b 100644 (file)
@@ -298,3 +298,7 @@ BF_INSTALLDIR='../install/linux'
 #Link against pthread
 PLATFORM_LINKFLAGS = ['-pthread']
 
+#Fix for LLVM conflict with Mesa llvmpipe
+if WITH_BF_LLVM:
+    PLATFORM_LINKFLAGS += ['-Wl,--version-script=source/creator/blender.map']
+
diff --git a/source/creator/blender.map b/source/creator/blender.map
new file mode 100644 (file)
index 0000000..dc7bc31
--- /dev/null
@@ -0,0 +1,11 @@
+
+/* on Linux we exclude LLVM symbols, they conflict with Mesa llvmpipe */
+
+{
+global:
+       *;
+local:
+       *llvm*;
+       *LLVM*;
+};
+