[libcxx-commits] [PATCH] D120348: [libcxx][SystemZ][ POSIX(OFF) support on z/OS

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 16 11:43:51 PDT 2022


ldionne added inline comments.


================
Comment at: libcxx/src/include/internal_threading_support.h:76
+}
+
+static inline bool __libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t* __m) {
----------------
DanielMcIntosh-IBM wrote:
> zibi wrote:
> > EricWF wrote:
> > > Why not just use weak functions to allow different definitions, which can live outside of mainline libc++, to be shimmed in at link/load time? 
> > We will have to experiment to see if that is even fisible.
> z/OS has very limited and weak support (no pun intended) for weak linking. It really only works if both definitions are visible at link time, and neither is coming from a shared library.
> 
> During the link stage, z/OS will prioritize symbols from object/source files and such over shared libraries, regardless of whether they've been declared as weak definitions. Furthermore, when searching for a symbol in shared libraries, z/OS uses "Side decks" to determine which shared libraries provide which symbols. Side decks do not record information about whether a symbol is weak, so it's impossible to weakly export a symbol from a shared library.
Does this mean that users can't override `operator new`/`operator delete` by providing a strong definition in their program, i.e. that it's impossible to have a conforming C++ implementation on z/OS?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120348



More information about the libcxx-commits mailing list