[libcxx-commits] [libcxx] aa8a5b8 - [SystemZ][ZOS] libcxx - no posix memalign

Abhina Sreeskantharajan via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 12 11:48:05 PST 2020


Author: Zbigniew Sarbinowski
Date: 2020-11-12T14:47:58-05:00
New Revision: aa8a5b800defc7a5b2609fd23eadf656eff143de

URL: https://github.com/llvm/llvm-project/commit/aa8a5b800defc7a5b2609fd23eadf656eff143de
DIFF: https://github.com/llvm/llvm-project/commit/aa8a5b800defc7a5b2609fd23eadf656eff143de.diff

LOG: [SystemZ][ZOS] libcxx - no posix memalign

The unavailability of posix_memalign on z/OS forces us to define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION'. The use of posix_memalign is being used in libcxx/src/new.cpp.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D90178

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 9d01b17721ac..8e0864c21db5 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -521,8 +521,12 @@ function(cxx_add_basic_build_flags target)
 
   # 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.

diff  --git a/libcxx/include/__config b/libcxx/include/__config
index a85c074528a1..8c361b4a10d0 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -943,6 +943,8 @@ typedef unsigned int   char32_t;
    // 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__)


        


More information about the libcxx-commits mailing list