[libcxx-commits] [PATCH] D154796: [libc++] Recategorize additional instantiations in the dylib as availability macros

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 17 10:45:20 PDT 2023


ldionne added a comment.

I would like to split the good-what-message part of this change into its own patch, since it's significantly different from the other changes. But apart from that, this change makes sense to me.



================
Comment at: libcxx/include/__availability:183
+// bad_function_call::what() with a string that is specific to
+// bad_function_call (see https://wg21.link/LWG2233).
+#   define _LIBCPP_AVAILABILITY_ENABLE_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE_AND_KEY_FUNCTION
----------------
This comment should probably be copied from the original one?


================
Comment at: libcxx/include/__availability:364
+      (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 80000)
+#    define _LIBCPP_AVAILABILITY_ENABLE_BAD_FUNCTION_CALL_KEY_FUNCTION
+#    define _LIBCPP_AVAILABILITY_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1
----------------
First, this doesn't match the macro above (which is `_LIBCPP_AVAILABILITY_ENABLE_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE_AND_KEY_FUNCTION`). Second, I would like us to split the good-what-message part of this change into its own patch since it is more tricky to get right, and in fact it *is* an ABI break (it might just be one that we can do in case it only affects arm64e).


================
Comment at: libcxx/include/__config:176-181
-// For XCOFF linkers, we have problems if we see a weak hidden version of a symbol
-// in user code (like you get with -fvisibility-inlines-hidden) and then a strong def
-// in the library, so we need to always rely on the library version.
-#    if defined(_AIX)
-#      define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
-#    endif
----------------
philnik wrote:
> ldionne wrote:
> > This needs to be translated to the availability, or it'll fail on FreeBSD. FreeBSD doesn't currently enable availability markup, but that is probably needed as a pre-requisite. We could start by unconditionally pretending that all the `_LIBCPP_AVAILABILITY_XXXXXXXX` are enabled on FreeBSD, which would be equivalent to what they have today.
> I'm a bit confused. This has nothing to do with FreeBSD.
I think I meant AIX here. The comment makes sense if you re-read and say AIX in your head.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154796/new/

https://reviews.llvm.org/D154796



More information about the libcxx-commits mailing list