Skip to content
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

libc++abi: update comment in cxa_thread_atexit.cpp. NFC #18501

Merged
merged 2 commits into from
Jan 16, 2023

Conversation

kleisauke
Copy link
Collaborator

Noticed while investigating issue #15722.

@@ -113,8 +113,8 @@ extern "C" {
return __cxa_thread_atexit_impl(dtor, obj, dso_symbol);
#else
#ifndef __EMSCRIPTEN__
// Emscripten doesn't fully support weak undefined symbols yet
// https://github.com/emscripten-core/emscripten/issues/12819
// musl doesn't provide __cxa_thread_atexit_impl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we instead remove the ifndef block now since I think we do support weak undefined symbols fully now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could remove this ifndef-block, but I'm not sure if it will ever reach the __cxa_thread_atexit_impl() call (given that we always build against musl). Hence I only updated the comment.

Do you think we should remove this even though it always falls in the else block?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess my argument would be that this ifdef was only added because in the past we had bad support for weak undefined symbols.. now that we don't we can remove the ifdef.

However, I do agree that the if block is dead code in the emscripten case... with static linking + LTO think should be completely removed, but I guess it makes sense to keep the ifdef for the non-LTO or dynamic linking case.

I don't really see why the bug you link to is relevant. How about updating the comment to say We know emscripten doesn't implement __cxa_thread_atexit_impl so we can simply avoid this check.

@kleisauke
Copy link
Collaborator Author

Test failures in the core2 testsuite are not related.

@sbc100 sbc100 merged commit 1af985d into emscripten-core:main Jan 16, 2023
@kleisauke kleisauke deleted the _cxa_thread_atexit_impl branch January 16, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants