This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Guard the fix to CityHash behind ABI v2
ClosedPublic

Authored by ldionne on Feb 9 2023, 3:40 PM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Commits
rG02718433a0dd: [libc++] Guard the fix to CityHash behind ABI v2
Summary

As explained in a comment in https://reviews.llvm.org/D134124, we tried
landing this unconditionally but this actually bit some users who were
sharing std::unordered_map across an ABI boundary. This shows that the
ABI break is not benign and it should be guarded behind ABI v2.

Diff Detail

Event Timeline

ldionne created this revision.Feb 9 2023, 3:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 9 2023, 3:40 PM
ldionne requested review of this revision.Feb 9 2023, 3:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 9 2023, 3:40 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne added a subscriber: oToToT.Feb 9 2023, 3:43 PM

I will land this once CI passes and then cherry-pick it onto release/16.x.

@oToToT Once you have a suggestion for a better hashing algorithm, we can rename the _LIBCPP_ABI_FIX_CITYHASH_IMPLEMENTATION macro to something else and expand the scope of the #ifdef to include basically all of the implementation.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 9 2023, 5:10 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Mordante added inline comments.
libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.pass.cpp
15

Is there also a test that ABI=V1 keeps returning the same "wrong" value?

ldionne marked an inline comment as done.Feb 15 2023, 7:51 AM
ldionne added inline comments.
libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.pass.cpp
15

Good point, see D144107.

Mordante added inline comments.Feb 15 2023, 9:29 AM
libcxx/test/libcxx/utilities/utility/__murmur2_or_cityhash.pass.cpp
15

Thanks!