This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ][z/OS] Account for no __cxa_thread_atexit_impl on z/OS
Needs ReviewPublic

Authored by muiez on Oct 7 2022, 10:24 AM.

Details

Reviewers
ldionne
zibi
fanbo-meng
Group Reviewers
Restricted Project
Restricted Project
Summary

The following patch resolves a build error and accounts for no cxa_thread_atexit_impl on z/OS. It avoids using thread since thread-local storage is not supported. It should be noted that the fallback implementation uses TLS, which is also not supported on z/OS.

Diff Detail

Event Timeline

muiez created this revision.Oct 7 2022, 10:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2022, 10:24 AM
muiez requested review of this revision.Oct 7 2022, 10:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2022, 10:24 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
muiez updated this revision to Diff 470269.Oct 24 2022, 1:02 PM

Abort with message instead of silently returning 0.

zibi added a comment.Oct 28 2022, 6:52 AM

LGTM,
ideally we should have macro for __thread which would define to nothing for z/OS.

How is this code going to be correct if there is no thread-local storage? z/OS does support multiple threads, so does this mean that this is now a race condition?

libcxxabi/src/cxa_thread_atexit.cpp
25–28

Why doesn't that handle the z/OS case?