diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-09-13 11:34:41 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-09-13 11:38:42 +0300 |
commit | cca416cfe6c21ee9d0feb9d87995e505604b491e (patch) | |
tree | 3eae4def283cb01ec99c9275ff245d38990d63ba /build_files | |
parent | 146e67b2bde8edd2b53ec5d0a9a30fa4046b5724 (diff) |
Fix compilation on Linux, glibc 2.34, and CentOS libraries
A continuation of previous fix for malloc hooks which got removed
from the new glibc library.
The pre-compiled jemalloc has definitions which interpose hooks
in glibc leading to linking errors with multiple hook definitions.
A simple fix is to skip doing the workaround when using jemalloc
from pre-compiled libraries.
This will likely be revisited in the future, but for now it is
important to fix compilation errors for developers.
Diffstat (limited to 'build_files')
-rw-r--r-- | build_files/cmake/platform/platform_unix.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index c321da80649..f65fda83504 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -16,9 +16,16 @@ if(NOT DEFINED LIBDIR) # Choose the best suitable libraries. if(EXISTS ${LIBDIR_NATIVE_ABI}) set(LIBDIR ${LIBDIR_NATIVE_ABI}) + set(WITH_LIBC_MALLOC_HOOK_WORKAROUND True) elseif(EXISTS ${LIBDIR_CENTOS7_ABI}) set(LIBDIR ${LIBDIR_CENTOS7_ABI}) set(WITH_CXX11_ABI OFF) + if(WITH_MEM_JEMALLOC) + # jemalloc provides malloc hooks. + set(WITH_LIBC_MALLOC_HOOK_WORKAROUND False) + else() + set(WITH_LIBC_MALLOC_HOOK_WORKAROUND True) + endif() if(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.3) |