-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[trace] Remove default definitions of weak symbols
Instead of providing a default no-op implementation, check the symbols for `NULL` before accessing them. Providing a default implementation doesn't reliably work with dynamic linking. Depending on link order the default implementations may not be overridden. By skipping the default implementation, all link order issues are resolved. If the symbols aren't provided the weak function will be `NULL`.
- Loading branch information
Showing
5 changed files
with
11 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6cee3c2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks strange. A weak definition is more portable than a weak reference. Weak references traditionally had some GNU toolchain bugs for some archaic architectures. https://maskray.me/blog/2021-04-25-weak-symbol