This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Remove static inline and make use of _LIBCPP_HIDE_FROM_ABI in __support headers
ClosedPublic

Authored by brad on Apr 21 2022, 8:57 PM.

Details

Summary

After some feedback in https://reviews.llvm.org/D122861, I am wondering if this makes sense for the respective headers for AIX, z/OS, Solaris and musl libc.

Diff Detail

Event Timeline

brad created this revision.Apr 21 2022, 8:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2022, 8:57 PM
brad requested review of this revision.Apr 21 2022, 8:57 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptApr 21 2022, 8:57 PM

Thanks for the followup patch! SGTM, but I like to see the feedback of the maintainers of the affected systems before approving.

brad added a comment.Apr 23 2022, 11:29 AM

but I like to see the feedback of the maintainers of the affected systems before approving.

Oh for sure. That's what I want.

ldionne accepted this revision.Apr 24 2022, 10:34 AM
ldionne added a subscriber: Restricted Project.

Looking at this and D122861 again, it strikes me that perhaps the goal was for these to be valid when compiling as C. However, I think that might be a non-goal since one should simply not have libc++ in the header search paths when compiling as C.

So this LGTM, but pinging vendors for awareness. I suggest you ship this if nobody objects within a week or so, just to avoid stalling.

This revision is now accepted and ready to land.Apr 24 2022, 10:34 AM
brad added a reviewer: ro.Apr 24 2022, 11:35 AM
daltenty added a comment.EditedApr 25 2022, 8:31 PM

This change seems ok in principal, but these functions are extern 'C", so now that they're no longer internal linkage they'll provide the same symbol as the real thing. Adding such functions with linkable POSIX reserved names into user program seems like we are asking for trouble. Can we get these moved into some kind of namespace or at least with some kind of double underscore prefix?

(As a side note, _LIBCPP_HIDE_FROM_ABI doesn't exactly work as intend on AIX yet either, as we don't have complete visibility support in clang at the moment. That's something we're actively working on though)

brad added a comment.May 5 2022, 2:32 PM

Any guidance as to how I should proceed?

daltenty accepted this revision.May 6 2022, 2:48 PM

Any guidance as to how I should proceed?

I'm ok if this goes ahead as is from the AIX perspective (sorry didn't mean to stall this if it's waiting from my earlier comment). I can take a todo to revisit my earlier suggestion if we run into problems.

This revision was landed with ongoing or failed builds.May 6 2022, 10:14 PM
This revision was automatically updated to reflect the committed changes.