-
Notifications
You must be signed in to change notification settings - Fork 13.5k
pass --gc-sections if -Zexport-executable-symbols is enabled and improve tests #143846
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
base: master
Are you sure you want to change the base?
Conversation
} | ||
cmd.gc_sections(keep_metadata); | ||
} else { | ||
cmd.no_gc_sections(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removed line is the only place in rustc where no_gc_sections
is called, so I had to call it here to suppress the unused
warning.
This PR modifies cc @jieyouxu Some changes occurred in compiler/rustc_codegen_ssa |
Maybe r? @bjorn3 (or reroll) |
.invalid_stdout_utf8(); | ||
assert_contains(&output, "exported_symbol"); | ||
} else { | ||
let output = llvm_readobj().symbols().input(bin_name("main")).run().invalid_stdout_utf8(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussion: Hm, this might not be quite right for windows msvc, cc @ChrisDenton ?
Exported symbols are added as GC roots in linking, so
--gc-sections
won't hurt-Zexport-executable-symbols
.Fixes the run-make test to work on Linux. Enable the ui test on more targets.
cc #84161