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

Separate debug info from .so file #123

Open
Mothblocks opened this issue Oct 29, 2022 · 4 comments
Open

Separate debug info from .so file #123

Mothblocks opened this issue Oct 29, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@Mothblocks
Copy link
Member

After #119, the release build of librust_g.so is 70 MB as opposed to the previous 10 MB.

This is extremely unideal. There are two ways I see to solve this.

One is that we make release w/ debug info a separate target, then ship both librust_g.so and librust_g_debug_info.so.

Another is that there might be a way to split it into its own file much like the .pdb. There's a few StackOverflow posts about this, something about objcopy? Not sure how doable it is but that would be ideal if it's feasible

@Mothblocks Mothblocks added the enhancement New feature or request label Oct 29, 2022
@Mothblocks Mothblocks changed the title Separate debug info from .so file. Separate debug info from .so file Oct 29, 2022
@willox
Copy link
Contributor

willox commented Oct 29, 2022

No need for separate targets. The binaries can be stripped post-build with the strip command line utility.

I'm not sure this really needs to be done on this repo since people can do it themselves, but it's no big deal.

@willox
Copy link
Contributor

willox commented Oct 29, 2022

It's a little bit of a "standard" to have x.so and x.so.dbg available and to use the debug version when necessary for debugging core dumps.

Both are valid binaries (but the former has been stripped.)

@Mothblocks
Copy link
Member Author

Mothblocks commented Oct 29, 2022

SpaceManiac gave this:

objcopy --only-keep-debug "$INPUT" "$INPUT.dbg"
strip "$INPUT"
objcopy --add-gnu-debuglink="$INPUT.dbg" "$INPUT"

@Mothblocks
Copy link
Member Author

This new change in 1.65.0 could prove useful: https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html#splitting-linux-debuginfo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants