Specify linker scripts after user link args
This commit is contained in:
@@ -2435,6 +2435,13 @@ fn linker_with_args(
|
|||||||
// Passed after compiler-generated options to support manual overriding when necessary.
|
// Passed after compiler-generated options to support manual overriding when necessary.
|
||||||
add_user_defined_link_args(cmd, sess);
|
add_user_defined_link_args(cmd, sess);
|
||||||
|
|
||||||
|
// ------------ Builtin configurable linker scripts ------------
|
||||||
|
// The user's link args should be able to overwrite symbols in the compiler's
|
||||||
|
// linker script that were weakly defined (i.e. defined with `PROVIDE()`). For this
|
||||||
|
// to work correctly, the user needs to be able to specify linker arguments like
|
||||||
|
// `--defsym` and `--script` *before* any builtin linker scripts are evaluated.
|
||||||
|
add_link_script(cmd, sess, tmpdir, crate_type);
|
||||||
|
|
||||||
// ------------ Object code and libraries, order-dependent ------------
|
// ------------ Object code and libraries, order-dependent ------------
|
||||||
|
|
||||||
// Post-link CRT objects.
|
// Post-link CRT objects.
|
||||||
@@ -2469,8 +2476,6 @@ fn add_order_independent_options(
|
|||||||
|
|
||||||
let apple_sdk_root = add_apple_sdk(cmd, sess, flavor);
|
let apple_sdk_root = add_apple_sdk(cmd, sess, flavor);
|
||||||
|
|
||||||
add_link_script(cmd, sess, tmpdir, crate_type);
|
|
||||||
|
|
||||||
if sess.target.os == "fuchsia"
|
if sess.target.os == "fuchsia"
|
||||||
&& crate_type == CrateType::Executable
|
&& crate_type == CrateType::Executable
|
||||||
&& !matches!(flavor, LinkerFlavor::Gnu(Cc::Yes, _))
|
&& !matches!(flavor, LinkerFlavor::Gnu(Cc::Yes, _))
|
||||||
|
|||||||
Reference in New Issue
Block a user