diff --git a/classes/internal-rust-cross.bbclass b/classes/internal-rust-cross.bbclass index e26f55e..ce0fa13 100644 --- a/classes/internal-rust-cross.bbclass +++ b/classes/internal-rust-cross.bbclass @@ -9,7 +9,7 @@ PN = "rust-cross-${TARGET_ARCH}" # The same value as ${TOOLCHAIN_OPTIONS}. We can't use that variable directly # here because cross.bblcass is "helpful" and blanks it out. -PRE_LINK_ARGS_PREPEND = "--sysroot=${STAGING_DIR_TARGET}" +TARGET_PRE_LINK_ARGS_PREPEND = "--sysroot=${STAGING_DIR_TARGET}" ## gcc-cross settings # INHIBIT_DEFAULT_DEPS = "1" diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index 67d4e39..a13f7f0 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -113,7 +113,8 @@ def rust_gen_target(d, thing, wd): features = d.getVarFlag('FEATURES', arch, True) or "" pre_link_args = (d.getVarFlag('PRE_LINK_ARGS', arch, True) or "").split() - pre_link_args.extend((d.getVar('PRE_LINK_ARGS_PREPEND', True) or "").split()) + if thing == 'TARGET': + pre_link_args.extend((d.getVar('TARGET_PRE_LINK_ARGS_PREPEND', True) or "").split()) o.write('''{{ "data-layout": "{}",