Skip to content

Use visibility("default") attribute for libc overrides#1

Merged
Sonicadvance1 merged 1 commit intoFEX-Emu:masterfrom
neobrain:fix_jemalloc_overrides
Dec 13, 2021
Merged

Use visibility("default") attribute for libc overrides#1
Sonicadvance1 merged 1 commit intoFEX-Emu:masterfrom
neobrain:fix_jemalloc_overrides

Conversation

@neobrain
Copy link
Member

Prevents the linker from failing to override host libc functions. I'm guessing attribute((used)) is purely a compiler directive, whereas the linker only considers visibility (which is set to hidden by default in our build configuration).

Upstream jemalloc still uses attribute((used)), and so did old versions of tcmalloc. However, recent versions of tcmalloc and mimalloc both adjust the visibility, so this seems like a reasonable way to follow.

When building with -fvisibility=hidden, this must be added for the linker
to properly consider the overridden symbols.
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