Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-11-23 13:24:04 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-11-23 13:26:31 +0300
commit956e58679ce6f381e4f069ba6c0628dc145083c4 (patch)
tree6f02cd1d151dbeac56430384951e3b853ee63673 /build_files/cmake/macros.cmake
parentc66570f519fb24e0c3fb724d7b6d38f4b6fd7ffc (diff)
Fix T57998: crash at start with jemalloc package on some Linux distributions.
The jemalloc library must be ahead of pthread in linking order, so jemalloc can find the pthread symbols for its background thread.
Diffstat (limited to 'build_files/cmake/macros.cmake')
-rw-r--r--build_files/cmake/macros.cmake8
1 files changed, 5 insertions, 3 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 2b4d454a6a7..0143335d3b1 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -370,6 +370,11 @@ function(setup_liblinks
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE)
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE)
+ # jemalloc must be early in the list, to be before pthread (see T57998)
+ if(WITH_MEM_JEMALLOC)
+ target_link_libraries(${target} ${JEMALLOC_LIBRARIES})
+ endif()
+
target_link_libraries(
${target}
${PNG_LIBRARIES}
@@ -485,9 +490,6 @@ function(setup_liblinks
)
endif()
endif()
- if(WITH_MEM_JEMALLOC)
- target_link_libraries(${target} ${JEMALLOC_LIBRARIES})
- endif()
if(WITH_MOD_CLOTH_ELTOPO)
target_link_libraries(${target} ${LAPACK_LIBRARIES})
endif()