This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ][ZOS] libcxx - no posix memalign
ClosedPublic

Authored by zibi on Oct 26 2020, 11:12 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rGaa8a5b800def: [SystemZ][ZOS] libcxx - no posix memalign
Summary

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.

Diff Detail

Event Timeline

zibi created this revision.Oct 26 2020, 11:12 AM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald TranscriptOct 26 2020, 11:12 AM
zibi requested review of this revision.Oct 26 2020, 11:12 AM
ldionne accepted this revision.Oct 28 2020, 12:34 PM
This revision is now accepted and ready to land.Oct 28 2020, 12:34 PM
zibi updated this revision to Diff 301709.Oct 29 2020, 12:27 PM

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.

zibi added a comment.Nov 5 2020, 6:29 AM

@ldionne Louis, are you ok, with new addition added after your approval?

zibi updated this revision to Diff 304881.Nov 12 2020, 10:02 AM

resubmitting to get CI result and revalidating acceptance from @ldionne

This revision was automatically updated to reflect the committed changes.
ldionne reopened this revision.Nov 20 2020, 11:59 AM

@ldionne Louis, are you ok, with new addition added after your approval?

Sorry, but no I'm not. Let's not revert and talk.

libcxx/CMakeLists.txt
525

Can you explain why you need this? IOW, what issue are you seeing if you use -faligned-allocation?

This revision is now accepted and ready to land.Nov 20 2020, 11:59 AM
zibi marked an inline comment as done.Nov 20 2020, 12:06 PM
zibi added inline comments.
libcxx/CMakeLists.txt
525

I'm seeing unresolved symbols to align version of operator new preventing from linking.

zibi marked an inline comment as done.Nov 20 2020, 12:18 PM

My understanding is that we don't want to disable -faligned-allocation since users might provide the required operator new/delete.
There is another related option -faligned-alloc-unavailable which we made active for z/OS but the library explicit tramps it in cmake configuration. .

zibi closed this revision.Nov 20 2020, 1:22 PM

This already landed on Nov 12, 2020.