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 3ca01a8..751c2dd 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 2b1af35..e5afa2a 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 dbae44a..dc901d2 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 c8e144e..dd3a63d 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 9541908..d9e50d2 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 0ffd9ca..038a9bc 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*;
+};
+