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

[Linux] Only export extension init symbol #131

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

Faless
Copy link
Collaborator

@Faless Faless commented Dec 21, 2023

Since we link with static libstdc++ we need to tell gcc to only export the necessary symbols.
Using "-fvisibility=hidden" will not work, since libstdc++ explicitly export its symbols.

Fixes #127 .

@Faless Faless added bug Something isn't working build system An issue that affects the build system. needs testing platform:linuxbsd labels Dec 21, 2023
@Sch1nken
Copy link

I don't know how flexible Sconstruct is, but could the build system potentially read the .gdextension file to determine the entry_symbol and generate the symbols.map file during compilation?

This is not really related to this WebRTC Extension anymore, but I wonder if this is a good "default" behaviour for new extension (i.e. the demo repository from Godot for GDExtensions). Or alternatively provide a flag that enables/disables the version script usage.

@Faless Faless force-pushed the fix/linux_only_export_init_symbol branch 2 times, most recently from a4f49d8 to 4eb5b76 Compare December 22, 2023 00:20
@Faless Faless marked this pull request as ready for review December 22, 2023 00:21
@Faless
Copy link
Collaborator Author

Faless commented Dec 22, 2023

I don't know how flexible Sconstruct is, but could the build system potentially read the .gdextension file to determine the entry_symbol and generate the symbols.map file during compilation?

It's possible, I've been thinking about creating a GDExtension tool for SCons for a while, which should ideally also generate the .gdextension file.

Since we link with static libstdc++ we need to tell gcc to only export
the necessary symbols.
Using "-fvisibility=hidden" will not work, since libstdc++ explicitly
exports its symbols.
@Faless Faless force-pushed the fix/linux_only_export_init_symbol branch from 4eb5b76 to b0efc17 Compare December 22, 2023 00:30
@Faless Faless merged commit 81239d8 into godotengine:master Dec 22, 2023
11 checks passed
@Faless Faless deleted the fix/linux_only_export_init_symbol branch December 22, 2023 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build system An issue that affects the build system. needs testing platform:linuxbsd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when using along other GDExtensions
2 participants