Skip to content

[libc++] Make __start___lcxx_override/__stop___lcxx_override weak #79347

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

Closed
wants to merge 1 commit into from

Conversation

MaskRay
Copy link
Member

@MaskRay MaskRay commented Jan 24, 2024

After #69498, when _LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE
functions are absent (possibly after ld --gc-sections), there will no
output section __lcxx_override. The linker will report an error like

ld: error: undefined symbol: __start___lcxx_override
>>> referenced by overridable_function.h:108 (libcxx/src/include/overridable_function.h:108)

Fix this by making the references weak.

After llvm#69498, when `_LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE`
functions are absent (possibly after ld --gc-sections), there will no
output section `__lcxx_override`. The linker will report an error like

```
ld: error: undefined symbol: __start___lcxx_override
>>> referenced by overridable_function.h:108 (libcxx/src/include/overridable_function.h:108)
```

Fix this by making the references weak.
@MaskRay MaskRay closed this Jan 24, 2024
@MaskRay MaskRay deleted the lcxx_override branch January 26, 2024 18:41
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.

1 participant