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

fix(build): don't export all symbols to dynamic symbol table #16171

Merged
merged 5 commits into from
Oct 6, 2022

Conversation

littledivy
Copy link
Member

@littledivy littledivy commented Oct 6, 2022

Currently, we use -rdynamic for exporting Node API symbols to the symbol table. -rdynamic will export all symbols, that means previously unused functions will not be optimized away introducing a lot of binary bloat. It can be seen here:

image

This patch uses -exported_symbol and --export-dynamic-symbol link flags (not as universal as -rdynamic) to only mark Node API symbols to be put in the dynamic symbol table.

@littledivy littledivy force-pushed the dynamic-executable-link-args branch from 22e8386 to 9bbc14a Compare October 6, 2022 05:15
Copy link
Member Author

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

This needs GNU ld 2.35 and the CI is on 2.34 right now 😭

Copy link
Member

@satyarohith satyarohith left a comment

Choose a reason for hiding this comment

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

What's the size of the binary with this PR?

@littledivy
Copy link
Member Author

@satyarohith

On Linux:

# this pr
divy@ry:~/deno$ ls -h -s target/release/deno
97M target/release/deno

# deno 1.26
divy@ry:~/deno$ ls -h -s ~/.deno/bin/deno
96M /home/divy/.deno/bin/deno

@littledivy littledivy merged commit cd1c63a into denoland:main Oct 6, 2022
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.

3 participants