[libcxx-commits] [PATCH] D75243: [libc++] Build the dylib with C++17 to allow aligned new/delete

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 23 06:21:27 PDT 2020


ldionne added a comment.

In D75243#2168014 <https://reviews.llvm.org/D75243#2168014>, @dmajor wrote:

> In our builds with the 10.12 SDK and MACOSX_DEPLOYMENT_TARGET of 10.11, this is producing
>
>   [task 2020-07-22T21:52:27.615Z] /builds/worker/fetches/llvm-project/llvm/projects/libcxx/src/barrier.cpp:37:43: error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.14 or newer
>   [task 2020-07-22T21:52:27.615Z]         __state = unique_ptr<__state_t[]>(new __state_t[__count]);
>   [task 2020-07-22T21:52:27.615Z]                                           ^
>   [task 2020-07-22T21:52:27.615Z] /builds/worker/fetches/llvm-project/llvm/projects/libcxx/src/barrier.cpp:37:43: note: if you supply your own aligned allocation functions, use -faligned-allocation to silence this diagnostic
>
>
> Is that expected? How can I determine whether our builds supplies its own aligned allocation functions?


Hmmm. There's a few interesting things here. First, I'd like to understand why you're building the dylib with a deployment target of 10.11 -- we usually make the assumption that people building libc++ are vendors, and we take for granted that they're building for new-ish platforms. For example, at Apple, we only build the dylib for the latest OS because that's what the dylib is going into, so using an older deployment target just doesn't make sense. If you have another use case, it might be useful to know about it for the future.

Second, I think it should be fine to build the dylib with `-faligned-allocation` because the dylib itself provides the aligned allocation functions. This error is meant to be useful in user code that would be running on a system-built libc++.dylib that doesn't contain the aligned allocation functions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75243





More information about the libcxx-commits mailing list