tweaks
This commit is contained in:
@@ -59,9 +59,7 @@ RUST_TARGET_SYS = "${@rust_base_triple(d, 'TARGET')}"
|
||||
|
||||
|
||||
# FIXME: the 'rustlib' element of this is to workaround rustc forgetting the libdir it was built with.
|
||||
RUST_PATH_NATIVE="${STAGING_LIBDIR_NATIVE}:\
|
||||
${STAGING_BASE_LIBDIR_NATIVE}:\
|
||||
${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/rustlib/${TARGET_SYS}/lib"
|
||||
RUST_PATH_NATIVE="${STAGING_LIBDIR_NATIVE}:${STAGING_BASE_LIBDIR_NATIVE}:${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/rustlib/${TARGET_SYS}/lib"
|
||||
|
||||
# FIXME: set based on whether we are native vs cross vs buildsdk, etc
|
||||
export RUST_PATH ??= "${RUST_PATH_NATIVE}"
|
||||
@@ -80,7 +78,7 @@ oe_runrustc () {
|
||||
"${RUSTC}" ${RUSTC_ARCHFLAGS} ${RUSTC_FLAGS} "$@"
|
||||
}
|
||||
|
||||
oe_cargo_config () {
|
||||
cargo_config () {
|
||||
mkdir -p .cargo
|
||||
# FIXME: we currently blow away the entire config because duplicate
|
||||
# sections are treated as a parse error by cargo (causing the entire
|
||||
@@ -96,7 +94,8 @@ oe_cargo_config () {
|
||||
echo "]" >>.cargo/config
|
||||
}
|
||||
|
||||
oe_cargo_patch () {
|
||||
rust_cargo_patch () {
|
||||
cd "${S}"
|
||||
cat >>Cargo.toml <<EOF
|
||||
[profile.dev]
|
||||
rpath = true
|
||||
@@ -105,7 +104,7 @@ rpath = true
|
||||
EOF
|
||||
}
|
||||
|
||||
oe_runcargo_build () {
|
||||
cargo_build () {
|
||||
# FIXME: if there is already an entry for this target, in an existing
|
||||
# cargo/config, this won't work.
|
||||
which cargo
|
||||
|
||||
@@ -16,7 +16,7 @@ S = "${WORKDIR}/git"
|
||||
B = "${S}"
|
||||
|
||||
do_compile () {
|
||||
oe_runcargo_build
|
||||
cargo_build
|
||||
}
|
||||
|
||||
do_install () {
|
||||
|
||||
@@ -20,13 +20,7 @@ S = "${WORKDIR}/git"
|
||||
B = "${S}"
|
||||
|
||||
do_cargo_config_patch () {
|
||||
cd "${S}"
|
||||
cat >>Cargo.toml <<EOF
|
||||
[profile.dev]
|
||||
rpath = true
|
||||
[profile.release]
|
||||
rpath = true
|
||||
EOF
|
||||
rust_cargo_patch
|
||||
}
|
||||
addtask cargo_config_patch after do_patch before do_configure
|
||||
do_cargo_config_patch[dirs] = "${WORKDIR}"
|
||||
@@ -34,9 +28,9 @@ do_cargo_config_patch[dirs] = "${WORKDIR}"
|
||||
do_configure () {
|
||||
"${S}/configure" \
|
||||
"--prefix=${prefix}" \
|
||||
"--build=${RUST_BUILD_SYS}" \
|
||||
"--host=${RUST_HOST_SYS}" \
|
||||
"--target=${RUST_TARGET_SYS}" \
|
||||
"--build=${BUILD_SYS}" \
|
||||
"--host=${HOST_SYS}" \
|
||||
"--target=${TARGET_SYS}" \
|
||||
"--localstatedir=${localstatedir}" \
|
||||
"--sysconfdir=${sysconfdir}" \
|
||||
"--datadir=${datadir}" \
|
||||
|
||||
@@ -113,8 +113,7 @@ 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()
|
||||
if thing == 'TARGET':
|
||||
pre_link_args.extend((d.getVar('TARGET_PRE_LINK_ARGS_PREPEND', True) or "").split())
|
||||
pre_link_args.extend((d.getVar('{}_PRE_LINK_ARGS_PREPEND'.format(thing), True) or "").split())
|
||||
|
||||
o.write('''{{
|
||||
"data-layout": "{}",
|
||||
|
||||
Reference in New Issue
Block a user