Skip to content

Commit

Permalink
Revert commit 6255157d24e2 from llvm-project (by Dimitry Andric):
Browse files Browse the repository at this point in the history
  [libc++] Re-enable std::pair trivial copy constructor for FreeBSD >= 14

  After many years of using the really old std::pair ABI which did not yet
  have a trivial copy constructor, FreeBSD 14 and later will finally get
  rid of it. Only use the old ABI for FreeBSD 13 and earlier.

  Note: on the FreeBSD side, we will bump our libc++.so version for this,
  and keep an old compatibility library in a separate package.

  Differential Revision: https://reviews.llvm.org/D126462

This ABI change can cause crashes when binaries compiled against older
libc++ versions are run against binaries compiled against this libc++
version.

For example, lang/ldc uses a precompiled bootstrap ldc2 binary that was
compiled against the old libc++, but also links against libLLVM-15.so.
If libLLVM-15.so is compiled against the new libc++ version, the ABI
mismatch results in segfaults or even stack overflows.
  • Loading branch information
DimitryAndric committed Mar 19, 2024
1 parent d925b22 commit 4c0e8f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/llvm-project/libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
# endif
// Feature macros for disabling pre ABI v1 features. All of these options
// are deprecated.
# if defined(__FreeBSD__) && __FreeBSD__ < 14
# if defined(__FreeBSD__)
# define _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR
# endif
// For XCOFF linkers, we have problems if we see a weak hidden version of a symbol
Expand Down

0 comments on commit 4c0e8f6

Please sign in to comment.