[libc++] Bypass calling exception-throwing functions in the dylib with -fno-exceptions
authorLouis Dionne <ldionne.2@gmail.com>
Thu, 19 Aug 2021 16:39:16 +0000 (12:39 -0400)
committerLouis Dionne <ldionne.2@gmail.com>
Fri, 20 Aug 2021 12:38:58 +0000 (08:38 -0400)
commitf3bc0e51ab72f504445228cbb712542154ccb4cf
treead78030eab7a0ae395493248c8038da7f6efd7ae
parentb0391dfc737ede147e128fe877045f61fc5e4905
[libc++] Bypass calling exception-throwing functions in the dylib with -fno-exceptions

basic_string and vector currently have a hard dependency on the compiled
library because they need to call __vector_base_common::__throw_xxx(),
which are externally instantiated in the compiled library. That makes
sense when exceptions are enabled (because we're trying to localize the
exception-throwing code to the compiled library), but it doesn't really
make sense when exceptions are disabled, and the __throw_xxx functions
are just calling abort() anyways.

This patch simply overrides the __throw_xxx() functions so that they
don't rely on the compiled library when exceptions are disabled.

Differential Revision: https://reviews.llvm.org/D108389
libcxx/include/string
libcxx/include/vector