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:
authorStefan Werner <stewreo@gmail.com>2020-11-26 14:22:56 +0300
committerStefan Werner <stewreo@gmail.com>2020-11-26 14:22:56 +0300
commit0062b34e9413631cecf992af6fde146a5ddcf866 (patch)
treef3c399468ddcfd6caabb7136b8d3a3aabbd1d95e /build_files/build_environment
parent05f410dd849eb2cb46648ef4197386ae7f52d32c (diff)
macOS: Patch OpenImageIO's ustring for ARM.
OpenImageIO's ustring makes assumptions about the interals of std::string which aren't true on macOS/ARM. A patch for OpenImageIO addresses this for macOS/ARM builds only, at the expense of potentially duplicated allocations of strings.
Diffstat (limited to 'build_files/build_environment')
-rw-r--r--build_files/build_environment/patches/openimageio.diff21
1 files changed, 21 insertions, 0 deletions
diff --git a/build_files/build_environment/patches/openimageio.diff b/build_files/build_environment/patches/openimageio.diff
index d05fc1f295f..9db037db288 100644
--- a/build_files/build_environment/patches/openimageio.diff
+++ b/build_files/build_environment/patches/openimageio.diff
@@ -34,3 +34,24 @@ diff -Naur orig/src/include/OpenImageIO/platform.h external_openimageio/src/incl
# include <windows.h>
#endif
+diff -Naur orig/src/libutil/ustring.cpp external_openimageio/src/libutil/ustring.cpp
+--- orig/src/libutil/ustring.cpp 2020-05-11 05:43:52.000000000 +0200
++++ external_openimageio/src/libutil/ustring.cpp 2020-11-26 12:06:08.000000000 +0100
+@@ -337,6 +337,8 @@
+ // the std::string to make it point to our chars! In such a case, the
+ // destructor will be careful not to allow a deallocation.
+
++ // Disable internal std::string for Apple silicon based Macs
++#if !(defined(__APPLE__) && defined(__arm64__))
+ #if defined(__GNUC__) && !defined(_LIBCPP_VERSION) \
+ && defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI
+ // NEW gcc ABI
+@@ -382,7 +384,7 @@
+ return;
+ }
+ #endif
+-
++#endif
+ // Remaining cases - just assign the internal string. This may result
+ // in double allocation for the chars. If you care about that, do
+ // something special for your platform, much like we did for gcc and \ No newline at end of file