[PATCH] D45015: [Preprocessor] Allow libc++ to detect when aligned allocation is unavailable.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 8 16:47:24 PDT 2018


vsapsai added a comment.

Sorry for the churn but can you please take out `-nostdinc++` part out of this change? After more thinking and discussion we think there is a chance developers can use `-nostdinc++` not only for building the standard library. `-nostdinc++` is a signal of building the standard library but it's not strong enough. Most likely developers will be unaware how `-nostdinc++` affects aligned allocations and that can lead to linker failures at runtime. So if you deploy on older macOS versions it is safer to assume aligned allocation isn't available. But if you provide your own libc++ with aligned allocations, you can still use `-faligned-allocation` to make that work. For now we prefer to use that approach and if it proves to be too onerous for developers, we can reintroduce `-nostdinc++` logic.

For building libc++ we rely on `_LIBCPP_BUILDING_NEW` to have support for aligned allocations even though the build host doesn't support them. So we don't need to change libc++ build.


https://reviews.llvm.org/D45015





More information about the cfe-commits mailing list