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