This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ][z/OS][libcxx] Mark tests that require runtime linking as unsupported on z/OS
AbandonedPublic

Authored by DanielMcIntosh-IBM on Jul 13 2021, 10:27 AM.

Details

Reviewers
EricWF
ldionne
Group Reviewers
Restricted Project
Summary

z/OS doesn't currently have runtime linking, so a call to new or delete won't
invoke any user-defined new or delete operators unless the operator is visible
when the call is processed by the linker. Notably, if a call to new or delete
is compiled as part of a shared library, it is impossible for an application to
change which definition that call invokes. This includes calls compiled as part
of the standard library.

Many tests rely on user-defined new and delete operators to count allocations.
Any such tests will not work on z/OS.

Diff Detail

Event Timeline

DanielMcIntosh-IBM requested review of this revision.Jul 13 2021, 10:27 AM
DanielMcIntosh-IBM created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2021, 10:27 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

Notably, if a call to new or delete is compiled as part of a shared library, it is impossible for an application to change which definition that call invokes. This includes calls compiled as part of the standard library.

Many tests rely on user-defined new and delete operators to count allocations. Any such tests will not work on z/OS.

FWIW, Windows also has this same situation (where operator new/delete in the executable can't override operator new/delete in the already linked libc++ DLL).

But opting out of the whole tests is a bit overkill IMO. For the Windows/DLL situation, we have finegrained macros that omit exactly those checks of the tests while keeping the rest of the tests running. I think it would be much better to generalize those existing macros to something platform independent.

libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.dtor/dtor.pass.cpp
48

Here's an example on how this aspect only is waived in the Windows/DLL configuration.

(Also, for the topic of "naming things", I'd say "runtime linking" is a bit vague here - runtime symbol interposition/overriding or something like that is probably more precise?)

ldionne requested changes to this revision.Jul 28 2021, 9:33 AM

I agree with @mstorsjo 's suggestions. Can you try to make this platform-independent?

This revision now requires changes to proceed.Jul 28 2021, 9:33 AM
Quuxplusone added inline comments.
libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.dtor/dtor.pass.cpp
48

Perhaps the macro's sense could be flipped, something like

ASSERT_VIA_OVERRIDDEN_NEW(globalMemCounter.checkDeleteArrayCalledEq(1));

similar to our existing ASSERT_NOEXCEPT and ASSERT_SAME_TYPE testing macros. Then, on platforms that support overridden new and delete operators, that macro would expand to assert; and on other platforms (Win32, z/OS) it would expand to a no-op.

Given the nature of these changes, they're fairly low priority for us to get upstream right now, but I will come back to these at a later date to address the comments and get this into a state where it is suitable to merge