Page MenuHomeFreeBSD

libc++: avoid use of deprecated builtin
ClosedPublic

Authored by arichardson on Sep 14 2025, 10:37 PM.
Tags
None
Referenced Files
F132422177: D52529.diff
Thu, Oct 16, 7:29 PM
Unknown Object (File)
Sat, Oct 11, 11:59 PM
Unknown Object (File)
Sat, Oct 11, 10:59 PM
Unknown Object (File)
Sat, Oct 11, 10:58 PM
Unknown Object (File)
Sat, Oct 11, 10:58 PM
Unknown Object (File)
Sat, Oct 11, 1:40 PM
Unknown Object (File)
Wed, Oct 8, 8:44 PM
Unknown Object (File)
Tue, Oct 7, 4:10 PM
Subscribers

Details

Summary

This pulls in LLVM commit accfbd4cb327411ad66c0109ba1841482b871967 to
avoid the use of __libcpp_is_trivially_relocatable.
This fixes building FreeBSD libc++ with clang HEAD as of today.

Original commit message:
[libc++] Replace __is_trivially_relocatable by is_trivially_copyable (#124970)

The __is_trivially_relocatable builtin has semantics that do not
correspond to any current or future notion of trivial relocation.
Furthermore, it currently leads to incorrect optimizations for some
types on supported compilers:

  • Clang on Windows where types with non-trivial destructors get incorrectly optimized
  • AppleClang where types with non-trivial move constructors get incorrectly optimized

Until there is an agreed upon and bugfree implementation of what it
means to be trivially relocatable, it is safer to simply use trivially
copyable instead. This doesn't leave a lot of types behind and is
definitely correct.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dim added inline comments.
contrib/llvm-project/libcxx/include/__type_traits/is_trivially_relocatable.h
25–29

Can you please also add the comment from https://github.com/llvm/llvm-project/commit/accfbd4cb327411ad66c0109ba1841482b871967 ? It gives some context for the rather ad-hoc looking && 0 hack. :)

This revision is now accepted and ready to land.Sep 15 2025, 12:09 PM
This revision was automatically updated to reflect the committed changes.
arichardson marked an inline comment as done.