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.
This commit is contained in:
@@ -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 "${CMAKE_MODULE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE)
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" 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_link_libraries(
|
||||||
${target}
|
${target}
|
||||||
${PNG_LIBRARIES}
|
${PNG_LIBRARIES}
|
||||||
@@ -485,9 +490,6 @@ function(setup_liblinks
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(WITH_MEM_JEMALLOC)
|
|
||||||
target_link_libraries(${target} ${JEMALLOC_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
if(WITH_MOD_CLOTH_ELTOPO)
|
if(WITH_MOD_CLOTH_ELTOPO)
|
||||||
target_link_libraries(${target} ${LAPACK_LIBRARIES})
|
target_link_libraries(${target} ${LAPACK_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
Reference in New Issue
Block a user