-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Pass --strip-debug to GccLinker when building without debuginfo #49212
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
For
|
It's a linker argument, so it's passed to the linker. Specifically I am not sure whether ld.exe and the MacOS ld supports it, and there's no good docs for either of them that I can find at all. So the only way to find out that I know of would be a compile test. |
r? @michaelwoerister probably |
Looks good, @kyrias! On OSX the flag is called |
Ah, you sure that they don't have |
Are we sure we want to do this? Just because the final compilation doesn't have This indeed does fix a "first impression" of Rust on linux sort of but I think it could hurt legitimate use cases where debuginfo is only applied to intermediate crates, right? |
Good point, @alexcrichton! I see two options:
|
@kyrias The man page at least does not list the long version. |
I would prefer the latter option, especially since anyone who would want to do it already needs to do some funky custom build system calling rustc directly. |
dbd54d4
to
368c66a
Compare
I added the boolean |
Can the defaults remain as they were? Until we stabilize the option I don't think we should change the default behavior |
…out it Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
368c66a
to
2f0dd4a
Compare
Done, now you need to pass |
📌 Commit 2f0dd4a has been approved by |
…ister Pass --strip-debug to GccLinker when building without debuginfo C.f. #46034 --- This brings a hello-world built by passing rustc no command line options from 2.9M to 592K on Linux. (This might need to special case MacOS or Windows, not sure if the linkers there support `--strip-debug`, and there is an annoying lack of dependable docs for the linkers there.)
☀️ Test successful - status-appveyor, status-travis |
shouldnt this be |
@cup for most users |
C.f. #46034
This brings a hello-world built by passing rustc no command line options from 2.9M to 592K on Linux.
(This might need to special case MacOS or Windows, not sure if the linkers there support
--strip-debug
, and there is an annoying lack of dependable docs for the linkers there.)