-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[libcxx] Use local names for the operator new impl symbols #122983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libcxx] Use local names for the operator new impl symbols #122983
Conversation
This way the impl symbols don't even make it into the symbol table which is important for symbolization since we want the symbolizer to always pick up the public symbol (which has the same address as the impl one).
@llvm/pr-subscribers-libcxx Author: Petr Hosek (petrhosek) ChangesThis way the impl symbols don't even make it into the symbol table which is important for symbolization since we want the symbolizer to always pick up the public symbol (which has the same address as the impl one). Full diff: https://github.com/llvm/llvm-project/pull/122983.diff 1 Files Affected:
diff --git a/libcxx/src/include/overridable_function.h b/libcxx/src/include/overridable_function.h
index 7372e347831bb4..71feebf0c15b20 100644
--- a/libcxx/src/include/overridable_function.h
+++ b/libcxx/src/include/overridable_function.h
@@ -90,8 +90,8 @@ _LIBCPP_END_NAMESPACE_STD
# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 1
# define _LIBCPP_OVERRIDABLE_FUNCTION(symbol, type, name, arglist) \
- static type symbol##_impl__ arglist __asm__(_LIBCPP_TOSTRING(symbol##_impl__)); \
- [[gnu::weak, gnu::alias(_LIBCPP_TOSTRING(symbol##_impl__))]] type name arglist; \
+ static type symbol##_impl__ arglist __asm__(".L" _LIBCPP_TOSTRING(symbol)); \
+ [[gnu::weak, gnu::alias(".L" _LIBCPP_TOSTRING(symbol))]] type name arglist; \
_LIBCPP_BEGIN_NAMESPACE_STD \
template <> \
inline bool __is_function_overridden<static_cast<type(*) arglist>(name)>() { \
|
This avoids the issue with -funique-internal-linkage-names.
Having global symbols with .L names is not well supported.
There seems to be legitimate CI issues on Buildkite. |
This roughly matches the ELF version and addresses the issue llvm#123224.
Reverts #120805 This change while desirable has two issues we discovered: - It is incompatible with `-funique-internal-linkage-names`, see #120805 (comment) - It is incompatible with `-fvisibility-global-new-delete=force-hidden`, see #123224 (comment) We were hoping to address both of these issues with #122983, but that change has other issues we haven't yet managed to resolve. For now, we have decided to revert the change to avoid shipping a broken feature in LLVM 20, and we plan to follow up with a new approach post branch.
…n" (#124431) Reverts llvm/llvm-project#120805 This change while desirable has two issues we discovered: - It is incompatible with `-funique-internal-linkage-names`, see llvm/llvm-project#120805 (comment) - It is incompatible with `-fvisibility-global-new-delete=force-hidden`, see llvm/llvm-project#123224 (comment) We were hoping to address both of these issues with llvm/llvm-project#122983, but that change has other issues we haven't yet managed to resolve. For now, we have decided to revert the change to avoid shipping a broken feature in LLVM 20, and we plan to follow up with a new approach post branch.
Reverts llvm/llvm-project#120805 This change while desirable has two issues we discovered: - It is incompatible with `-funique-internal-linkage-names`, see llvm/llvm-project#120805 (comment) - It is incompatible with `-fvisibility-global-new-delete=force-hidden`, see llvm/llvm-project#123224 (comment) We were hoping to address both of these issues with llvm/llvm-project#122983, but that change has other issues we haven't yet managed to resolve. For now, we have decided to revert the change to avoid shipping a broken feature in LLVM 20, and we plan to follow up with a new approach post branch. NOKEYCHECK=True GitOrigin-RevId: 4167ea2cb082a2acb00b8b1dc09aa780dc0e3110
This way the impl symbols don't even make it into the symbol table which is important for symbolization since we want the symbolizer to always pick up the public symbol (which has the same address as the impl one).