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 <brecht@blender.org>2020-09-18 18:07:11 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-09-18 19:10:49 +0300
commit007e90e8c0a9176e16e70861d87dc7f883cc78ba (patch)
treefcb56c0e41de801d2334cae4a50fa71c90e62507 /build_files
parentff44429421a183b4749dc777df76dde168090a3f (diff)
Fix T78793, T79707: Cycles crash on macOS with older CPUs
Embree static libraries need additional linking flags to avoid SSE and AVX symbols getting mixed up.
Diffstat (limited to 'build_files')
-rw-r--r--build_files/cmake/Modules/FindEmbree.cmake2
-rw-r--r--build_files/cmake/platform/platform_apple.cmake10
2 files changed, 11 insertions, 1 deletions
diff --git a/build_files/cmake/Modules/FindEmbree.cmake b/build_files/cmake/Modules/FindEmbree.cmake
index 2b3cd8e20c4..bc82d5c333a 100644
--- a/build_files/cmake/Modules/FindEmbree.cmake
+++ b/build_files/cmake/Modules/FindEmbree.cmake
@@ -37,9 +37,9 @@ FIND_PATH(EMBREE_INCLUDE_DIR
SET(_embree_FIND_COMPONENTS
embree3
+ embree_sse42
embree_avx
embree_avx2
- embree_sse42
lexers
math
simd
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index 11628da39a7..6bcb3ef5d8c 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -392,6 +392,16 @@ endif()
if(WITH_CYCLES_EMBREE)
find_package(Embree 3.8.0 REQUIRED)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Xlinker -stack_size -Xlinker 0x100000")
+
+ # Embree static library linking can mix up SSE and AVX symbols, causing
+ # crashes on macOS systems with older CPUs that don't have AVX. Using
+ # force load avoids that. The Embree shared library does not suffer from
+ # this problem, precisely because linking a shared library uses force load.
+ set(_embree_libraries_force_load)
+ foreach(_embree_library ${EMBREE_LIBRARIES})
+ list(APPEND _embree_libraries_force_load "-Wl,-force_load,${_embree_library}")
+ endforeach()
+ set(EMBREE_LIBRARIES ${_embree_libraries_force_load})
endif()
if(WITH_OPENIMAGEDENOISE)