[libcxx-commits] [PATCH] D90178: [SystemZ][ZOS] libcxx - no posix memalign

Zbigniew Sarbinowski via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 29 12:27:30 PDT 2020


zibi updated this revision to Diff 301709.
zibi added a comment.
Herald added a subscriber: mgorny.

Unfortunately we need one more change on z/OS specially for the shared build.
The `-fno-aligned-allocation` is required to avoid using aligned allocations otherwise, `__cpp_aligned_new` is defined to  201606L and we result with unresolved symbols.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90178/new/

https://reviews.llvm.org/D90178

Files:
  libcxx/CMakeLists.txt
  libcxx/include/__config


Index: libcxx/include/__config
===================================================================
--- libcxx/include/__config
+++ libcxx/include/__config
@@ -936,6 +936,8 @@
    // We're deferring to Microsoft's STL to provide aligned new et al. We don't
    // have it unless the language feature test macro is defined.
 #  define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
+#elif defined(__MVS__)
+#  define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
 #endif
 
 #if defined(__APPLE__)
Index: libcxx/CMakeLists.txt
===================================================================
--- libcxx/CMakeLists.txt
+++ libcxx/CMakeLists.txt
@@ -514,8 +514,12 @@
 
   # When building the dylib, don't warn for unavailable aligned allocation
   # functions based on the deployment target -- they are always available
-  # because they are provided by the dylib itself.
-  target_add_compile_flags_if_supported(${target} PRIVATE -faligned-allocation)
+  # because they are provided by the dylib itself with the excepton of z/OS.
+  if (ZOS)
+    target_add_compile_flags_if_supported(${target} PRIVATE -fno-aligned-allocation)
+  else()
+    target_add_compile_flags_if_supported(${target} PRIVATE -faligned-allocation)
+  endif()
 
   # On all systems the system c++ standard library headers need to be excluded.
   # MSVC only has -X, which disables all default includes; including the crt.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90178.301709.patch
Type: text/x-patch
Size: 1384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201029/b6ffba8e/attachment.bin>


More information about the libcxx-commits mailing list