linker: Use --as-needed by default when linker supports it
This commit is contained in:
@@ -1651,6 +1651,12 @@ fn linker_with_args<'a, B: ArchiveBuilder<'a>>(
|
||||
cmd.add_eh_frame_header();
|
||||
}
|
||||
|
||||
// NO-OPT-OUT, OBJECT-FILES-NO
|
||||
// Avoid linking to dynamic libraries unless they satisfy some undefined symbols
|
||||
// at the point at which they are specified on the command line.
|
||||
// Must be passed before any dynamic libraries.
|
||||
cmd.add_as_needed();
|
||||
|
||||
// NO-OPT-OUT, OBJECT-FILES-NO
|
||||
if crt_objects_fallback {
|
||||
cmd.no_crt_objects();
|
||||
|
||||
Reference in New Issue
Block a user