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

Daniel McIntosh via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 16 12:29:22 PDT 2022


DanielMcIntosh-IBM 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) {
----------------
ldionne wrote:
> 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?
At the moment, yes. Any invocation of new and delete within the standard library DLL will not use any user-defined `operator new`\`operator delete`. This is something that would need to be fixed in the OS, and I'm not aware of any timeline or plans for fixing it right now.

Win32 DLL has the same problem, and had to disable portions of tests for that reason. D107755 made their solution more generic so it could be used for 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