[libcxx-commits] [PATCH] D144994: [Draft][libc++][modules] Adds std module.

Aaron Siddhartha Mondal via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 19 23:29:29 PDT 2023


aaronmondal added a comment.

Started testing the Bazel build. Seems to almost build. The `__new` is a slight inconvenience, but easily worked around and there's nothing we can do about it.

Only `std:memory` doesn't build yet on my end.

I'm also noticing that this will place quite the significant restriction on the compiler building the modules. It's a bit unintuitive to build libc++ with C++20 and the interfaces/partitions with C++23. It's more intuitive to build the entire libc++ (sources) with C++23 (which works), but I'd assume that the only compiler capable of doing that at the moment upstream Clang itself 🤣



================
Comment at: libcxx/modules/CMakeLists.txt.in:48
+
+add_library(std)
+target_sources(std
----------------
aaronmondal wrote:
> ChuanqiXu wrote:
> > Mordante wrote:
> > > ChuanqiXu wrote:
> > > > I guess we need a better library name before landing this.
> > > What would you propose?
> > > I'm not even sure we really need to, but this is something to determine during a review.
> > > What would you propose?
> > 
> > I use `libstdmodule.a` in the downstream. But it looks not good enough for the upstream.
> > 
> > > I'm not even sure we really need to, but this is something to determine during a review.
> > 
> > Ideally this should be handled by cmake (or other build systems). But we need it now to make progress. How about something like 'libc++_std_module.a'?
> Don't have a strong opinion on this, though this will probably be painful to change once users adopt any name.
> 
> `libc++-std.a`, `lib++_std.a`? Though I personally think just `std` would be fine.
> 
> The `std.compat` archive should follow a similar scheme though.
I think I'm misunderstanding this target. What are the contents of this archive?


================
Comment at: libcxx/modules/std/memory.cppm:183-184
+
+  // [util.smartptr.atomic], atomic smart pointers
+  using std::atomic;
+
----------------
This seems to break the build for me with "no member atomic in namespace std". Where is this symbol coming from?

The `<atomic>` include is disabled for C++23. Maybe I'm just missing some config flag?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144994



More information about the libcxx-commits mailing list