Avoid propagating link_arg values that are unlikely to be resolveable under arbitrary directories.

This commit is contained in:
Josh Matthews 2013-03-12 00:49:06 -04:00
parent 48cb9a8ac0
commit 1e1efbf2c3

View File

@ -818,7 +818,11 @@ pub fn link_binary(sess: Session,
do cstore::iter_crate_data(cstore) |crate_num, _| {
let link_args = csearch::get_link_args_for_crate(cstore, crate_num);
do vec::consume(link_args) |_, link_arg| {
cc_args.push(link_arg);
// Linker arguments that don't begin with - are likely file names,
// so they should not be necessary.
if link_arg.starts_with("-") {
cc_args.push(link_arg);
}
}
}