Merge remote-tracking branch 'upstream/master' into merge-upstream

Conflicts:
	conf/distro/include/rust_security_flags.inc
	conf/layer.conf
	recipes-devtools/cargo/cargo_git.bb
	recipes-devtools/cargo/files/0001-update-Rust.patch
	recipes-devtools/cargo/files/0001-update-pkg-versions.patch
	recipes-devtools/cargo/files/curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.-If-it-.patch
	recipes-devtools/cargo/files/curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch
	recipes-devtools/cargo/files/git2-rs/0001-Add-generic-openssl-sys-dep.patch
	recipes-devtools/cargo/files/git2-rs/0002-libgit2-sys-avoid-the-build-script-it-is-a-disaster.patch
	recipes-devtools/cargo/files/git2-rs/0003-bump-libssh2-to-fix-build-with-nightly.patch
	recipes-devtools/cargo/files/ssh2-rs/0001-Unconditionally-depend-on-openssl-sys.patch
	recipes-devtools/rust/files/rust-1.3.0/0001-platform.mk-avoid-choking-on-i586.patch
	recipes-devtools/rust/files/rust-1.3.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch
	recipes-devtools/rust/files/rust-1.3.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch
	recipes-devtools/rust/files/rust-1.3.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch
	recipes-devtools/rust/files/rust-1.3.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch
	recipes-devtools/rust/files/rust-1.3.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch
	recipes-devtools/rust/files/rust-1.3.0/0007-mk-install-use-disable-rewrite-paths.patch
	recipes-devtools/rust/files/rust-1.3.0/0008-install-disable-ldconfig.patch
	recipes-devtools/rust/files/rust-1.3.0/0009-Remove-crate-metadata-from-symbol-hashing.patch
	recipes-devtools/rust/files/rust-1.3.0/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch
	recipes-devtools/rust/files/rust-git/0001-platform.mk-avoid-choking-on-i586.patch
	recipes-devtools/rust/files/rust-git/0002-Target-add-default-target.json-path-libdir-rust-targ.patch
	recipes-devtools/rust/files/rust-git/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch
	recipes-devtools/rust/files/rust-git/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch
	recipes-devtools/rust/files/rust-git/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch
	recipes-devtools/rust/files/rust-git/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch
	recipes-devtools/rust/files/rust-git/0007-mk-install-use-disable-rewrite-paths.patch
	recipes-devtools/rust/files/rust-git/0008-install-disable-ldconfig.patch
	recipes-devtools/rust/files/rust/0001-platform.mk-avoid-choking-on-i586.patch
	recipes-devtools/rust/files/rust/0002-Target-add-default-target.json-path-libdir-rust-targ.patch
	recipes-devtools/rust/files/rust/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch
	recipes-devtools/rust/files/rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch
	recipes-devtools/rust/files/rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch
	recipes-devtools/rust/files/rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch
	recipes-devtools/rust/files/rust/0009-Remove-crate-metadata-from-symbol-hashing.patch
	recipes-devtools/rust/rust-1.3.0.inc
	recipes-devtools/rust/rust-git.inc
	recipes-devtools/rust/rust-llvm_1.3.0.bb
	recipes-devtools/rust/rust.inc
	recipes-devtools/rust/rust_1.3.0.bb
	recipes-devtools/rust/rust_git.bb
	recipes/rust/files/rust-1.3.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch
	recipes/rust/files/rust-1.3.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch
	recipes/rust/files/rust-git/0001-platform.mk-avoid-choking-on-i586.patch
	recipes/rust/files/rust-git/0002-Target-add-default-target.json-path-libdir-rust-targ.patch
	recipes/rust/files/rust-git/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch
This commit is contained in:
Derek Straka
2016-02-22 13:17:51 -05:00
78 changed files with 1297 additions and 2520 deletions
+7 -2
View File
@@ -57,9 +57,14 @@ On the target:
## Maintainer(s) & Patch policy ## Maintainer(s) & Patch policy
Open a Pull Request Open a Pull Request.
Generally, I try to support the latest master of poky. I'm happy to support
older versions too by applying backwards compat patches as long as I don't need
to maintain a seperate branch. Of course, others are welcome to create forks to
support their individual needs.
## Copyright ## Copyright
MIT/Apache-2.0 - Same as rust MIT OR Apache-2.0 - Same as rust
+8 -8
View File
@@ -5,7 +5,7 @@ export CARGO_HOME = "${WORKDIR}/cargo_home"
def cargo_base_dep(d): def cargo_base_dep(d):
deps = "" deps = ""
if not d.getVar('INHIBIT_DEFAULT_DEPS') and not d.getVar('INHIBIT_CARGO_DEP'): if not d.getVar('INHIBIT_DEFAULT_DEPS', True) and not d.getVar('INHIBIT_CARGO_DEP', True):
deps += " cargo-native" deps += " cargo-native"
return deps return deps
@@ -31,19 +31,19 @@ export PKG_CONFIG_ALLOW_CROSS = "1"
EXTRA_OECARGO_PATHS ??= "" EXTRA_OECARGO_PATHS ??= ""
cargo_do_configure () { cargo_do_configure () {
mkdir -p .cargo # FIXME: we currently make a mess in the directory above us
# FIXME: we currently blow away the entire config because duplicate # (${WORKDIR}), which may not be ideal. Look into whether this is
# sections are treated as a parse error by cargo (causing the entire # allowed
# config to be silently ignored. mkdir -p ../.cargo
# NOTE: we cannot pass more flags via this interface, the 'linker' is # NOTE: we cannot pass more flags via this interface, the 'linker' is
# assumed to be a path to a binary. If flags are needed, a wrapper must # assumed to be a path to a binary. If flags are needed, a wrapper must
# be used. # be used.
echo "paths = [" >.cargo/config echo "paths = [" >../.cargo/config
for p in ${EXTRA_OECARGO_PATHS}; do for p in ${EXTRA_OECARGO_PATHS}; do
printf "\"%s\"\n" "$p" printf "\"%s\"\n" "$p"
done | sed -e 's/$/,/' >>.cargo/config done | sed -e 's/$/,/' >>../.cargo/config
echo "]" >>.cargo/config echo "]" >>../.cargo/config
} }
rust_cargo_patch () { rust_cargo_patch () {
+12 -5
View File
@@ -2,6 +2,7 @@ inherit rust
RUSTLIB_DEP ?= " rustlib" RUSTLIB_DEP ?= " rustlib"
DEPENDS .= "${RUSTLIB_DEP}" DEPENDS .= "${RUSTLIB_DEP}"
RDEPENDS_${PN} .= "${RUSTLIB_DEP}"
DEPENDS += "patchelf-native" DEPENDS += "patchelf-native"
export rustlibdir = "${libdir}/rust" export rustlibdir = "${libdir}/rust"
@@ -19,9 +20,10 @@ OVERLAP_LIBS = "\
libc \ libc \
log \ log \
getopts \ getopts \
rand \
" "
def get_overlap_deps(d): def get_overlap_deps(d):
deps = d.getVar("DEPENDS").split() deps = d.getVar("DEPENDS", True).split()
overlap_deps = [] overlap_deps = []
for o in d.getVar("OVERLAP_LIBS", True).split(): for o in d.getVar("OVERLAP_LIBS", True).split():
l = len([o for dep in deps if (o + '-rs' in dep)]) l = len([o for dep in deps if (o + '-rs' in dep)])
@@ -41,7 +43,7 @@ rustlib_src="${prefix}/lib/${rustlib_suffix}"
rustlib="${libdir}/${rustlib_suffix}" rustlib="${libdir}/${rustlib_suffix}"
CRATE_NAME ?= "${@d.getVar('BPN', True).replace('-rs', '').replace('-', '_')}" CRATE_NAME ?= "${@d.getVar('BPN', True).replace('-rs', '').replace('-', '_')}"
BINNAME ?= "${BPN}" BINNAME ?= "${BPN}"
LIBNAME ?= "lib${CRATE_NAME}" LIBNAME ?= "lib${CRATE_NAME}-rs"
CRATE_TYPE ?= "dylib" CRATE_TYPE ?= "dylib"
BIN_SRC ?= "${S}/src/main.rs" BIN_SRC ?= "${S}/src/main.rs"
LIB_SRC ?= "${S}/src/lib.rs" LIB_SRC ?= "${S}/src/lib.rs"
@@ -49,7 +51,7 @@ LIB_SRC ?= "${S}/src/lib.rs"
get_overlap_externs () { get_overlap_externs () {
externs= externs=
for dep in ${OVERLAP_DEPS}; do for dep in ${OVERLAP_DEPS}; do
extern=$(ls ${STAGING_DIR_HOST}/${rustlibdir}/lib$dep.{so,rlib} 2>/dev/null \ extern=$(ls ${STAGING_DIR_HOST}/${rustlibdir}/lib$dep-rs.{so,rlib} 2>/dev/null \
| awk '{print $1}'); | awk '{print $1}');
if [ -n "$extern" ]; then if [ -n "$extern" ]; then
externs="$externs --extern $dep=$extern" externs="$externs --extern $dep=$extern"
@@ -61,16 +63,21 @@ get_overlap_externs () {
echo "$externs" echo "$externs"
} }
do_configure () {
}
oe_compile_rust_lib () { oe_compile_rust_lib () {
[ "${CRATE_TYPE}" == "dylib" ] && suffix=so || suffix=rlib
rm -rf ${LIBNAME}.{rlib,so} rm -rf ${LIBNAME}.{rlib,so}
local -a link_args local -a link_args
if [ "${CRATE_TYPE}" == "dylib" ]; then if [ "${CRATE_TYPE}" == "dylib" ]; then
link_args[0]="-C" link_args[0]="-C"
link_args[1]="link-args=-Wl,-soname -Wl,${LIBNAME}.so" link_args[1]="link-args=-Wl,-soname -Wl,${LIBNAME}.$suffix"
fi fi
oe_runrustc $(get_overlap_externs) \ oe_runrustc $(get_overlap_externs) \
"${link_args[@]}" \ "${link_args[@]}" \
${LIB_SRC} \ ${LIB_SRC} \
-o ${LIBNAME}.$suffix \
--crate-name=${CRATE_NAME} --crate-type=${CRATE_TYPE} \ --crate-name=${CRATE_NAME} --crate-type=${CRATE_TYPE} \
"$@" "$@"
} }
@@ -102,7 +109,7 @@ do_rust_bin_fixups() {
for f in `find ${PKGD}`; do for f in `find ${PKGD}`; do
file "$f" | grep -q ELF || continue file "$f" | grep -q ELF || continue
readelf -d "$f" | grep RPATH | grep -q rustlib || continue readelf -d "$f" | grep RUNPATH | grep -q rustlib || continue
echo "Set rpath:" "$f" echo "Set rpath:" "$f"
patchelf --set-rpath '$ORIGIN:'${rustlibdir}:${rustlib} "$f" patchelf --set-rpath '$ORIGIN:'${rustlibdir}:${rustlib} "$f"
done done
+4 -2
View File
@@ -1,13 +1,13 @@
RUSTC = "rustc" RUSTC = "rustc"
# FIXME: --sysroot might be needed # FIXME: --sysroot might be needed
RUSTC_ARCHFLAGS += "--target=${TARGET_SYS} -C rpath" RUSTC_ARCHFLAGS += "--target=${TARGET_SYS} -C rpath -C crate_hash=${BB_TASKHASH}"
def rust_base_dep(d): def rust_base_dep(d):
# Taken from meta/classes/base.bbclass `base_dep_prepend` and modified to # Taken from meta/classes/base.bbclass `base_dep_prepend` and modified to
# use rust instead of gcc # use rust instead of gcc
deps = "" deps = ""
if not d.getVar('INHIBIT_DEFAULT_RUST_DEPS'): if not d.getVar('INHIBIT_DEFAULT_RUST_DEPS', True):
if (d.getVar('HOST_SYS', True) != d.getVar('BUILD_SYS', True)): if (d.getVar('HOST_SYS', True) != d.getVar('BUILD_SYS', True)):
deps += " virtual/${TARGET_PREFIX}rust" deps += " virtual/${TARGET_PREFIX}rust"
else: else:
@@ -82,3 +82,5 @@ HOST_LDFLAGS ?= "${LDFLAGS}"
HOST_CFLAGS ?= "${CFLAGS}" HOST_CFLAGS ?= "${CFLAGS}"
HOST_CXXFLAGS ?= "${CXXFLAGS}" HOST_CXXFLAGS ?= "${CXXFLAGS}"
HOST_CPPFLAGS ?= "${CPPFLAGS}" HOST_CPPFLAGS ?= "${CPPFLAGS}"
EXTRA_OECONF_remove = "--disable-static"
+38
View File
@@ -0,0 +1,38 @@
# In order to share the same source between multiple packages (.bb files), we
# unpack and patch the X source here into a shared dir.
#
# Take a look at gcc-source.inc for the general structure of this
# We require that "SOURCE_NAME" be set
# nopackages.bbclass {
deltask do_package
deltask do_package_write_rpm
deltask do_package_write_ipk
deltask do_package_write_deb
deltask do_package_qa
deltask do_packagedata
#}
deltask do_configure
deltask do_compile
deltask do_install
deltask do_populate_sysroot
deltask do_populate_lic
deltask do_rm_work
# override to get rid of '-native' or other misc
# XXX: consider ${PR}
PN = "${SOURCE_NAME}-source-${PV}"
WORKDIR = "${TMPDIR}/work-shared/${SOURCE_NAME}-${PV}-${PR}"
SSTATE_SWSPEC = "sstate:${SOURCE_NAME}::${PV}:${PR}::${SSTATE_VERSION}:"
STAMP = "${STAMPS_DIR}/work-shared/${SOURCE_NAME}-${PV}-${PR}"
STAMPCLEAN = "${STAMPS_DIR}/work-shared/${SOURCE_NAME}-${PV}-*"
INHIBIT_DEFAULT_DEPS = "1"
DEPENDS = ""
PACKAGES = ""
EXCLUDE_FROM_WORLD = "1"
+3
View File
@@ -0,0 +1,3 @@
S = "${TMPDIR}/work-shared/${SOURCE_NAME}-${PV}-${PR}"
do_unpack[depends] += "${SOURCE_NAME}-source-${PV}:do_patch"
@@ -1,6 +1,5 @@
# Build errors with PIE options enabled # Build errors with PIE options enabled
SECURITY_CFLAGS_pn-rust-native = "${SECURITY_NO_PIE_CFLAGS}" SECURITY_CFLAGS_pn-rust-native = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-rust-cross = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-rust-cross-${TARGET_ARCH} = "${SECURITY_NO_PIE_CFLAGS}" SECURITY_CFLAGS_pn-rust-cross-${TARGET_ARCH} = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-rust = "${SECURITY_NO_PIE_CFLAGS}" SECURITY_CFLAGS_pn-rust = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-rust-llvm = "${SECURITY_NO_PIE_CFLAGS}" SECURITY_CFLAGS_pn-rust-llvm = "${SECURITY_NO_PIE_CFLAGS}"
+28
View File
@@ -0,0 +1,28 @@
DESCRIPTION = "A (mostly) pure-Rust implementation of various common cryptographic algorithms."
HOMEPAGE = "https://github.com/DaGenix/rust-crypto/"
LICENSE = "MIT | Apache-2.0"
LIC_FILES_CHKSUM = "\
file://LICENSE-MIT;md5=4311034aa04489226c1fc3f816dbfb5a \
file://LICENSE-APACHE;md5=a02fef6dccf840318474c108a8281b77 \
"
DEPENDS = "\
libc-rs \
time-rs \
rand-rs \
rustc-serialize-rs \
"
inherit rust-bin
SRC_URI = "git://github.com/DaGenix/rust-crypto.git;protocol=https"
SRCREV = "5571cb41690b9cee12025192393ea7df0eddc21b"
S = "${WORKDIR}/git"
do_compile () {
oe_compile_rust_lib
}
do_install () {
oe_install_rust_lib
}
@@ -0,0 +1,19 @@
DESCRIPTION = "A copy of libstd's debug builders for use before they stabilize"
HOMEPAGE = "https://github.com/sfackler/rust-debug-builders"
LICENSE = "MIT | Apache-2.0"
LIC_FILES_CHKSUM = "file://Cargo.toml;md5=97a131dc4ae910d242387f2c9d1a2ce8"
inherit rust-bin
SRC_URI = "git://github.com/sfackler/rust-debug-builders.git;protocol=https"
SRCREV = "c6943b72c7808ddaa151d08b824525cc7420cb9b"
S = "${WORKDIR}/git"
do_compile () {
oe_compile_rust_lib
}
do_install () {
oe_install_rust_lib
}
+4 -2
View File
@@ -15,10 +15,12 @@ SRCREV = "8b7c17db2235a2a3f2c71242b11fc429a8d05a90"
S = "${WORKDIR}/git" S = "${WORKDIR}/git"
LIB_SRC = "${S}/src/liblibc/lib.rs"
do_compile () { do_compile () {
oe_runrustc ${S}/src/liblibc/lib.rs --cfg feature='"cargo-build"' oe_compile_rust_lib --cfg feature='"cargo-build"'
} }
do_install () { do_install () {
install -D -m 644 liblibc.rlib ${D}/${rustlibdir}/liblibc.rlib oe_install_rust_lib
} }
-3
View File
@@ -11,9 +11,6 @@ SRCREV = "a91e63378bf6f4bba5c7d88f4fe98efdcb432c99"
S = "${WORKDIR}/git" S = "${WORKDIR}/git"
# This module is tiny. One wrapper function only.
CRATE_TYPE = "rlib"
do_compile () { do_compile () {
oe_compile_rust_lib oe_compile_rust_lib
} }
+23
View File
@@ -0,0 +1,23 @@
DESCRIPTION = "Random number generators and other randomness functionality."
HOMEPAGE = "https://github.com/rust-lang/rand"
LICENSE = "MIT | Apache-2.0"
LIC_FILES_CHKSUM = "\
file://LICENSE-MIT;md5=362255802eb5aa87810d12ddf3cfedb4 \
file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \
"
DEPENDS = "libc-rs"
inherit rust-bin
SRC_URI = "git://github.com/rust-lang/rand.git;protocol=https"
SRCREV = "164659b01e6fdb4d9a8e52b7a7451e8174e91821"
S = "${WORKDIR}/git"
do_compile () {
oe_compile_rust_lib
}
do_install () {
oe_install_rust_lib
}
-2
View File
@@ -2,6 +2,4 @@ DESCRIPTION = "A regular expression parser"
require regex.inc require regex.inc
# Should only be used directly by regex
CRATE_TYPE = "rlib"
LIB_SRC = "${S}/regex-syntax/src/lib.rs" LIB_SRC = "${S}/regex-syntax/src/lib.rs"
@@ -0,0 +1,22 @@
DESCRIPTION = "Generic serialization/deserialization support"
HOMEPAGE = "https://github.com/rust-lang/rustc-serialize"
LICENSE = "MIT | Apache-2.0"
LIC_FILES_CHKSUM = "\
file://LICENSE-MIT;md5=362255802eb5aa87810d12ddf3cfedb4 \
file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \
"
inherit rust-bin
SRC_URI = "git://github.com/rust-lang/rustc-serialize.git;protocol=https"
SRCREV = "376f43a4b94dbe411bd9534ab83f02fbcb5a3b04"
S = "${WORKDIR}/git"
do_compile () {
oe_compile_rust_lib
}
do_install () {
oe_install_rust_lib
}
+4 -1
View File
@@ -15,7 +15,10 @@ SRCREV = "32b212b877b836dbfdc97af5674d91672e70ecbd"
S = "${WORKDIR}/git" S = "${WORKDIR}/git"
do_compile () { do_compile () {
oe_compile_rust_lib rm -rf time_helpers.o libtimehelpers.a
${CC} ${S}/src/time_helpers.c -fPIC -c -o time_helpers.o
${AR} rcs libtime_helpers.a time_helpers.o
oe_compile_rust_lib -L native=$PWD -l static=time_helpers
} }
do_install () { do_install () {
+22
View File
@@ -0,0 +1,22 @@
DESCRIPTION = "FFI bindings to libudev"
HOMEPAGE = "https://github.com/dcuddeback/libudev-sys"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=bbd2acd29c4ba5d4591b03e2757c04a3"
DEPENDS += "libudev-sys-rs"
DEPENDS += "libc-rs"
inherit rust-bin
SRC_URI = "git://github.com/dcuddeback/libudev-rs.git;protocol=https"
SRCREV = "3da791245f206d0cf5a856531c574b8646b0f059"
S = "${WORKDIR}/git"
do_compile () {
oe_compile_rust_lib
}
do_install () {
oe_install_rust_lib
}
@@ -12,7 +12,6 @@ SRCREV = "14c24afc61e3315dffddab2c7f36999a16a002d8"
S = "${WORKDIR}/git" S = "${WORKDIR}/git"
RUSTC_FLAGS += "-ludev" RUSTC_FLAGS += "-ludev"
CRATE_TYPE = "rlib"
do_compile () { do_compile () {
oe_compile_rust_lib oe_compile_rust_lib
+22
View File
@@ -0,0 +1,22 @@
DESCRIPTION = "FFI bindings to libudev"
HOMEPAGE = "https://github.com/dcuddeback/libudev-sys"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=bbd2acd29c4ba5d4591b03e2757c04a3"
DEPENDS = "libc-rs udev"
inherit rust-bin
SRC_URI = "git://github.com/dcuddeback/libudev-sys.git;protocol=https"
SRCREV = "c49163f87d4d109ec21bcf8f8c51db560ed31b22"
S = "${WORKDIR}/git"
RUSTC_FLAGS += "-ludev"
do_compile () {
oe_compile_rust_lib
}
do_install () {
oe_install_rust_lib
}
@@ -0,0 +1,20 @@
DESCRIPTION = "Unix domain socket bindings for Rust"
HOMEPAGE = "https://github.com/sfackler/rust-unix-socket"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=bde86283c1fd74e84ebc3cf6dd7011d0"
DEPENDS = "libc-rs debug-builders-rs"
inherit rust-bin
SRC_URI = "git://github.com/sfackler/rust-unix-socket.git;protocol=https"
SRCREV = "d0f47ae888267a718072c3be5eed42ba1f637097"
S = "${WORKDIR}/git"
do_compile () {
oe_compile_rust_lib
}
do_install () {
oe_install_rust_lib
}
-10
View File
@@ -1,10 +0,0 @@
LIC_FILES_CHKSUM = "file://COPYING;md5=34197a479f637beb9e09e56893f48bc2"
SRC_URI[md5sum] = "ade3b85d759866c03b6188e397b652fa"
SRC_URI[sha256sum] = "20c0a6ee92c0e19207dac6ddc336b4ae4a1c4ddf91be0891e4b6e6ccba16df0b"
require libgit2-release.inc
# Broken due to too old cargo using too old git2-rs
DEFAULT_PREFERENCE = "-1"
+4
View File
@@ -0,0 +1,4 @@
LIC_FILES_CHKSUM = "file://COPYING;md5=34197a479f637beb9e09e56893f48bc2"
SRC_URI[md5sum] = "b7db3ab71dfa19fe1dc7fef76d6af216"
SRC_URI[sha256sum] = "c7f5e2d7381dbc4d7e878013d14f9993ae8a41bd23f032718e39ffba57894029"
require libgit2-release.inc
+1
View File
@@ -1,3 +1,4 @@
require libgit2-git.inc require libgit2-git.inc
SRCREV ?= "47f37400253210f483d84fb9c2ecf44fb5986849" SRCREV ?= "47f37400253210f483d84fb9c2ecf44fb5986849"
LIC_FILES_CHKSUM = "file://COPYING;md5=5ddd5fb64b24982b32a490dccccdabc5" LIC_FILES_CHKSUM = "file://COPYING;md5=5ddd5fb64b24982b32a490dccccdabc5"
DEFAULT_PREFERENCE = "-1"
@@ -1,36 +0,0 @@
SUMMARY = "Cargo downloads your Rust project's dependencies and builds your project"
HOMEPAGE = "http://crates.io"
SECTION = "devel"
LICENSE = "MIT | Apache-2.0"
PR = "r2"
DEPENDS += "rust-native"
LIC_FILES_CHKSUM ="\
file://LICENSE-MIT;md5=362255802eb5aa87810d12ddf3cfedb4 \
file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \
file://LICENSE-THIRD-PARTY;md5=afbb7ae0aa70c8e437a007314eae5f3b \
"
SRC_URI = " \
https://static.rust-lang.org/cargo-dist/2015-04-02/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz \
"
SRC_URI[md5sum] = "3d62194d02a9088cd8aae379e9498134"
SRC_URI[sha256sum] = "16b6338ba2942989693984ba4dbd057c2801e8805e6da8fa7b781b00e722d117"
S = "${WORKDIR}/cargo-nightly-x86_64-unknown-linux-gnu/"
inherit native
do_install() {
install -d ${D}
sh ${S}/install.sh --destdir=${D}${STAGING_DIR_NATIVE} --prefix=
# Remove files provided by rust
rm -f ${D}${STAGING_DIR_NATIVE}/lib/rustlib/uninstall.sh
rm -f ${D}${STAGING_DIR_NATIVE}/lib/rustlib/install.log
rm -f ${D}${STAGING_DIR_NATIVE}/lib/rustlib/components
rm -f ${D}${STAGING_DIR_NATIVE}/lib/rustlib/rust-installer-version
}
@@ -0,0 +1,4 @@
CARGO_SNAPSHOT = "2016-01-31/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz"
SRC_URI[md5sum] = "52f48780b7cfadc88813766048d4d402"
SRC_URI[sha256sum] = "1920e661bab536eba763ff6704a1d62fb20bb0f67d8c5a119e41c49510ea5fa6"
+6 -12
View File
@@ -12,20 +12,9 @@ LICENSE = "MIT | Apache-2.0"
DEPENDS = "openssl zlib libgit2 curl ca-certificates libssh2" DEPENDS = "openssl zlib libgit2 curl ca-certificates libssh2"
SRC_URI = "\ SRC_URI = "\
git://github.com/rust-lang/cargo.git;protocol=https;name=cargo \
git://github.com/rust-lang/rust-installer.git;protocol=https;name=rust-installer;destsuffix=git/src/rust-installer \
http://static-rust-lang-org.s3.amazonaws.com/cargo-dist/${CARGO_SNAPSHOT} \ http://static-rust-lang-org.s3.amazonaws.com/cargo-dist/${CARGO_SNAPSHOT} \
" "
LIC_FILES_CHKSUM ="\
file://LICENSE-MIT;md5=362255802eb5aa87810d12ddf3cfedb4 \
file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \
file://LICENSE-THIRD-PARTY;md5=afbb7ae0aa70c8e437a007314eae5f3b \
"
SRCREV_FORMAT = "cargo_rust-installer"
PV .= "+git${SRCPV}"
S = "${WORKDIR}/git"
B = "${S}" B = "${S}"
PACKAGECONFIG ??= "" PACKAGECONFIG ??= ""
@@ -34,6 +23,9 @@ PACKAGECONFIG ??= ""
# & rust's use of cooked triples # & rust's use of cooked triples
PACKAGECONFIG[rust-snapshot] = "--local-rust-root=${B}/rustc" PACKAGECONFIG[rust-snapshot] = "--local-rust-root=${B}/rustc"
# Used in libgit2-sys's build.rs, needed for pkg-config to be used
export LIBGIT2_SYS_USE_PKG_CONFIG = "1"
do_configure () { do_configure () {
${@bb.utils.contains('PACKAGECONFIG', 'rust-snapshot', '${S}/.travis.install.deps.sh', ':', d)} ${@bb.utils.contains('PACKAGECONFIG', 'rust-snapshot', '${S}/.travis.install.deps.sh', ':', d)}
@@ -62,7 +54,7 @@ do_compile () {
rm -rf target/snapshot rm -rf target/snapshot
mkdir -p target mkdir -p target
cp -R ${WORKDIR}/$(basename ${CARGO_SNAPSHOT} .tar.gz) target/snapshot cp -R ${WORKDIR}/$(basename ${CARGO_SNAPSHOT} .tar.gz)/cargo target/snapshot
oe_runmake ARGS="--verbose" oe_runmake ARGS="--verbose"
} }
@@ -70,3 +62,5 @@ do_compile () {
do_install () { do_install () {
oe_runmake DESTDIR="${D}" install oe_runmake DESTDIR="${D}" install
} }
BBCLASSEXTEND = "native"
+57
View File
@@ -0,0 +1,57 @@
require cargo-snapshot.inc
require cargo.inc
SRC_URI += " \
https://github.com/rust-lang/cargo/archive/${PV}.tar.gz;name=cargo \
file://0001-disable-cargo-snapshot-fetch.patch \
git://github.com/rust-lang/rust-installer.git;protocol=https;name=rust-installer;destsuffix=${BP}/src/rust-installer \
"
SRC_URI[cargo.md5sum] = "2089790a4a48de7f8f3cb1afcfa9ec74"
SRC_URI[cargo.sha256sum] = "b1067d710e64b66a197294df2fa3dd4fb1d645171eaa517b93d42678bb687338"
SRCREV_rust-installer = "c37d3747da75c280237dc2d6b925078e69555499"
S = "${WORKDIR}/${BP}"
LIC_FILES_CHKSUM ="\
file://LICENSE-MIT;md5=362255802eb5aa87810d12ddf3cfedb4 \
file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \
file://LICENSE-THIRD-PARTY;md5=892ea68b169e69cfe75097fc38a15b56 \
"
## curl-rust
SRC_URI += "\
git://github.com/carllerche/curl-rust.git;protocol=https;destsuffix=curl-rust;name=curl-rust \
file://curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.patch;patchdir=../curl-rust \
file://curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch;patchdir=../curl-rust \
"
# 0.2.14 / -sys 0.1.29
SRCREV_curl-rust = "76172b3ebf958fcf0b10d400f19ee02486a80ee7"
SRCREV_FORMAT .= "_curl-rust"
EXTRA_OECARGO_PATHS += "${WORKDIR}/curl-rust"
## ssh2-rs
SRC_URI += "\
git://github.com/alexcrichton/ssh2-rs.git;protocol=https;name=ssh2-rs;destsuffix=ssh2-rs \
file://ssh2-rs/0001-libssh2-sys-avoid-explicitly-linking-in-openssl.patch;patchdir=../ssh2-rs \
"
# 0.2.10 / -sys 0.1.34
SRCREV_ssh2-rs = "00af6ead0c3d4b82e05bee4d9963ef3823bcf524"
SRCREV_FORMAT .= "_ssh2-rs"
EXTRA_OECARGO_PATHS += "${WORKDIR}/ssh2-rs"
## git2-rs
SRC_URI += "\
git://github.com/alexcrichton/git2-rs.git;protocol=https;name=git2-rs;destsuffix=git2-rs \
file://git2-rs/0001-libgit2-sys-avoid-blessed-triples.patch;patchdir=../git2-rs \
"
# 0.3.3 / -sys 0.3.8
SRCREV_git2-rs = "19b6873c1fad7dc93c9c2dac4cba339dacf16efa"
SRCREV_FORMAT .= "_git2-rs"
EXTRA_OECARGO_PATHS += "${WORKDIR}/git2-rs"
-51
View File
@@ -1,51 +0,0 @@
# 2015-06-29
SRCREV_cargo = "339a103fa71701541229316a568fca12cf07fc8d"
SRCREV_rust-installer = "8e4f8ea581502a2edc8177a040300e05ff7f91e3"
require cargo.inc
SRC_URI += " \
git://github.com/carllerche/curl-rust.git;protocol=https;destsuffix=curl-rust;name=curl-rust \
file://curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.-If-it-.patch;patchdir=../curl-rust \
file://curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch;patchdir=../curl-rust \
\
git://github.com/alexcrichton/ssh2-rs.git;protocol=https;name=ssh2-rs;destsuffix=ssh2-rs \
file://ssh2-rs/0001-Unconditionally-depend-on-openssl-sys.patch;patchdir=../ssh2-rs \
\
git://github.com/alexcrichton/git2-rs.git;protocol=https;name=git2-rs;destsuffix=git2-rs \
file://git2-rs/0001-Add-generic-openssl-sys-dep.patch;patchdir=../git2-rs \
"
# 0.2.10 / -sys 0.1.24
SRCREV_curl-rust = "9fbf39fa8765e777d110ad18a2a2a3ea42dcb717"
# 0.2.8 / -sys 0.1.25
SRCREV_ssh2-rs = "afc39c6e7236b87d7ebde21ee4d4743d9437b85f"
# 0.2.11 / -sys 0.2.14
SRCREV_git2-rs = "3a7a990607a766fa65a40b920d70c8289691d2f8"
SRCREV_FORMAT .= "_curl-rust_curl_ssh2-rs_git2-rs"
EXTRA_OECARGO_PATHS = "\
${WORKDIR}/curl-rust \
${WORKDIR}/ssh2-rs \
${WORKDIR}/git2-rs \
"
CARGO_SNAPSHOT = "2015-04-02/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz"
SRC_URI[md5sum] = "3d62194d02a9088cd8aae379e9498134"
SRC_URI[sha256sum] = "16b6338ba2942989693984ba4dbd057c2801e8805e6da8fa7b781b00e722d117"
# Used in libgit2-sys's build.rs, needed for pkg-config to be used
export LIBGIT2_SYS_USE_PKG_CONFIG = "1"
# FIXME: we don't actually use these, and shouldn't need to fetch it, but not having it results in:
## target/snapshot/bin/cargo build --target x86_64-linux --verbose
## Failed to resolve path '/home/cody/obj/y/tmp/work/x86_64-linux/cargo-native/git+gitAUTOINC+0b84923203_9181ea8f4e_8baa8ccb39-r0/curl-rust/curl-sys/curl/.git': No such file or directory
SRC_URI += "\
git://github.com/alexcrichton/curl.git;protocol=https;destsuffix=curl-rust/curl-sys/curl;name=curl;branch=configure \
git://github.com/libgit2/libgit2.git;protocol=https;destsuffix=git2-rs/libgit2-sys/libgit2;name=libgit2 \
"
SRCREV_curl = "9a300aa13e5035a795396e429aa861229424c9dc"
SRCREV_libgit2 = "47f37400253210f483d84fb9c2ecf44fb5986849"
@@ -0,0 +1,27 @@
From 9652ddba460f30e83f401ab1564656e7787bdea9 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Wed, 3 Feb 2016 15:59:48 -0500
Subject: [PATCH] disable cargo snapshot fetch
---
Makefile.in | 4 ----
1 file changed, 4 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 286a593..9c66486 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -92,10 +92,6 @@ test-unit-$(1): $$(CARGO)
endef
$(foreach target,$(CFG_TARGET),$(eval $(call CARGO_TARGET,$(target))))
-$(TARGET_ROOT)/snapshot/bin/cargo$(X): src/snapshots.txt
- $(CFG_PYTHON) src/etc/dl-snapshot.py $(CFG_BUILD)
- touch $@
-
# === Tests
--
2.7.0
@@ -1,906 +0,0 @@
From d122d57536df9fbfcdfda08b2918dc6e0c6209c0 Mon Sep 17 00:00:00 2001
From: Andrew Paseltiner <apaseltiner@gmail.com>
Date: Thu, 12 Feb 2015 23:10:07 -0500
Subject: [PATCH] update Rust
---
Cargo.lock | 32 ++++++++++++------------
src/bin/build.rs | 4 +--
src/bin/cargo.rs | 2 +-
src/bin/clean.rs | 4 +--
src/bin/generate_lockfile.rs | 4 +--
src/bin/new.rs | 4 +--
src/bin/update.rs | 4 +--
src/bin/verify_project.rs | 4 +--
src/bin/version.rs | 4 +--
src/cargo/lib.rs | 2 +-
src/cargo/ops/cargo_new.rs | 4 +--
src/cargo/ops/cargo_rustc/engine.rs | 2 +-
src/cargo/ops/registry.rs | 4 +--
src/cargo/sources/git/utils.rs | 3 ++-
src/cargo/util/config.rs | 2 +-
src/cargo/util/hex.rs | 5 ++--
src/cargo/util/profile.rs | 2 +-
src/rustversion.txt | 2 +-
tests/support/mod.rs | 2 +-
tests/test_cargo.rs | 2 +-
tests/test_cargo_compile.rs | 10 ++++----
tests/test_cargo_compile_custom_build.rs | 42 ++++++++++++++++----------------
tests/test_cargo_compile_git_deps.rs | 24 +++++++++---------
tests/test_cargo_compile_plugins.rs | 6 ++---
tests/test_cargo_cross_compile.rs | 28 ++++++++++-----------
tests/test_cargo_profiles.rs | 6 ++---
26 files changed, 103 insertions(+), 105 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 14dd876..629585c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,7 +4,7 @@ version = "0.1.0"
dependencies = [
"advapi32-sys 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"curl 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "docopt 0.6.36 (registry+https://github.com/rust-lang/crates.io-index)",
+ "docopt 0.6.37 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"git2 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -18,8 +18,8 @@ dependencies = [
"semver 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"tar 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
- "toml 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "toml 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -44,7 +44,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"curl-sys 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -55,13 +55,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "docopt"
-version = "0.6.36"
+version = "0.6.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"regex 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -97,7 +97,7 @@ version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libgit2-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libgit2-sys 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -136,13 +136,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libgit2-sys"
-version = "0.1.12"
+version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libssh2-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -159,7 +159,7 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -192,12 +192,12 @@ dependencies = [
[[package]]
name = "openssl-sys"
-version = "0.3.3"
+version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"libressl-pnacl-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -207,7 +207,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "pkg-config"
-version = "0.2.0"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@@ -255,7 +255,7 @@ dependencies = [
[[package]]
name = "time"
-version = "0.1.16"
+version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -264,7 +264,7 @@ dependencies = [
[[package]]
name = "toml"
-version = "0.1.16"
+version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/src/bin/build.rs b/src/bin/build.rs
index a617f64..0784c04 100644
--- a/src/bin/build.rs
+++ b/src/bin/build.rs
@@ -1,4 +1,4 @@
-use std::os;
+use std::env;
use cargo::ops::CompileOptions;
use cargo::ops;
@@ -47,7 +47,7 @@ the --release flag will use the `release` profile instead.
";
pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
- debug!("executing; cmd=cargo-build; args={:?}", os::args());
+ debug!("executing; cmd=cargo-build; args={:?}", env::args().collect::<Vec<_>>());
config.shell().set_verbose(options.flag_verbose);
let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path));
diff --git a/src/bin/cargo.rs b/src/bin/cargo.rs
index 7bf0a11..53c904d 100644
--- a/src/bin/cargo.rs
+++ b/src/bin/cargo.rs
@@ -245,7 +245,7 @@ fn list_command_directory() -> Vec<Path> {
dirs.push(path.join("../lib/cargo"));
dirs.push(path);
}
- if let Some(val) = env::var("PATH") {
+ if let Some(val) = env::var_os("PATH") {
dirs.extend(env::split_paths(&val));
}
dirs
diff --git a/src/bin/clean.rs b/src/bin/clean.rs
index dcc013e..a530b9b 100644
--- a/src/bin/clean.rs
+++ b/src/bin/clean.rs
@@ -1,4 +1,4 @@
-use std::os;
+use std::env;
use cargo::ops;
use cargo::util::{CliResult, CliError, Config};
@@ -33,7 +33,7 @@ and its format, see the `cargo help pkgid` command.
pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
config.shell().set_verbose(options.flag_verbose);
- debug!("executing; cmd=cargo-clean; args={:?}", os::args());
+ debug!("executing; cmd=cargo-clean; args={:?}", env::args().collect::<Vec<_>>());
let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path));
let opts = ops::CleanOptions {
diff --git a/src/bin/generate_lockfile.rs b/src/bin/generate_lockfile.rs
index a350ab6..d9777ef 100644
--- a/src/bin/generate_lockfile.rs
+++ b/src/bin/generate_lockfile.rs
@@ -1,4 +1,4 @@
-use std::os;
+use std::env;
use cargo::ops;
use cargo::util::{CliResult, CliError, Config};
@@ -23,7 +23,7 @@ Options:
";
pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
- debug!("executing; cmd=cargo-generate-lockfile; args={:?}", os::args());
+ debug!("executing; cmd=cargo-generate-lockfile; args={:?}", env::args().collect::<Vec<_>>());
config.shell().set_verbose(options.flag_verbose);
let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path));
diff --git a/src/bin/new.rs b/src/bin/new.rs
index 4126e38..0abff6a 100644
--- a/src/bin/new.rs
+++ b/src/bin/new.rs
@@ -1,4 +1,4 @@
-use std::os;
+use std::env;
use cargo::ops;
use cargo::util::{CliResult, CliError, Config};
@@ -28,7 +28,7 @@ Options:
";
pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
- debug!("executing; cmd=cargo-new; args={:?}", os::args());
+ debug!("executing; cmd=cargo-new; args={:?}", env::args().collect::<Vec<_>>());
config.shell().set_verbose(options.flag_verbose);
let Options { flag_bin, arg_path, flag_vcs, .. } = options;
diff --git a/src/bin/update.rs b/src/bin/update.rs
index fa75506..4fdeebf 100644
--- a/src/bin/update.rs
+++ b/src/bin/update.rs
@@ -1,4 +1,4 @@
-use std::os;
+use std::env;
use cargo::ops;
use cargo::util::{CliResult, CliError, Config};
@@ -49,7 +49,7 @@ For more information about package id specifications, see `cargo help pkgid`.
";
pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
- debug!("executing; cmd=cargo-update; args={:?}", os::args());
+ debug!("executing; cmd=cargo-update; args={:?}", env::args().collect::<Vec<_>>());
config.shell().set_verbose(options.flag_verbose);
let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path));
diff --git a/src/bin/verify_project.rs b/src/bin/verify_project.rs
index 54f8d6e..816c5e9 100644
--- a/src/bin/verify_project.rs
+++ b/src/bin/verify_project.rs
@@ -1,8 +1,8 @@
extern crate toml;
use std::collections::HashMap;
+use std::env;
use std::old_io::File;
-use std::os;
use cargo::util::{CliResult, Config};
@@ -47,6 +47,6 @@ pub fn execute(args: Flags, config: &Config) -> CliResult<Option<Error>> {
fn fail(reason: &str, value: &str) -> CliResult<Option<Error>>{
let mut h = HashMap::new();
h.insert(reason.to_string(), value.to_string());
- os::set_exit_status(1);
+ env::set_exit_status(1);
Ok(Some(h))
}
diff --git a/src/bin/version.rs b/src/bin/version.rs
index e1bc011..b5622f2 100644
--- a/src/bin/version.rs
+++ b/src/bin/version.rs
@@ -1,4 +1,4 @@
-use std::os;
+use std::env;
use cargo;
use cargo::util::{CliResult, Config};
@@ -16,7 +16,7 @@ Options:
";
pub fn execute(_: Options, _: &Config) -> CliResult<Option<()>> {
- debug!("executing; cmd=cargo-version; args={:?}", os::args());
+ debug!("executing; cmd=cargo-version; args={:?}", env::args().collect::<Vec<_>>());
println!("{}", cargo::version());
diff --git a/src/cargo/lib.rs b/src/cargo/lib.rs
index 609e1bd..d5737ef 100644
--- a/src/cargo/lib.rs
+++ b/src/cargo/lib.rs
@@ -95,7 +95,7 @@ fn process<V, F>(mut callback: F)
let mut shell = shell(true);
process_executed((|| {
let config = try!(Config::new(&mut shell));
- let args: Vec<_> = try!(env::args().map(|s| {
+ let args: Vec<_> = try!(env::args_os().map(|s| {
s.into_string().map_err(|s| {
human(format!("invalid unicode in argument: {:?}", s))
})
diff --git a/src/cargo/ops/cargo_new.rs b/src/cargo/ops/cargo_new.rs
index 09d8318..ae9d5e5 100644
--- a/src/cargo/ops/cargo_new.rs
+++ b/src/cargo/ops/cargo_new.rs
@@ -134,8 +134,8 @@ fn discover_author() -> CargoResult<(String, Option<String>)> {
let git_config = git_config.as_ref();
let name = git_config.and_then(|g| g.get_str("user.name").ok())
.map(|s| s.to_string())
- .or_else(|| env::var_string("USER").ok()) // unix
- .or_else(|| env::var_string("USERNAME").ok()); // windows
+ .or_else(|| env::var("USER").ok()) // unix
+ .or_else(|| env::var("USERNAME").ok()); // windows
let name = match name {
Some(name) => name,
None => {
diff --git a/src/cargo/ops/cargo_rustc/engine.rs b/src/cargo/ops/cargo_rustc/engine.rs
index 5c6a0ef..9d234f8 100644
--- a/src/cargo/ops/cargo_rustc/engine.rs
+++ b/src/cargo/ops/cargo_rustc/engine.rs
@@ -85,7 +85,7 @@ impl CommandPrototype {
pub fn get_env(&self, var: &str) -> Option<CString> {
self.env.get(var).cloned().or_else(|| {
- Some(env::var_string(var).ok().map(|s| CString::from_vec(s.into_bytes())))
+ Some(env::var(var).ok().map(|s| CString::from_vec(s.into_bytes())))
}).and_then(|val| val)
}
diff --git a/src/cargo/ops/registry.rs b/src/cargo/ops/registry.rs
index 2461981..59754f2 100644
--- a/src/cargo/ops/registry.rs
+++ b/src/cargo/ops/registry.rs
@@ -191,7 +191,7 @@ pub fn http_proxy(config: &Config) -> CargoResult<Option<String>> {
}
Err(..) => {}
}
- Ok(env::var_string("HTTP_PROXY").ok())
+ Ok(env::var("HTTP_PROXY").ok())
}
pub fn http_timeout(config: &Config) -> CargoResult<Option<i64>> {
@@ -199,7 +199,7 @@ pub fn http_timeout(config: &Config) -> CargoResult<Option<i64>> {
Some((s, _)) => return Ok(Some(s)),
None => {}
}
- Ok(env::var_string("HTTP_TIMEOUT").ok().and_then(|s| s.parse().ok()))
+ Ok(env::var("HTTP_TIMEOUT").ok().and_then(|s| s.parse().ok()))
}
pub fn registry_login(config: &Config, token: String) -> CargoResult<()> {
diff --git a/src/cargo/sources/git/utils.rs b/src/cargo/sources/git/utils.rs
index 898f082..9861ed6 100644
--- a/src/cargo/sources/git/utils.rs
+++ b/src/cargo/sources/git/utils.rs
@@ -308,7 +308,8 @@ impl<'a> GitCheckout<'a> {
// as the submodule's head, then we can bail out and go to the
// next submodule.
let head_and_repo = child.open().and_then(|repo| {
- Ok((try!(repo.head()).target(), repo))
+ let target = try!(repo.head()).target();
+ Ok((target, repo))
});
let repo = match head_and_repo {
Ok((head, repo)) => {
diff --git a/src/cargo/util/config.rs b/src/cargo/util/config.rs
index 217d028..076e68d 100644
--- a/src/cargo/util/config.rs
+++ b/src/cargo/util/config.rs
@@ -380,7 +380,7 @@ impl ConfigValue {
}
fn homedir() -> Option<Path> {
- let cargo_home = env::var_string("CARGO_HOME").map(|p| Path::new(p)).ok();
+ let cargo_home = env::var("CARGO_HOME").map(|p| Path::new(p)).ok();
let user_home = env::home_dir().map(|p| p.join(".cargo"));
return cargo_home.or(user_home);
}
diff --git a/src/cargo/util/hex.rs b/src/cargo/util/hex.rs
index 2bce7ea..3e8d962 100644
--- a/src/cargo/util/hex.rs
+++ b/src/cargo/util/hex.rs
@@ -1,12 +1,11 @@
-use std::old_io::MemWriter;
use std::hash::{Hasher, Hash, SipHasher};
use rustc_serialize::hex::ToHex;
pub fn to_hex(num: u64) -> String {
- let mut writer = MemWriter::with_capacity(8);
+ let mut writer = Vec::with_capacity(8);
writer.write_le_u64(num).unwrap(); // this should never fail
- writer.get_ref().to_hex()
+ writer.to_hex()
}
pub fn short_hash<H: Hash<SipHasher>>(hashable: &H) -> String {
diff --git a/src/cargo/util/profile.rs b/src/cargo/util/profile.rs
index 9d19c36..100fd2c 100644
--- a/src/cargo/util/profile.rs
+++ b/src/cargo/util/profile.rs
@@ -14,7 +14,7 @@ pub struct Profiler {
desc: String,
}
-fn enabled() -> bool { env::var("CARGO_PROFILE").is_some() }
+fn enabled() -> bool { env::var_os("CARGO_PROFILE").is_some() }
pub fn start<T: fmt::Display>(desc: T) -> Profiler {
if !enabled() { return Profiler { desc: String::new() } }
diff --git a/src/rustversion.txt b/src/rustversion.txt
index e2a057d..17cae77 100644
--- a/src/rustversion.txt
+++ b/src/rustversion.txt
@@ -1 +1 @@
-2015-02-09
+2015-02-12
diff --git a/tests/support/mod.rs b/tests/support/mod.rs
index 83be295..7c10756 100644
--- a/tests/support/mod.rs
+++ b/tests/support/mod.rs
@@ -227,7 +227,7 @@ impl<T, E: fmt::Display> ErrMsg<T> for Result<T, E> {
// Path to cargo executables
pub fn cargo_dir() -> Path {
- env::var_string("CARGO_BIN_PATH").map(Path::new).ok()
+ env::var("CARGO_BIN_PATH").map(Path::new).ok()
.or_else(|| env::current_exe().ok().map(|s| s.dir_path()))
.unwrap_or_else(|| {
panic!("CARGO_BIN_PATH wasn't set. Cannot continue running test")
diff --git a/tests/test_cargo.rs b/tests/test_cargo.rs
index b4b1abd..64e4c75 100644
--- a/tests/test_cargo.rs
+++ b/tests/test_cargo.rs
@@ -25,7 +25,7 @@ fn fake_executable(proj: ProjectBuilder, dir: &Path, name: &str) -> ProjectBuild
}
fn path() -> Vec<Path> {
- env::split_paths(&env::var("PATH").unwrap_or(OsString::new())).collect()
+ env::split_paths(&env::var_os("PATH").unwrap_or(OsString::new())).collect()
}
test!(list_commands_looks_at_path {
diff --git a/tests/test_cargo_compile.rs b/tests/test_cargo_compile.rs
index 20fcab8..9c5b934 100644
--- a/tests/test_cargo_compile.rs
+++ b/tests/test_cargo_compile.rs
@@ -1259,7 +1259,7 @@ test!(freshness_ignores_excluded {
exclude = ["src/b*.rs"]
"#)
.file("build.rs", "fn main() {}")
- .file("src/lib.rs", "pub fn bar() -> int { 1 }");
+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }");
foo.build();
foo.root().move_into_the_past().unwrap();
@@ -1297,15 +1297,15 @@ test!(rebuild_preserves_out_dir {
use std::old_io::File;
fn main() {
- let path = Path::new(env::var_string("OUT_DIR").unwrap()).join("foo");
- if env::var("FIRST").is_some() {
+ let path = Path::new(env::var("OUT_DIR").unwrap()).join("foo");
+ if env::var_os("FIRST").is_some() {
File::create(&path).unwrap();
} else {
File::create(&path).unwrap();
}
}
"#)
- .file("src/lib.rs", "pub fn bar() -> int { 1 }");
+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }");
foo.build();
foo.root().move_into_the_past().unwrap();
@@ -1335,7 +1335,7 @@ test!(dep_no_libs {
[dependencies.bar]
path = "bar"
"#)
- .file("src/lib.rs", "pub fn bar() -> int { 1 }")
+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }")
.file("bar/Cargo.toml", r#"
[package]
name = "bar"
diff --git a/tests/test_cargo_compile_custom_build.rs b/tests/test_cargo_compile_custom_build.rs
index b110b86..4ef727b 100644
--- a/tests/test_cargo_compile_custom_build.rs
+++ b/tests/test_cargo_compile_custom_build.rs
@@ -79,32 +79,32 @@ test!(custom_build_env_vars {
use std::env;
use std::old_io::fs::PathExtensions;
fn main() {{
- let _target = env::var_string("TARGET").unwrap();
+ let _target = env::var("TARGET").unwrap();
- let _ncpus = env::var_string("NUM_JOBS").unwrap();
+ let _ncpus = env::var("NUM_JOBS").unwrap();
- let out = env::var_string("CARGO_MANIFEST_DIR").unwrap();
+ let out = env::var("CARGO_MANIFEST_DIR").unwrap();
let p1 = Path::new(out);
let cwd = env::current_dir().unwrap();
let p2 = cwd.join(Path::new(file!()).dir_path().dir_path());
assert!(p1 == p2, "{{}} != {{}}", p1.display(), p2.display());
- let opt = env::var_string("OPT_LEVEL").unwrap();
+ let opt = env::var("OPT_LEVEL").unwrap();
assert_eq!(opt.as_slice(), "0");
- let opt = env::var_string("PROFILE").unwrap();
+ let opt = env::var("PROFILE").unwrap();
assert_eq!(opt.as_slice(), "compile");
- let debug = env::var_string("DEBUG").unwrap();
+ let debug = env::var("DEBUG").unwrap();
assert_eq!(debug.as_slice(), "true");
- let out = env::var_string("OUT_DIR").unwrap();
+ let out = env::var("OUT_DIR").unwrap();
assert!(out.as_slice().starts_with(r"{0}"));
assert!(Path::new(out).is_dir());
- let _host = env::var_string("HOST").unwrap();
+ let _host = env::var("HOST").unwrap();
- let _feat = env::var_string("CARGO_FEATURE_FOO").unwrap();
+ let _feat = env::var("CARGO_FEATURE_FOO").unwrap();
}}
"#,
p.root().join("target").join("build").display());
@@ -269,8 +269,8 @@ test!(overrides_and_links {
.file("build.rs", r#"
use std::env;
fn main() {
- assert_eq!(env::var_string("DEP_FOO_FOO").unwrap().as_slice(), "bar");
- assert_eq!(env::var_string("DEP_FOO_BAR").unwrap().as_slice(), "baz");
+ assert_eq!(env::var("DEP_FOO_FOO").unwrap().as_slice(), "bar");
+ assert_eq!(env::var("DEP_FOO_BAR").unwrap().as_slice(), "baz");
}
"#)
.file(".cargo/config", format!(r#"
@@ -342,8 +342,8 @@ test!(links_passes_env_vars {
.file("build.rs", r#"
use std::env;
fn main() {
- assert_eq!(env::var_string("DEP_FOO_FOO").unwrap().as_slice(), "bar");
- assert_eq!(env::var_string("DEP_FOO_BAR").unwrap().as_slice(), "baz");
+ assert_eq!(env::var("DEP_FOO_FOO").unwrap().as_slice(), "bar");
+ assert_eq!(env::var("DEP_FOO_BAR").unwrap().as_slice(), "baz");
}
"#)
.file("a/Cargo.toml", r#"
@@ -441,8 +441,8 @@ test!(rebuild_continues_to_pass_env_vars {
.file("build.rs", r#"
use std::env;
fn main() {
- assert_eq!(env::var_string("DEP_FOO_FOO").unwrap().as_slice(), "bar");
- assert_eq!(env::var_string("DEP_FOO_BAR").unwrap().as_slice(), "baz");
+ assert_eq!(env::var("DEP_FOO_FOO").unwrap().as_slice(), "bar");
+ assert_eq!(env::var("DEP_FOO_BAR").unwrap().as_slice(), "baz");
}
"#);
@@ -727,7 +727,7 @@ test!(out_dir_is_preserved {
use std::env;
use std::old_io::File;
fn main() {
- let out = env::var_string("OUT_DIR").unwrap();
+ let out = env::var("OUT_DIR").unwrap();
File::create(&Path::new(out).join("foo")).unwrap();
}
"#);
@@ -742,7 +742,7 @@ test!(out_dir_is_preserved {
use std::env;
use std::old_io::File;
fn main() {
- let out = env::var_string("OUT_DIR").unwrap();
+ let out = env::var("OUT_DIR").unwrap();
File::open(&Path::new(out).join("foo")).unwrap();
}
"#).unwrap();
@@ -808,7 +808,7 @@ test!(code_generation {
use std::old_io::File;
fn main() {
- let dst = Path::new(env::var_string("OUT_DIR").unwrap());
+ let dst = Path::new(env::var("OUT_DIR").unwrap());
let mut f = File::create(&dst.join("hello.rs")).unwrap();
f.write_str("
pub fn message() -> &'static str {
@@ -972,9 +972,9 @@ test!(test_a_lib_with_a_build_command {
use std::old_io::File;
fn main() {
- let out = Path::new(env::var_string("OUT_DIR").unwrap());
+ let out = Path::new(env::var("OUT_DIR").unwrap());
File::create(&out.join("foo.rs")).write_str("
- fn foo() -> int { 1 }
+ fn foo() -> i32 { 1 }
").unwrap();
}
"#);
@@ -1062,7 +1062,7 @@ test!(build_script_with_dynamic_native_dependency {
use std::env;
fn main() {
- let src = Path::new(env::var_string("SRC").unwrap());
+ let src = Path::new(env::var("SRC").unwrap());
println!("cargo:rustc-flags=-L {}", src.dir_path().display());
}
"#)
diff --git a/tests/test_cargo_compile_git_deps.rs b/tests/test_cargo_compile_git_deps.rs
index 5777e1a..11a152f 100644
--- a/tests/test_cargo_compile_git_deps.rs
+++ b/tests/test_cargo_compile_git_deps.rs
@@ -461,7 +461,7 @@ test!(two_revs_same_deps {
version = "0.0.0"
authors = []
"#)
- .file("src/lib.rs", "pub fn bar() -> int { 1 }")
+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }")
}).unwrap();
let repo = git2::Repository::open(&bar.root()).unwrap();
@@ -469,7 +469,7 @@ test!(two_revs_same_deps {
// Commit the changes and make sure we trigger a recompile
File::create(&bar.root().join("src/lib.rs")).write_str(r#"
- pub fn bar() -> int { 2 }
+ pub fn bar() -> i32 { 2 }
"#).unwrap();
add(&repo);
let rev2 = commit(&repo);
@@ -511,7 +511,7 @@ test!(two_revs_same_deps {
"#, bar.url(), rev2).as_slice())
.file("src/lib.rs", r#"
extern crate bar;
- pub fn baz() -> int { bar::bar() }
+ pub fn baz() -> i32 { bar::bar() }
"#);
baz.build();
@@ -860,7 +860,7 @@ test!(stale_cached_version {
version = "0.0.0"
authors = []
"#)
- .file("src/lib.rs", "pub fn bar() -> int { 1 }")
+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }")
}).unwrap();
// Update the git database in the cache with the current state of the git
@@ -887,7 +887,7 @@ test!(stale_cached_version {
// Update the repo, and simulate someone else updating the lockfile and then
// us pulling it down.
File::create(&bar.root().join("src/lib.rs")).write_str(r#"
- pub fn bar() -> int { 1 + 0 }
+ pub fn bar() -> i32 { 1 + 0 }
"#).unwrap();
let repo = git2::Repository::open(&bar.root()).unwrap();
add(&repo);
@@ -1090,7 +1090,7 @@ test!(git_build_cmd_freshness {
build = "build.rs"
"#)
.file("build.rs", "fn main() {}")
- .file("src/lib.rs", "pub fn bar() -> int { 1 }")
+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }")
.file(".gitignore", "
src/bar.rs
")
@@ -1166,7 +1166,7 @@ test!(git_repo_changing_no_rebuild {
version = "0.5.0"
authors = ["wycats@example.com"]
"#)
- .file("src/lib.rs", "pub fn bar() -> int { 1 }")
+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }")
}).unwrap();
// Lock p1 to the first rev in the git repo
@@ -1193,7 +1193,7 @@ test!(git_repo_changing_no_rebuild {
// Make a commit to lock p2 to a different rev
File::create(&bar.root().join("src/lib.rs")).write_str(r#"
- pub fn bar() -> int { 2 }
+ pub fn bar() -> i32 { 2 }
"#).unwrap();
let repo = git2::Repository::open(&bar.root()).unwrap();
add(&repo);
@@ -1256,7 +1256,7 @@ test!(git_dep_build_cmd {
name = "bar"
"#)
.file("bar/src/bar.rs.in", r#"
- pub fn gimme() -> int { 0 }
+ pub fn gimme() -> i32 { 0 }
"#)
.file("bar/build.rs", r#"
use std::old_io::fs;
@@ -1278,7 +1278,7 @@ test!(git_dep_build_cmd {
// Touching bar.rs.in should cause the `build` command to run again.
let mut file = fs::File::create(&p.root().join("bar/src/bar.rs.in")).unwrap();
- file.write_str(r#"pub fn gimme() -> int { 1 }"#).unwrap();
+ file.write_str(r#"pub fn gimme() -> i32 { 1 }"#).unwrap();
drop(file);
assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
@@ -1297,7 +1297,7 @@ test!(fetch_downloads {
version = "0.5.0"
authors = ["wycats@example.com"]
"#)
- .file("src/lib.rs", "pub fn bar() -> int { 1 }")
+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }")
}).unwrap();
let p = project("p1")
@@ -1569,7 +1569,7 @@ test!(update_one_source_updates_all_packages_in_that_git_source {
// Just be sure to change a file
File::create(&dep.root().join("src/lib.rs")).write_str(r#"
- pub fn bar() -> int { 2 }
+ pub fn bar() -> i32 { 2 }
"#).unwrap();
add(&repo);
commit(&repo);
diff --git a/tests/test_cargo_compile_plugins.rs b/tests/test_cargo_compile_plugins.rs
index 853038f..ca44a4d 100644
--- a/tests/test_cargo_compile_plugins.rs
+++ b/tests/test_cargo_compile_plugins.rs
@@ -23,14 +23,14 @@ test!(plugin_to_the_max {
"#)
.file("src/main.rs", r#"
#![feature(plugin)]
- #[plugin] #[no_link] extern crate bar;
+ #![plugin(bar)]
extern crate foo_lib;
fn main() { foo_lib::foo(); }
"#)
.file("src/foo_lib.rs", r#"
#![feature(plugin)]
- #[plugin] #[no_link] extern crate bar;
+ #![plugin(bar)]
pub fn foo() {}
"#);
@@ -122,7 +122,7 @@ test!(plugin_with_dynamic_native_dependency {
"#)
.file("src/main.rs", r#"
#![feature(plugin)]
- #[plugin] #[no_link] extern crate bar;
+ #![plugin(bar)]
fn main() {}
"#)
diff --git a/tests/test_cargo_cross_compile.rs b/tests/test_cargo_cross_compile.rs
index a2d53e0..cf6b9a5 100644
--- a/tests/test_cargo_cross_compile.rs
+++ b/tests/test_cargo_cross_compile.rs
@@ -12,7 +12,7 @@ fn setup() {
fn disabled() -> bool {
// First, disable if ./configure requested so
- match env::var_string("CFG_DISABLE_CROSS_TESTS") {
+ match env::var("CFG_DISABLE_CROSS_TESTS") {
Ok(ref s) if s.as_slice() == "1" => return true,
_ => {}
}
@@ -44,7 +44,7 @@ test!(simple_cross {
"#)
.file("build.rs", format!(r#"
fn main() {{
- assert_eq!(std::env::var_string("TARGET").unwrap().as_slice(), "{}");
+ assert_eq!(std::env::var("TARGET").unwrap().as_slice(), "{}");
}}
"#, alternate()).as_slice())
.file("src/main.rs", r#"
@@ -119,8 +119,7 @@ test!(plugin_deps {
"#)
.file("src/main.rs", r#"
#![feature(plugin)]
- #[plugin] #[no_link]
- extern crate bar;
+ #![plugin(bar)]
extern crate baz;
fn main() {
assert_eq!(bar!(), baz::baz());
@@ -155,7 +154,7 @@ test!(plugin_deps {
fn expand_bar(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])
-> Box<MacResult + 'static> {
- MacExpr::new(quote_expr!(cx, 1i))
+ MacExpr::new(quote_expr!(cx, 1))
}
"#);
let baz = project("baz")
@@ -165,7 +164,7 @@ test!(plugin_deps {
version = "0.0.1"
authors = []
"#)
- .file("src/lib.rs", "pub fn baz() -> int { 1 }");
+ .file("src/lib.rs", "pub fn baz() -> i32 { 1 }");
bar.build();
baz.build();
@@ -197,8 +196,7 @@ test!(plugin_to_the_max {
"#)
.file("src/main.rs", r#"
#![feature(plugin)]
- #[plugin] #[no_link]
- extern crate bar;
+ #![plugin(bar)]
extern crate baz;
fn main() {
assert_eq!(bar!(), baz::baz());
@@ -320,7 +318,7 @@ test!(plugin_with_extra_dylib_dep {
"#)
.file("src/main.rs", r#"
#![feature(plugin)]
- #[plugin] #[no_link] extern crate bar;
+ #![plugin(bar)]
fn main() {}
"#);
@@ -362,7 +360,7 @@ test!(plugin_with_extra_dylib_dep {
name = "baz"
crate_type = ["dylib"]
"#)
- .file("src/lib.rs", "pub fn baz() -> int { 1 }");
+ .file("src/lib.rs", "pub fn baz() -> i32 { 1 }");
bar.build();
baz.build();
@@ -464,8 +462,8 @@ test!(cross_with_a_build_script {
.file("build.rs", format!(r#"
use std::env;
fn main() {{
- assert_eq!(env::var_string("TARGET").unwrap().as_slice(), "{0}");
- let mut path = Path::new(env::var_string("OUT_DIR").unwrap());
+ assert_eq!(env::var("TARGET").unwrap().as_slice(), "{0}");
+ let mut path = Path::new(env::var("OUT_DIR").unwrap());
assert_eq!(path.filename().unwrap(), b"out");
path.pop();
assert!(path.filename().unwrap().starts_with(b"foo-"));
@@ -530,7 +528,7 @@ test!(build_script_needed_for_host_and_target {
.file("d1/build.rs", r#"
use std::env;
fn main() {
- let target = env::var_string("TARGET").unwrap();
+ let target = env::var("TARGET").unwrap();
println!("cargo:rustc-flags=-L /path/to/{}", target);
}
"#)
@@ -643,9 +641,9 @@ test!(build_script_only_host {
use std::env;
fn main() {
- assert!(env::var_string("OUT_DIR").unwrap()
+ assert!(env::var("OUT_DIR").unwrap()
.contains("target/build/d1-"),
- "bad: {:?}", env::var_string("OUT_DIR"));
+ "bad: {:?}", env::var("OUT_DIR"));
}
"#);
diff --git a/tests/test_cargo_profiles.rs b/tests/test_cargo_profiles.rs
index b71eadb..827393f 100644
--- a/tests/test_cargo_profiles.rs
+++ b/tests/test_cargo_profiles.rs
@@ -1,4 +1,4 @@
-use std::os;
+use std::env;
use std::old_path;
use support::{project, execs};
@@ -110,6 +110,6 @@ test!(top_level_overrides_deps {
dir = p.root().display(),
url = p.url(),
sep = old_path::SEP,
- prefix = os::consts::DLL_PREFIX,
- suffix = os::consts::DLL_SUFFIX).as_slice()));
+ prefix = env::consts::DLL_PREFIX,
+ suffix = env::consts::DLL_SUFFIX).as_slice()));
});
--
2.3.0
@@ -1,138 +0,0 @@
From f32fa685610399739a2584ae02653753a372d6ed Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Fri, 13 Feb 2015 15:24:16 -0500
Subject: [PATCH] update pkg versions
---
Cargo.lock | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 14dd876..629585c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,7 +4,7 @@ version = "0.1.0"
dependencies = [
"advapi32-sys 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"curl 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "docopt 0.6.36 (registry+https://github.com/rust-lang/crates.io-index)",
+ "docopt 0.6.37 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"git2 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -18,8 +18,8 @@ dependencies = [
"semver 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"tar 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
- "toml 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "toml 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -44,7 +44,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"curl-sys 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -55,13 +55,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "docopt"
-version = "0.6.36"
+version = "0.6.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"regex 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -97,7 +97,7 @@ version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libgit2-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libgit2-sys 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -136,13 +136,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libgit2-sys"
-version = "0.1.12"
+version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libssh2-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -159,7 +159,7 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -192,12 +192,12 @@ dependencies = [
[[package]]
name = "openssl-sys"
-version = "0.3.3"
+version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"libressl-pnacl-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -207,7 +207,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "pkg-config"
-version = "0.2.0"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@@ -255,7 +255,7 @@ dependencies = [
[[package]]
name = "time"
-version = "0.1.16"
+version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -264,7 +264,7 @@ dependencies = [
[[package]]
name = "toml"
-version = "0.1.16"
+version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
--
2.3.0
@@ -1,55 +0,0 @@
From 797df37f3a9b377db475f3d2eae09fcbb90d2e4f Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Tue, 25 Nov 2014 11:50:28 -0500
Subject: [PATCH 1/2] curl-sys: avoid explicitly linking in openssl. If it is
needed, pkgconfig will pull it in
---
curl-sys/Cargo.toml | 19 -------------------
curl-sys/lib.rs | 2 --
2 files changed, 21 deletions(-)
diff --git a/curl-sys/Cargo.toml b/curl-sys/Cargo.toml
index 6e99e16..50d1101 100644
--- a/curl-sys/Cargo.toml
+++ b/curl-sys/Cargo.toml
@@ -18,23 +18,4 @@ path = "lib.rs"
[dependencies]
libz-sys = "0.1.0"
libc = "0.1"
-
-# Unix platforms use OpenSSL for now to provide SSL functionality
-[target.i686-apple-darwin.dependencies]
-openssl-sys = "0.6.0"
-[target.x86_64-apple-darwin.dependencies]
-openssl-sys = "0.6.0"
-[target.i686-unknown-linux-gnu.dependencies]
-openssl-sys = "0.6.0"
-[target.x86_64-unknown-linux-gnu.dependencies]
-openssl-sys = "0.6.0"
-[target.arm-unknown-linux-gnueabihf.dependencies]
-openssl-sys = "0.6.0"
-[target.aarch64-unknown-linux-gnu.dependencies]
-openssl-sys = "0.6.0"
-[target.i686-unknown-freebsd.dependencies]
-openssl-sys = "0.6.0"
-[target.x86_64-unknown-freebsd.dependencies]
-openssl-sys = "0.6.0"
-[target.x86_64-unknown-bitrig.dependencies]
openssl-sys = "0.6.0"
diff --git a/curl-sys/lib.rs b/curl-sys/lib.rs
index 7cae355..a2d58ea 100644
--- a/curl-sys/lib.rs
+++ b/curl-sys/lib.rs
@@ -1,8 +1,6 @@
#![allow(non_camel_case_types, raw_pointer_derive)]
extern crate libc;
-#[cfg(not(target_env = "msvc"))] extern crate libz_sys;
-#[cfg(unix)] extern crate openssl_sys;
use libc::{c_void, c_int, c_char, c_uint, c_long};
--
2.4.3
@@ -0,0 +1,62 @@
From 6d74b6af6a23e195fc54c81a9bbdb21e7d5b6414 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Sat, 12 Dec 2015 22:36:26 -0500
Subject: [PATCH 1/2] curl-sys: avoid explicitly linking in openssl
linking libcurl with libssl is handled by pkg-config, not us
This also allows non-blessed triples to work.
---
curl-sys/Cargo.toml | 26 --------------------------
curl-sys/lib.rs | 2 --
2 files changed, 28 deletions(-)
diff --git a/curl-sys/Cargo.toml b/curl-sys/Cargo.toml
index bf994bf..f153039 100644
--- a/curl-sys/Cargo.toml
+++ b/curl-sys/Cargo.toml
@@ -19,29 +19,3 @@ path = "lib.rs"
[dependencies]
libz-sys = ">= 0"
libc = "0.2"
-
-# Unix platforms use OpenSSL for now to provide SSL functionality
-[target.i686-unknown-linux-gnu.dependencies]
-openssl-sys = ">= 0"
-[target.i686-linux-android.dependencies]
-openssl-sys = ">= 0"
-[target.x86_64-unknown-linux-gnu.dependencies]
-openssl-sys = ">= 0"
-[target.x86_64-unknown-linux-musl.dependencies]
-openssl-sys = ">= 0"
-[target.arm-unknown-linux-gnueabihf.dependencies]
-openssl-sys = ">= 0"
-[target.arm-linux-androideabi.dependencies]
-openssl-sys = ">= 0"
-[target.aarch64-unknown-linux-gnu.dependencies]
-openssl-sys = ">= 0"
-[target.i686-unknown-freebsd.dependencies]
-openssl-sys = ">= 0"
-[target.x86_64-unknown-freebsd.dependencies]
-openssl-sys = ">= 0"
-[target.x86_64-unknown-bitrig.dependencies]
-openssl-sys = ">= 0"
-[target.x86_64-unknown-openbsd.dependencies]
-openssl-sys = ">= 0"
-[target.x86_64-unknown-dragonfly.dependencies]
-openssl-sys = ">= 0"
diff --git a/curl-sys/lib.rs b/curl-sys/lib.rs
index be80469..b53b445 100644
--- a/curl-sys/lib.rs
+++ b/curl-sys/lib.rs
@@ -3,8 +3,6 @@
extern crate libc;
#[cfg(not(target_env = "msvc"))]
extern crate libz_sys;
-#[cfg(all(unix, not(target_os = "macos")))]
-extern crate openssl_sys;
use libc::{c_void, c_int, c_char, c_uint, c_long};
--
2.4.10
@@ -1,48 +1,54 @@
From 625b2491eca17e78fdec374f8e83ec00fcca5fc8 Mon Sep 17 00:00:00 2001 From 445289f4eacc5c048e4a455bb6d6a6a2b9995e88 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com> From: Cody P Schafer <dev@codyps.com>
Date: Tue, 25 Nov 2014 12:26:48 -0500 Date: Sat, 12 Dec 2015 22:40:33 -0500
Subject: [PATCH 2/2] remove per-triple deps on openssl-sys Subject: [PATCH 2/2] remove per triple deps on openssl-sys
--- ---
Cargo.toml | 21 +-------------------- Cargo.toml | 27 +--------------------------
1 file changed, 1 insertion(+), 20 deletions(-) 1 file changed, 1 insertion(+), 26 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml diff --git a/Cargo.toml b/Cargo.toml
index 16b72c3..68235ae 100644 index 74f63c8..28aa1fa 100644
--- a/Cargo.toml --- a/Cargo.toml
+++ b/Cargo.toml +++ b/Cargo.toml
@@ -12,30 +12,11 @@ url = "0.2.0" @@ -12,36 +12,11 @@ url = "0.2.0"
log = "0.3.0" log = "0.3.0"
libc = "0.1" libc = "0.2"
curl-sys = { path = "curl-sys", version = "0.1.0" } curl-sys = { path = "curl-sys", version = "0.1.0" }
+openssl-sys = "0.6.0" +openssl-sys = "0.7.0"
[dev-dependencies] [dev-dependencies]
env_logger = "0.3.0" env_logger = "0.3.0"
-# Unix platforms use OpenSSL for now to provide SSL functionality -# Unix platforms use OpenSSL for now to provide SSL functionality
-[target.i686-apple-darwin.dependencies]
-openssl-sys = "0.6.0"
-[target.x86_64-apple-darwin.dependencies]
-openssl-sys = "0.6.0"
-[target.i686-unknown-linux-gnu.dependencies] -[target.i686-unknown-linux-gnu.dependencies]
-openssl-sys = "0.6.0" -openssl-sys = "0.7.0"
-[target.i686-linux-android.dependencies]
-openssl-sys = "0.7.0"
-[target.x86_64-unknown-linux-gnu.dependencies] -[target.x86_64-unknown-linux-gnu.dependencies]
-openssl-sys = "0.6.0" -openssl-sys = "0.7.0"
-[target.x86_64-unknown-linux-musl.dependencies]
-openssl-sys = "0.7.0"
-[target.arm-unknown-linux-gnueabihf.dependencies] -[target.arm-unknown-linux-gnueabihf.dependencies]
-openssl-sys = "0.6.0" -openssl-sys = "0.7.0"
-[target.arm-linux-androideabi.dependencies]
-openssl-sys = "0.7.0"
-[target.aarch64-unknown-linux-gnu.dependencies] -[target.aarch64-unknown-linux-gnu.dependencies]
-openssl-sys = "0.6.0" -openssl-sys = "0.7.0"
-[target.i686-unknown-freebsd.dependencies] -[target.i686-unknown-freebsd.dependencies]
-openssl-sys = "0.6.0" -openssl-sys = "0.7.0"
-[target.x86_64-unknown-freebsd.dependencies] -[target.x86_64-unknown-freebsd.dependencies]
-openssl-sys = "0.6.0" -openssl-sys = "0.7.0"
-[target.x86_64-unknown-bitrig.dependencies] -[target.x86_64-unknown-bitrig.dependencies]
-openssl-sys = "0.6.0" -openssl-sys = "0.7.0"
-[target.x86_64-unknown-openbsd.dependencies]
-openssl-sys = "0.7.0"
-[target.x86_64-unknown-dragonfly.dependencies]
-openssl-sys = "0.7.0"
- -
[[test]] [[test]]
name = "test" name = "test"
-- --
2.4.3 2.4.10
@@ -1,59 +0,0 @@
From aa1bea8387b6108ca2cd60ad71e8d354d8790d62 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 10 Nov 2014 15:06:29 -0500
Subject: [PATCH] Add generic openssl-sys dep
---
libgit2-sys/Cargo.toml | 36 ++----------------------------------
1 file changed, 2 insertions(+), 34 deletions(-)
diff --git a/libgit2-sys/Cargo.toml b/libgit2-sys/Cargo.toml
index 9c0aa6c..d95d07e 100644
--- a/libgit2-sys/Cargo.toml
+++ b/libgit2-sys/Cargo.toml
@@ -16,40 +16,8 @@ description = "Native bindings to the libgit2 library"
[dependencies]
libssh2-sys = "0.1.0"
libc = "0.1"
+openssl-sys = "0.6.0"
+libz-sys = "0.1.0"
[build-dependencies]
pkg-config = "0.3"
-
-[target.i686-apple-darwin.dependencies]
-openssl-sys = "0.6.0"
-libz-sys = "0.1.0"
-[target.x86_64-apple-darwin.dependencies]
-openssl-sys = "0.6.0"
-libz-sys = "0.1.0"
-[target.i686-unknown-linux-gnu.dependencies]
-openssl-sys = "0.6.0"
-libz-sys = "0.1.0"
-[target.x86_64-unknown-linux-gnu.dependencies]
-openssl-sys = "0.6.0"
-libz-sys = "0.1.0"
-[target.aarch64-unknown-linux-gnu.dependencies]
-openssl-sys = "0.6.0"
-libz-sys = "0.1.0"
-[target.arm-unknown-linux-gnueabihf.dependencies]
-openssl-sys = "0.6.0"
-libz-sys = "0.1.0"
-[target.i686-unknown-freebsd.dependencies]
-openssl-sys = "0.6.0"
-libz-sys = "0.1.0"
-[target.x86_64-unknown-freebsd.dependencies]
-openssl-sys = "0.6.0"
-libz-sys = "0.1.0"
-[target.x86_64-unknown-bitrig.dependencies]
-openssl-sys = "0.6.0"
-libz-sys = "0.1.0"
-[target.x86_64-unknown-openbsd.dependencies]
-openssl-sys = "0.6.0"
-libz-sys = "0.1.0"
-[target.x86_64-unknown-dragonfly.dependencies]
-openssl-sys = "0.6.0"
-libz-sys = "0.1.0"
--
2.4.3
@@ -0,0 +1,50 @@
From 95709b3f5b1495a57043975d7100461feed46b2f Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Sat, 12 Dec 2015 22:53:37 -0500
Subject: [PATCH] libgit2-sys: avoid blessed triples
---
libgit2-sys/Cargo.toml | 22 +---------------------
1 file changed, 1 insertion(+), 21 deletions(-)
diff --git a/libgit2-sys/Cargo.toml b/libgit2-sys/Cargo.toml
index 15b28d8..3590878 100644
--- a/libgit2-sys/Cargo.toml
+++ b/libgit2-sys/Cargo.toml
@@ -17,32 +17,12 @@ path = "lib.rs"
libssh2-sys = { version = ">= 0", optional = true }
libc = "0.2"
libz-sys = ">= 0"
+openssl-sys = "0.7.0"
[build-dependencies]
pkg-config = "0.3"
cmake = "0.1.2"
-[target.i686-unknown-linux-gnu.dependencies]
-openssl-sys = "0.7.0"
-[target.x86_64-unknown-linux-gnu.dependencies]
-openssl-sys = "0.7.0"
-[target.x86_64-unknown-linux-musl.dependencies]
-openssl-sys = "0.7.0"
-[target.aarch64-unknown-linux-gnu.dependencies]
-openssl-sys = "0.7.0"
-[target.arm-unknown-linux-gnueabihf.dependencies]
-openssl-sys = "0.7.0"
-[target.i686-unknown-freebsd.dependencies]
-openssl-sys = "0.7.0"
-[target.x86_64-unknown-freebsd.dependencies]
-openssl-sys = "0.7.0"
-[target.x86_64-unknown-bitrig.dependencies]
-openssl-sys = "0.7.0"
-[target.x86_64-unknown-openbsd.dependencies]
-openssl-sys = "0.7.0"
-[target.x86_64-unknown-dragonfly.dependencies]
-openssl-sys = "0.7.0"
-
[features]
ssh = ["libssh2-sys"]
https = []
--
2.4.10
@@ -1,26 +0,0 @@
From a1ba6ce6f54e3b2b0c3e05043a015bc845d24025 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Tue, 26 May 2015 22:10:18 -0400
Subject: [PATCH 2/3] libgit2-sys: avoid the build script, it is a disaster
---
libgit2-sys/build.rs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libgit2-sys/build.rs b/libgit2-sys/build.rs
index d624a63..9b8b98c 100644
--- a/libgit2-sys/build.rs
+++ b/libgit2-sys/build.rs
@@ -15,6 +15,9 @@ macro_rules! t {
}
fn main() {
+ pkg_config::find_library("libgit2").unwrap();
+ return;
+
register_dep("SSH2");
register_dep("OPENSSL");
--
2.4.3
@@ -1,25 +0,0 @@
From ce3e8e83be261ed7cf0a62dc8e66361588329ba2 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Tue, 26 May 2015 22:06:57 -0400
Subject: [PATCH 3/3] bump libssh2 to fix build with nightly
---
libgit2-sys/Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgit2-sys/Cargo.toml b/libgit2-sys/Cargo.toml
index d95d07e..992ea7a 100644
--- a/libgit2-sys/Cargo.toml
+++ b/libgit2-sys/Cargo.toml
@@ -14,7 +14,7 @@ description = "Native bindings to the libgit2 library"
path = "lib.rs"
[dependencies]
-libssh2-sys = "0.1.0"
+libssh2-sys = "0.1.23"
libc = "0.1"
openssl-sys = "0.6.0"
libz-sys = "0.1.0"
--
2.4.3
@@ -1,45 +0,0 @@
From b45c6ed5524690603a1888dff21556b7f42db474 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 1 Dec 2014 10:51:31 -0500
Subject: [PATCH] Unconditionally depend on openssl-sys
---
libssh2-sys/Cargo.toml | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/libssh2-sys/Cargo.toml b/libssh2-sys/Cargo.toml
index 501bba5..db8d21a 100644
--- a/libssh2-sys/Cargo.toml
+++ b/libssh2-sys/Cargo.toml
@@ -15,28 +15,6 @@ path = "lib.rs"
[dependencies]
libz-sys = "0.1.0"
libc = "0.1"
-
-[target.i686-apple-darwin.dependencies]
-openssl-sys = "0.6.0"
-[target.x86_64-apple-darwin.dependencies]
-openssl-sys = "0.6.0"
-[target.i686-unknown-linux-gnu.dependencies]
-openssl-sys = "0.6.0"
-[target.x86_64-unknown-linux-gnu.dependencies]
-openssl-sys = "0.6.0"
-[target.aarch64-unknown-linux-gnu.dependencies]
-openssl-sys = "0.6.0"
-[target.arm-unknown-linux-gnueabihf.dependencies]
-openssl-sys = "0.6.0"
-[target.i686-unknown-freebsd.dependencies]
-openssl-sys = "0.6.0"
-[target.x86_64-unknown-freebsd.dependencies]
-openssl-sys = "0.6.0"
-[target.x86_64-unknown-dragonfly.dependencies]
-openssl-sys = "0.6.0"
-[target.x86_64-unknown-bitrig.dependencies]
-openssl-sys = "0.6.0"
-[target.x86_64-unknown-openbsd.dependencies]
openssl-sys = "0.6.0"
[build-dependencies]
--
2.4.3
@@ -0,0 +1,62 @@
From be07c11b438550829d82dc844e38806570232cd7 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Sat, 12 Dec 2015 22:44:14 -0500
Subject: [PATCH] libssh2-sys: avoid explicitly linking in openssl
---
libssh2-sys/Cargo.toml | 25 -------------------------
libssh2-sys/lib.rs | 2 --
2 files changed, 27 deletions(-)
diff --git a/libssh2-sys/Cargo.toml b/libssh2-sys/Cargo.toml
index b9ecec2..78f92ac 100644
--- a/libssh2-sys/Cargo.toml
+++ b/libssh2-sys/Cargo.toml
@@ -18,31 +18,6 @@ libc = "0.2"
ws2_32-sys = ">= 0"
winapi = "0.2"
-[target.i686-apple-darwin.dependencies]
-openssl-sys = ">= 0"
-[target.x86_64-apple-darwin.dependencies]
-openssl-sys = ">= 0"
-[target.i686-unknown-linux-gnu.dependencies]
-openssl-sys = ">= 0"
-[target.x86_64-unknown-linux-gnu.dependencies]
-openssl-sys = ">= 0"
-[target.aarch64-unknown-linux-gnu.dependencies]
-openssl-sys = ">= 0"
-[target.x86_64-unknown-linux-musl.dependencies]
-openssl-sys = ">= 0"
-[target.arm-unknown-linux-gnueabihf.dependencies]
-openssl-sys = ">= 0"
-[target.i686-unknown-freebsd.dependencies]
-openssl-sys = ">= 0"
-[target.x86_64-unknown-freebsd.dependencies]
-openssl-sys = ">= 0"
-[target.x86_64-unknown-dragonfly.dependencies]
-openssl-sys = ">= 0"
-[target.x86_64-unknown-bitrig.dependencies]
-openssl-sys = ">= 0"
-[target.x86_64-unknown-openbsd.dependencies]
-openssl-sys = ">= 0"
-
[build-dependencies]
pkg-config = "0.3"
cmake = "0.1.2"
diff --git a/libssh2-sys/lib.rs b/libssh2-sys/lib.rs
index bb6c46f..40af82f 100644
--- a/libssh2-sys/lib.rs
+++ b/libssh2-sys/lib.rs
@@ -6,8 +6,6 @@ extern crate ws2_32;
extern crate winapi;
extern crate libz_sys;
-#[cfg(unix)]
-extern crate openssl_sys;
use libc::{c_int, size_t, c_void, c_char, c_long, c_uchar, c_uint, c_ulong};
use libc::ssize_t;
--
2.4.10
@@ -1,27 +0,0 @@
From 6d0905573f38d0fbdde74848c0cd7cdbb603c238 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Sat, 15 Nov 2014 20:12:48 -0500
Subject: [PATCH 01/10] platform.mk: avoid choking on i586
---
mk/platform.mk | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mk/platform.mk b/mk/platform.mk
index 60fe22c..9c57656 100644
--- a/mk/platform.mk
+++ b/mk/platform.mk
@@ -14,7 +14,9 @@
# would create a variable HOST_i686-darwin-macos with the value
# i386.
define DEF_HOST_VAR
- HOST_$(1) = $(subst i686,i386,$(word 1,$(subst -, ,$(1))))
+ HOST_$(1) = $(subst i686,i386,\
+ $(subst i586,i386,\
+ $(word 1,$(subst -, ,$(1)))))
endef
$(foreach t,$(CFG_TARGET),$(eval $(call DEF_HOST_VAR,$(t))))
$(foreach t,$(CFG_TARGET),$(info cfg: host for $(t) is $(HOST_$(t))))
--
2.5.1
@@ -1,109 +0,0 @@
From e9d46f8cb10eec1f8ee19ed2aab385d17ec85757 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Tue, 18 Nov 2014 01:40:21 -0500
Subject: [PATCH 02/10] Target: add default target.json path:
$libdir/rust/targets
---
src/librustc/session/config.rs | 6 +++---
src/librustc/session/mod.rs | 8 ++++++--
src/librustc_back/target/mod.rs | 14 +++++++++++---
3 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index c5db7cd..2b9069f 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -38,7 +38,7 @@ use getopts;
use std::collections::HashMap;
use std::env;
use std::fmt;
-use std::path::PathBuf;
+use std::path::{Path, PathBuf};
use llvm;
@@ -655,8 +655,8 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
v
}
-pub fn build_target_config(opts: &Options, sp: &SpanHandler) -> Config {
- let target = match Target::search(&opts.target_triple) {
+pub fn build_target_config(sysroot: &Path, opts: &Options, sp: &SpanHandler) -> Config {
+ let target = match Target::search(sysroot, &opts.target_triple[..]) {
Ok(t) => t,
Err(e) => {
sp.handler().fatal(&format!("Error loading target specification: {}", e));
diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs
index 99a58f0..d25e476 100644
--- a/src/librustc/session/mod.rs
+++ b/src/librustc/session/mod.rs
@@ -385,14 +385,18 @@ pub fn build_session_(sopts: config::Options,
local_crate_source_file: Option<PathBuf>,
span_diagnostic: diagnostic::SpanHandler)
-> Session {
- let host = match Target::search(config::host_triple()) {
+ let sysroot = match sopts.maybe_sysroot {
+ Some(ref x) => PathBuf::from(x),
+ None => filesearch::get_or_default_sysroot()
+ };
+ let host = match Target::search(&sysroot, config::host_triple()) {
Ok(t) => t,
Err(e) => {
span_diagnostic.handler()
.fatal(&format!("Error loading host specification: {}", e));
}
};
- let target_cfg = config::build_target_config(&sopts, &span_diagnostic);
+ let target_cfg = config::build_target_config(&sysroot, &sopts, &span_diagnostic);
let p_s = parse::ParseSess::with_span_handler(span_diagnostic);
let default_sysroot = match sopts.maybe_sysroot {
Some(_) => None,
diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs
index ce05a88..1d1ff70 100644
--- a/src/librustc_back/target/mod.rs
+++ b/src/librustc_back/target/mod.rs
@@ -49,6 +49,8 @@ use serialize::json::Json;
use std::default::Default;
use std::io::prelude::*;
use syntax::{diagnostic, abi};
+use std::borrow::ToOwned;
+use std::path::Path;
mod android_base;
mod apple_base;
@@ -320,12 +322,13 @@ impl Target {
///
/// The error string could come from any of the APIs called, including
/// filesystem access and JSON decoding.
- pub fn search(target: &str) -> Result<Target, String> {
+ pub fn search(sysroot: &Path, target: &str) -> Result<Target, String> {
use std::env;
use std::ffi::OsString;
use std::fs::File;
use std::path::{Path, PathBuf};
use serialize::json;
+ use std::iter::IntoIterator;
fn load_file(path: &Path) -> Result<Target, String> {
let mut f = try!(File::open(path).map_err(|e| e.to_string()));
@@ -417,9 +420,14 @@ impl Target {
let target_path = env::var_os("RUST_TARGET_PATH")
.unwrap_or(OsString::new());
- // FIXME 16351: add a sane default search path?
+ let mut default_path = sysroot.to_owned();
+ default_path.push(env!("CFG_LIBDIR_RELATIVE"));
+ default_path.push("rustlib");
- for dir in env::split_paths(&target_path) {
+ let paths = env::split_paths(&target_path)
+ .chain(Some(default_path).into_iter());
+
+ for dir in paths {
let p = dir.join(&path);
if p.is_file() {
return load_file(&p);
--
2.5.1
@@ -1,68 +0,0 @@
From e468926e5e331dc6a68be5d0731a331940bd0199 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Tue, 18 Nov 2014 14:52:56 -0500
Subject: [PATCH 03/10] mk: for stage0, use RUSTFLAGS to override target libs
dir
Setting HLIB specially for stage0 (and even more specially for windows)
also affects the location we place TLIB. To keep the TLIBs we build in
the place requested by configure, use '-L' and '--sysroot' to point
stage0-rustc at the appropriate location.
---
mk/main.mk | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/mk/main.mk b/mk/main.mk
index 99b0797..d907628 100644
--- a/mk/main.mk
+++ b/mk/main.mk
@@ -369,21 +369,22 @@ define SREQ
# Destinations of artifacts for the host compiler
HROOT$(1)_H_$(3) = $(3)/stage$(1)
HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
-ifeq ($$(CFG_WINDOWSY_$(3)),1)
-HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)
-else
-ifeq ($(1),0)
-HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib
-else
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)
-endif
-endif
# Destinations of artifacts for target architectures
TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2)
TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin
TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/lib
+# Don't trust stage0, be explicit about libraries
+# TODO: rather than specifying sysroot, we really want to tell which libdir to
+# use (ie: the dir containing 'rustlib'). This would allow us to avoid
+# passing the '-L' options.
+ifeq ($(1),0)
+RUSTFLAGS_S_$(1)_T_$(2)_H_$(3) += --sysroot "$$(HROOT$(1)_H_$(3))" \
+ -L "$$(TLIB$(1)_T_$(2)_H_$(3))"
+endif
+
# Preqrequisites for using the stageN compiler
ifeq ($(1),0)
HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3))
@@ -495,6 +496,7 @@ STAGE$(1)_T_$(2)_H_$(3) := \
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
--cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
+ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \
$$(RUSTC_FLAGS_$(2))
PERF_STAGE$(1)_T_$(2)_H_$(3) := \
@@ -503,6 +505,7 @@ PERF_STAGE$(1)_T_$(2)_H_$(3) := \
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
--cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
+ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \
$$(RUSTC_FLAGS_$(2))
endef
--
2.5.1
@@ -1,27 +0,0 @@
From 977954fbe5a3c9d0b89652f852b174aa9ac0e0a4 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Tue, 18 Nov 2014 13:48:14 -0500
Subject: [PATCH 04/10] mk: add missing CFG_LIBDIR_RELATIVE
---
mk/grammar.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mk/grammar.mk b/mk/grammar.mk
index d9c66e2..585206d 100644
--- a/mk/grammar.mk
+++ b/mk/grammar.mk
@@ -11,8 +11,8 @@
BG = $(CFG_BUILD_DIR)/grammar/
SG = $(S)src/grammar/
B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/
-L = $(B)lib/rustlib/$(CFG_BUILD)/lib
-LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/
+L = $(B)$(CFG_LIBDIR_RELATIVE)/rustlib/$(CFG_BUILD)/lib
+LD = $(CFG_BUILD)/stage2/$(CFG_LIBDIR_RELATIVE)/rustlib/$(CFG_BUILD)/lib/
RUSTC = $(STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD))
ifeq ($(CFG_OSTYPE),apple-darwin)
FLEX_LDFLAGS=-ll
--
2.5.1
@@ -1,43 +0,0 @@
From 564742fb9c94f9b8e7f6ad4ec34fd2254c337a09 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 2 Mar 2015 13:34:59 -0500
Subject: [PATCH 07/10] mk/install: use disable-rewrite-paths
This stops the install scripts from doing work we've already handled.
Path rewriting is only useful for prepackaged binary installers.
---
mk/install.mk | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mk/install.mk b/mk/install.mk
index cabc97a..273bb0e 100644
--- a/mk/install.mk
+++ b/mk/install.mk
@@ -16,9 +16,9 @@ else
$(Q)$(MAKE) prepare_install
endif
ifeq ($(CFG_DISABLE_DOCS),)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths
endif
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths
# Remove tmp files because it's a decent amount of disk space
$(Q)rm -R tmp/dist
@@ -32,9 +32,9 @@ else
$(Q)$(MAKE) prepare_uninstall
endif
ifeq ($(CFG_DISABLE_DOCS),)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths
endif
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths
# Remove tmp files because it's a decent amount of disk space
$(Q)rm -R tmp/dist
--
2.5.1
@@ -1,40 +0,0 @@
From 24fc19c57309b0c23c34f22b87796bb8aee4efa7 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Tue, 26 May 2015 12:09:36 -0400
Subject: [PATCH 08/10] install: disable ldconfig
---
mk/install.mk | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mk/install.mk b/mk/install.mk
index 273bb0e..58cfc99 100644
--- a/mk/install.mk
+++ b/mk/install.mk
@@ -16,9 +16,9 @@ else
$(Q)$(MAKE) prepare_install
endif
ifeq ($(CFG_DISABLE_DOCS),)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths --disable-ldconfig
endif
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths --disable-ldconfig
# Remove tmp files because it's a decent amount of disk space
$(Q)rm -R tmp/dist
@@ -32,9 +32,9 @@ else
$(Q)$(MAKE) prepare_uninstall
endif
ifeq ($(CFG_DISABLE_DOCS),)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths --disable-ldconfig
endif
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths --disable-ldconfig
# Remove tmp files because it's a decent amount of disk space
$(Q)rm -R tmp/dist
--
2.5.1
@@ -1,36 +0,0 @@
From 053afad02e46b0cb62569018f07f7430ebf9afc5 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Wed, 26 Aug 2015 11:21:36 -0400
Subject: [PATCH 10/10] mk: tell rustc that we're only looking for native libs
in the LLVM_LIBDIR
This fixes the case where we try to re-build & re-install rust to the
same prefix (without uninstalling) while using an llvm-root that is the
same as the prefix.
Without this, builds like that fail with:
'error: multiple dylib candidates for `std` found'
See https://github.com/jmesmon/meta-rust/issues/6 for some details.
May also be related to #20342.
---
mk/main.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mk/main.mk b/mk/main.mk
index 6782bed..63b4fef 100644
--- a/mk/main.mk
+++ b/mk/main.mk
@@ -294,7 +294,7 @@ LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version)
LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir)
LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir)
LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir)
-LLVM_LIBDIR_RUSTFLAGS_$(1)=-L "$$(LLVM_LIBDIR_$(1))"
+LLVM_LIBDIR_RUSTFLAGS_$(1)=-L native="$$(LLVM_LIBDIR_$(1))"
LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags)
ifeq ($$(findstring freebsd,$(1)),freebsd)
# On FreeBSD, it may search wrong headers (that are for pre-installed LLVM),
--
2.5.1
@@ -1,362 +0,0 @@
From 64dcf50a8a0f3aaf37ec6e4fe6143d0832592c05 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 24 Nov 2014 13:10:15 -0500
Subject: [PATCH 5/8] configure: support --bindir, and extend libdir to
non-blessed dirs
Adds --bindir, and:
Allows --bindir and --libdir to have multiple elements in their paths
relative to sysroot, and allows libdir to end in an arbitrary directory
(previously it was limited to lib, lib32, and lib64).
Note that this assumes absolute paths start with '/', which may break
windows platforms
---
configure | 49 ++++++++++++++++------
mk/host.mk | 6 ++-
mk/main.mk | 11 +++++
mk/perf.mk | 4 +-
mk/prepare.mk | 4 +-
src/librustc/metadata/filesearch.rs | 84 ++++++++++++++-----------------------
src/librustc_trans/back/link.rs | 3 +-
7 files changed, 90 insertions(+), 71 deletions(-)
diff --git a/configure b/configure
index 891f524..441793c 100755
--- a/configure
+++ b/configure
@@ -323,6 +323,31 @@ envopt() {
fi
}
+abspath () {
+ case "$1" in
+ /*) echo "$1" ;;
+ *) echo "$PWD/$1" ;;
+ esac
+}
+
+relpath () {
+ local src=$(abspath "$1")
+ local dst=$(abspath "$2")
+ local common=$src
+ local result=
+
+ # Start by checking if the whole src is common, then strip off pack
+ # components until we find the common element.
+ while [ "${dst#"$common"}" = "$dst" ]; do
+ common=$(dirname "$common")
+ result="../$result"
+ done
+
+ local down="${dst#"$common"}"
+ result="${result}${down#/}"
+ echo "$result"
+}
+
to_llvm_triple() {
case $1 in
i686-w64-mingw32) echo i686-pc-windows-gnu ;;
@@ -609,6 +634,8 @@ putvar CFG_BUILD # Yes, this creates a duplicate entry, but the last one wins.
CFG_HOST=$(to_llvm_triple $CFG_HOST)
CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
+CFG_LIBDIR_RELATIVE=lib
+
# On windows we just store the libraries in the bin directory because
# there's no rpath. This is where the build system itself puts libraries;
# --libdir is used to configure the installation directory.
@@ -616,24 +643,21 @@ CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
if [ "$CFG_OSTYPE" = "pc-windows-gnu" ] || [ "$CFG_OSTYPE" = "pc-windows-msvc" ]
then
CFG_LIBDIR_RELATIVE=bin
-else
- CFG_LIBDIR_RELATIVE=lib
fi
-valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries (do not set it on windows platform)"
+valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
-case "$CFG_LIBDIR" in
- "$CFG_PREFIX"/*) CAT_INC=2;;
- "$CFG_PREFIX"*) CAT_INC=1;;
- *)
- err "libdir must begin with the prefix. Use --prefix to set it accordingly.";;
-esac
+CFG_BINDIR_RELATIVE=bin
+valopt bindir "${CFG_PREFIX}/${CFG_BINDIR_RELATIVE}" "install binaries"
-CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-`
+# Determine libdir and bindir relative to prefix
+step_msg "calculating relative paths to prefix = ${CFG_PREFIX}"
+CFG_BINDIR_RELATIVE=$(relpath "${CFG_PREFIX}" "${CFG_BINDIR}")
+CFG_LIBDIR_RELATIVE=$(relpath "${CFG_PREFIX}" "${CFG_LIBDIR}")
if ( [ "$CFG_OSTYPE" = "pc-windows-gnu" ] || [ "$CFG_OSTYPE" = "pc-windows-msvc" ] ) \
- && [ "$CFG_LIBDIR_RELATIVE" != "bin" ]; then
- err "libdir on windows should be set to 'bin'"
+ && [ "$CFG_LIBDIR_RELATIVE" != "$CFG_BINDIR_RELATIVE" ]; then
+ err "Windows builds currently require that LIBDIR == BINDIR (we have libdir{$CFG_LIBDIR_RELATIVE} != bindir{$CFG_BINDIR_RELATIVE} )"
fi
if [ $HELP -eq 1 ]
@@ -1588,6 +1612,7 @@ putvar CFG_PREFIX
putvar CFG_HOST
putvar CFG_TARGET
putvar CFG_LIBDIR_RELATIVE
+putvar CFG_BINDIR_RELATIVE
putvar CFG_DISABLE_MANAGE_SUBMODULES
putvar CFG_ANDROID_CROSS_PATH
putvar CFG_MANDIR
diff --git a/mk/host.mk b/mk/host.mk
index 59a0095..b8e8345 100644
--- a/mk/host.mk
+++ b/mk/host.mk
@@ -59,9 +59,13 @@ endef
# $(4) - the host triple (same as $(3))
define CP_HOST_STAGE_N
-ifneq ($(CFG_LIBDIR_RELATIVE),bin)
$$(HLIB$(2)_H_$(4))/:
@mkdir -p $$@
+
+# Avoid redefinition warnings if libdir==bindir
+ifneq ($(HBIN$(2)_H_$(4)),$(HLIB$(2)_H_$(4)))
+$$(HBIN$(2)_H_$(4))/:
+ @mkdir -p $$@
endif
endef
diff --git a/mk/main.mk b/mk/main.mk
index 165afc3..33f9545 100644
--- a/mk/main.mk
+++ b/mk/main.mk
@@ -339,7 +339,9 @@ export CFG_RELEASE_CHANNEL
export CFG_LLVM_ROOT
export CFG_PREFIX
export CFG_LIBDIR
+export CFG_BINDIR
export CFG_LIBDIR_RELATIVE
+export CFG_BINDIR_RELATIVE
export CFG_DISABLE_INJECT_STD_VERSION
ifdef CFG_DISABLE_UNSTABLE_FEATURES
CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES))
@@ -369,7 +371,16 @@ define SREQ
# Destinations of artifacts for the host compiler
HROOT$(1)_H_$(3) = $(3)/stage$(1)
+
+ifeq ($(1)-$(3),0-$$(CFG_BUILD))
+# stage0 relative paths are fixed so we can bootstrap from snapshots
+# (downloaded snapshots drop their rustc in HROOT/bin)
+# libdir discrepancy is worked around with RUSTFLAGS below.
HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
+else
+HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_BINDIR_RELATIVE)
+endif
+
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)
# Destinations of artifacts for target architectures
diff --git a/mk/perf.mk b/mk/perf.mk
index 16cbaab..f8a354c 100644
--- a/mk/perf.mk
+++ b/mk/perf.mk
@@ -10,13 +10,13 @@
ifdef CFG_PERF_TOOL
-rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD))
+rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD))
@$(call E, perf compile: $@)
$(PERF_STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
-o $@ $(COMPILER_CRATE) >rustc-perf.err 2>&1
$(Q)rm -f $(LIBRUSTC_GLOB)
else
-rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD))
+rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD))
$(Q)touch $@
endif
diff --git a/mk/prepare.mk b/mk/prepare.mk
index fe619cc..b8aa0cb 100644
--- a/mk/prepare.mk
+++ b/mk/prepare.mk
@@ -186,10 +186,10 @@ INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\
define DEF_PREPARE
prepare-base-$(1): PREPARE_SOURCE_DIR=$$(PREPARE_HOST)/stage$$(PREPARE_STAGE)
-prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/bin
+prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_BINDIR_RELATIVE)
prepare-base-$(1): PREPARE_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_LIBDIR_RELATIVE)
prepare-base-$(1): PREPARE_SOURCE_MAN_DIR=$$(S)/man
-prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/bin
+prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_BINDIR_RELATIVE)
prepare-base-$(1): PREPARE_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)
prepare-base-$(1): PREPARE_DEST_MAN_DIR=$$(PREPARE_DEST_DIR)/share/man/man1
prepare-base-$(1): prepare-everything-$(1)
diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs
index 311ab1c..1b03b1a 100644
--- a/src/librustc/metadata/filesearch.rs
+++ b/src/librustc/metadata/filesearch.rs
@@ -68,8 +68,7 @@ impl<'a> FileSearch<'a> {
if !found {
let rustpath = rust_path();
for path in &rustpath {
- let tlib_path = make_rustpkg_lib_path(
- self.sysroot, path, self.triple);
+ let tlib_path = make_rustpkg_lib_path(path, self.triple);
debug!("is {} in visited_dirs? {}", tlib_path.display(),
visited_dirs.contains(&tlib_path));
@@ -96,7 +95,7 @@ impl<'a> FileSearch<'a> {
where F: FnMut(&Path, PathKind) -> FileMatch
{
self.for_each_lib_search_path(|lib_search_path, kind| {
- debug!("searching {}", lib_search_path.display());
+ info!("searching {}", lib_search_path.display());
match fs::read_dir(lib_search_path) {
Ok(files) => {
let files = files.filter_map(|p| p.ok().map(|s| s.path()))
@@ -157,7 +156,7 @@ impl<'a> FileSearch<'a> {
// Returns a list of directories where target-specific tool binaries are located.
pub fn get_tools_search_paths(&self) -> Vec<PathBuf> {
let mut p = PathBuf::from(self.sysroot);
- p.push(&find_libdir(self.sysroot));
+ p.push(libdir_str());
p.push(&rustlibdir());
p.push(&self.triple);
p.push("bin");
@@ -165,8 +164,8 @@ impl<'a> FileSearch<'a> {
}
}
-pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf {
- let mut p = PathBuf::from(&find_libdir(sysroot));
+pub fn relative_target_lib_path(target_triple: &str) -> PathBuf {
+ let mut p = PathBuf::from(&libdir_str());
assert!(p.is_relative());
p.push(&rustlibdir());
p.push(target_triple);
@@ -176,17 +175,28 @@ pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf
fn make_target_lib_path(sysroot: &Path,
target_triple: &str) -> PathBuf {
- sysroot.join(&relative_target_lib_path(sysroot, target_triple))
+ sysroot.join(&relative_target_lib_path(target_triple))
}
-fn make_rustpkg_lib_path(sysroot: &Path,
- dir: &Path,
+fn make_rustpkg_lib_path(dir: &Path,
triple: &str) -> PathBuf {
- let mut p = dir.join(&find_libdir(sysroot));
+ let mut p = dir.join(libdir_str());
p.push(triple);
p
}
+pub fn bindir_relative_str() -> &'static str {
+ env!("CFG_BINDIR_RELATIVE")
+}
+
+pub fn bindir_relative_path() -> PathBuf {
+ PathBuf::from(bindir_relative_str())
+}
+
+pub fn libdir_str() -> &'static str {
+ env!("CFG_LIBDIR_RELATIVE")
+}
+
pub fn get_or_default_sysroot() -> PathBuf {
// Follow symlinks. If the resolved path is relative, make it absolute.
fn canonicalize(path: Option<PathBuf>) -> Option<PathBuf> {
@@ -202,7 +212,18 @@ pub fn get_or_default_sysroot() -> PathBuf {
}
match canonicalize(env::current_exe().ok()) {
- Some(mut p) => { p.pop(); p.pop(); p }
+ Some(mut p) => {
+ // Remove the exe name
+ p.pop();
+ let mut rel = bindir_relative_path();
+
+ // Remove a number of elements equal to the number of elements in the bindir relative
+ // path
+ while rel.pop() {
+ p.pop();
+ }
+ p
+ }
None => panic!("can't determine value for sysroot")
}
}
@@ -257,47 +278,6 @@ pub fn rust_path() -> Vec<PathBuf> {
env_rust_path
}
-// The name of the directory rustc expects libraries to be located.
-// On Unix should be "lib", on windows "bin"
-#[cfg(unix)]
-fn find_libdir(sysroot: &Path) -> String {
- // FIXME: This is a quick hack to make the rustc binary able to locate
- // Rust libraries in Linux environments where libraries might be installed
- // to lib64/lib32. This would be more foolproof by basing the sysroot off
- // of the directory where librustc is located, rather than where the rustc
- // binary is.
- //If --libdir is set during configuration to the value other than
- // "lib" (i.e. non-default), this value is used (see issue #16552).
-
- match option_env!("CFG_LIBDIR_RELATIVE") {
- Some(libdir) if libdir != "lib" => return libdir.to_string(),
- _ => if sysroot.join(&primary_libdir_name()).join(&rustlibdir()).exists() {
- return primary_libdir_name();
- } else {
- return secondary_libdir_name();
- }
- }
-
- #[cfg(target_pointer_width = "64")]
- fn primary_libdir_name() -> String {
- "lib64".to_string()
- }
-
- #[cfg(target_pointer_width = "32")]
- fn primary_libdir_name() -> String {
- "lib32".to_string()
- }
-
- fn secondary_libdir_name() -> String {
- "lib".to_string()
- }
-}
-
-#[cfg(windows)]
-fn find_libdir(_sysroot: &Path) -> String {
- "bin".to_string()
-}
-
// The name of rustc's own place to organize libraries.
// Used to be "rustc", now the default is "rustlib"
pub fn rustlibdir() -> String {
diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
index 6b8b59d..6e03f3c 100644
--- a/src/librustc_trans/back/link.rs
+++ b/src/librustc_trans/back/link.rs
@@ -997,11 +997,10 @@ fn link_args(cmd: &mut Linker,
// where extern libraries might live, based on the
// addl_lib_search_paths
if sess.opts.cg.rpath {
- let sysroot = sess.sysroot();
let target_triple = &sess.opts.target_triple;
let mut get_install_prefix_lib_path = || {
let install_prefix = option_env!("CFG_PREFIX").expect("CFG_PREFIX");
- let tlib = filesearch::relative_target_lib_path(sysroot, target_triple);
+ let tlib = filesearch::relative_target_lib_path(target_triple);
let mut path = PathBuf::from(install_prefix);
path.push(&tlib);
--
2.4.3
@@ -1,25 +0,0 @@
From fb56f1fa6d0bdc62f7fd0c480446255698dc1635 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Wed, 3 Dec 2014 19:15:19 -0500
Subject: [PATCH 6/8] std/thread_local: workaround for NULL __dso_handle
---
src/libstd/thread/local.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index 6056334..e79bd8b 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -337,7 +337,7 @@ mod imp {
#[linkage = "extern_weak"]
static __cxa_thread_atexit_impl: *const ();
}
- if !__cxa_thread_atexit_impl.is_null() {
+ if !__cxa_thread_atexit_impl.is_null() && !__dso_handle.is_null() {
type F = unsafe extern fn(dtor: unsafe extern fn(*mut u8),
arg: *mut u8,
dso_handle: *mut u8) -> libc::c_int;
--
2.4.3
@@ -1,43 +0,0 @@
From de01acf6395a4c7f7d5c9d7ba251d9f2af570127 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 2 Mar 2015 13:34:59 -0500
Subject: [PATCH 7/8] mk/install: use disable-rewrite-paths
This stops the install scripts from doing work we've already handled.
Path rewriting is only useful for prepackaged binary installers.
---
mk/install.mk | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mk/install.mk b/mk/install.mk
index cabc97a..273bb0e 100644
--- a/mk/install.mk
+++ b/mk/install.mk
@@ -16,9 +16,9 @@ else
$(Q)$(MAKE) prepare_install
endif
ifeq ($(CFG_DISABLE_DOCS),)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths
endif
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths
# Remove tmp files because it's a decent amount of disk space
$(Q)rm -R tmp/dist
@@ -32,9 +32,9 @@ else
$(Q)$(MAKE) prepare_uninstall
endif
ifeq ($(CFG_DISABLE_DOCS),)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths
endif
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths
# Remove tmp files because it's a decent amount of disk space
$(Q)rm -R tmp/dist
--
2.4.3
@@ -1,40 +0,0 @@
From 8b87c3e5a7181f828dee1c8c0598b1bafa9dd4cc Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Tue, 26 May 2015 12:09:36 -0400
Subject: [PATCH 8/8] install: disable ldconfig
---
mk/install.mk | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mk/install.mk b/mk/install.mk
index 273bb0e..58cfc99 100644
--- a/mk/install.mk
+++ b/mk/install.mk
@@ -16,9 +16,9 @@ else
$(Q)$(MAKE) prepare_install
endif
ifeq ($(CFG_DISABLE_DOCS),)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths --disable-ldconfig
endif
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths --disable-ldconfig
# Remove tmp files because it's a decent amount of disk space
$(Q)rm -R tmp/dist
@@ -32,9 +32,9 @@ else
$(Q)$(MAKE) prepare_uninstall
endif
ifeq ($(CFG_DISABLE_DOCS),)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths --disable-ldconfig
endif
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths --disable-ldconfig
# Remove tmp files because it's a decent amount of disk space
$(Q)rm -R tmp/dist
--
2.4.3
@@ -0,0 +1,11 @@
+++ llvm/src/llvm/include/llvm/CodeGen/CommandFlags.h.orig 2016-01-18 19:18:03.847470845 +0000
+++ llvm/src/llvm/include/llvm/CodeGen/CommandFlags.h 2016-01-18 19:18:11.211408270 +0000
@@ -21,7 +21,7 @@
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/MC/MCTargetOptionsCommandFlags.h"
-#include "llvm//MC/SubtargetFeature.h"
+#include "llvm/MC/SubtargetFeature.h"
#include "llvm/Support/CodeGen.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Host.h"
@@ -1,14 +1,14 @@
From 237f665afaf7ec35f067ede4c09a013e86ad12c4 Mon Sep 17 00:00:00 2001 From af2eaed835d3b717552ea83e75f4c5e86e614979 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com> From: Cody P Schafer <dev@codyps.com>
Date: Sat, 15 Nov 2014 20:12:48 -0500 Date: Sat, 15 Nov 2014 20:12:48 -0500
Subject: [PATCH 1/8] platform.mk: avoid choking on i586 Subject: [PATCH 1/9] platform.mk: avoid choking on i586
--- ---
mk/platform.mk | 4 +++- mk/platform.mk | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-) 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mk/platform.mk b/mk/platform.mk diff --git a/mk/platform.mk b/mk/platform.mk
index 8a5e58c..e2c3d8f 100644 index 856a22d..0c90632 100644
--- a/mk/platform.mk --- a/mk/platform.mk
+++ b/mk/platform.mk +++ b/mk/platform.mk
@@ -14,7 +14,9 @@ @@ -14,7 +14,9 @@
@@ -23,5 +23,5 @@ index 8a5e58c..e2c3d8f 100644
$(foreach t,$(CFG_TARGET),$(eval $(call DEF_HOST_VAR,$(t)))) $(foreach t,$(CFG_TARGET),$(eval $(call DEF_HOST_VAR,$(t))))
$(foreach t,$(CFG_TARGET),$(info cfg: host for $(t) is $(HOST_$(t)))) $(foreach t,$(CFG_TARGET),$(info cfg: host for $(t) is $(HOST_$(t))))
-- --
2.4.3 2.4.10
@@ -1,7 +1,7 @@
From 221ff5acf7b3b176882908d2f7010784614005e8 Mon Sep 17 00:00:00 2001 From 632d71477fdecb18852812d86b8e2ee1e33c521b Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com> From: Cody P Schafer <dev@codyps.com>
Date: Tue, 18 Nov 2014 01:40:21 -0500 Date: Tue, 18 Nov 2014 01:40:21 -0500
Subject: [PATCH 2/8] Target: add default target.json path: Subject: [PATCH 2/9] Target: add default target.json path:
$libdir/rust/targets $libdir/rust/targets
--- ---
@@ -11,10 +11,10 @@ Subject: [PATCH 2/8] Target: add default target.json path:
3 files changed, 20 insertions(+), 8 deletions(-) 3 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index c6ce3a2..51152c7 100644 index 7e8104d..ecb38d4 100644
--- a/src/librustc/session/config.rs --- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs
@@ -38,7 +38,7 @@ use getopts; @@ -36,7 +36,7 @@ use getopts;
use std::collections::HashMap; use std::collections::HashMap;
use std::env; use std::env;
use std::fmt; use std::fmt;
@@ -23,7 +23,7 @@ index c6ce3a2..51152c7 100644
use llvm; use llvm;
@@ -651,8 +651,8 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig { @@ -653,8 +653,8 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
v v
} }
@@ -35,10 +35,10 @@ index c6ce3a2..51152c7 100644
Err(e) => { Err(e) => {
sp.handler().fatal(&format!("Error loading target specification: {}", e)); sp.handler().fatal(&format!("Error loading target specification: {}", e));
diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs
index 6b5f587..4432440 100644 index 0a1df25..ad223d5 100644
--- a/src/librustc/session/mod.rs --- a/src/librustc/session/mod.rs
+++ b/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs
@@ -381,14 +381,18 @@ pub fn build_session_(sopts: config::Options, @@ -412,14 +412,18 @@ pub fn build_session_(sopts: config::Options,
local_crate_source_file: Option<PathBuf>, local_crate_source_file: Option<PathBuf>,
span_diagnostic: diagnostic::SpanHandler) span_diagnostic: diagnostic::SpanHandler)
-> Session { -> Session {
@@ -60,7 +60,7 @@ index 6b5f587..4432440 100644
let default_sysroot = match sopts.maybe_sysroot { let default_sysroot = match sopts.maybe_sysroot {
Some(_) => None, Some(_) => None,
diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs
index 402fbcd..a211b84 100644 index 6ae7435..3ffa484 100644
--- a/src/librustc_back/target/mod.rs --- a/src/librustc_back/target/mod.rs
+++ b/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs
@@ -49,6 +49,8 @@ use serialize::json::Json; @@ -49,6 +49,8 @@ use serialize::json::Json;
@@ -72,7 +72,7 @@ index 402fbcd..a211b84 100644
mod android_base; mod android_base;
mod apple_base; mod apple_base;
@@ -306,12 +308,13 @@ impl Target { @@ -346,12 +348,13 @@ impl Target {
/// ///
/// The error string could come from any of the APIs called, including /// The error string could come from any of the APIs called, including
/// filesystem access and JSON decoding. /// filesystem access and JSON decoding.
@@ -87,7 +87,7 @@ index 402fbcd..a211b84 100644
fn load_file(path: &Path) -> Result<Target, String> { fn load_file(path: &Path) -> Result<Target, String> {
let mut f = try!(File::open(path).map_err(|e| e.to_string())); let mut f = try!(File::open(path).map_err(|e| e.to_string()));
@@ -400,9 +403,14 @@ impl Target { @@ -447,9 +450,14 @@ impl Target {
let target_path = env::var_os("RUST_TARGET_PATH") let target_path = env::var_os("RUST_TARGET_PATH")
.unwrap_or(OsString::new()); .unwrap_or(OsString::new());
@@ -105,5 +105,5 @@ index 402fbcd..a211b84 100644
if p.is_file() { if p.is_file() {
return load_file(&p); return load_file(&p);
-- --
2.4.3 2.4.10
@@ -1,7 +1,7 @@
From 057d6be30ff1437a53132175720c96fa93826a08 Mon Sep 17 00:00:00 2001 From b544f5bfa38d5932db23214e168988d05cbc5620 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com> From: Cody P Schafer <dev@codyps.com>
Date: Tue, 18 Nov 2014 14:52:56 -0500 Date: Tue, 18 Nov 2014 14:52:56 -0500
Subject: [PATCH 3/8] mk: for stage0, use RUSTFLAGS to override target libs dir Subject: [PATCH 3/9] mk: for stage0, use RUSTFLAGS to override target libs dir
Setting HLIB specially for stage0 (and even more specially for windows) Setting HLIB specially for stage0 (and even more specially for windows)
also affects the location we place TLIB. To keep the TLIBs we build in also affects the location we place TLIB. To keep the TLIBs we build in
@@ -12,10 +12,10 @@ stage0-rustc at the appropriate location.
1 file changed, 11 insertions(+), 8 deletions(-) 1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/mk/main.mk b/mk/main.mk diff --git a/mk/main.mk b/mk/main.mk
index 3926119..165afc3 100644 index 34f8247..896c1df 100644
--- a/mk/main.mk --- a/mk/main.mk
+++ b/mk/main.mk +++ b/mk/main.mk
@@ -370,21 +370,22 @@ define SREQ @@ -376,21 +376,22 @@ define SREQ
# Destinations of artifacts for the host compiler # Destinations of artifacts for the host compiler
HROOT$(1)_H_$(3) = $(3)/stage$(1) HROOT$(1)_H_$(3) = $(3)/stage$(1)
HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
@@ -46,7 +46,7 @@ index 3926119..165afc3 100644
# Preqrequisites for using the stageN compiler # Preqrequisites for using the stageN compiler
ifeq ($(1),0) ifeq ($(1),0)
HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3))
@@ -496,6 +497,7 @@ STAGE$(1)_T_$(2)_H_$(3) := \ @@ -502,6 +503,7 @@ STAGE$(1)_T_$(2)_H_$(3) := \
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \ $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
--cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \ --cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \ $$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
@@ -54,7 +54,7 @@ index 3926119..165afc3 100644
$$(RUSTC_FLAGS_$(2)) $$(RUSTC_FLAGS_$(2))
PERF_STAGE$(1)_T_$(2)_H_$(3) := \ PERF_STAGE$(1)_T_$(2)_H_$(3) := \
@@ -504,6 +506,7 @@ PERF_STAGE$(1)_T_$(2)_H_$(3) := \ @@ -510,6 +512,7 @@ PERF_STAGE$(1)_T_$(2)_H_$(3) := \
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \ $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
--cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \ --cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \ $$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
@@ -63,5 +63,5 @@ index 3926119..165afc3 100644
endef endef
-- --
2.4.3 2.4.10
@@ -1,14 +1,14 @@
From af95f47a39a91a3e4a58b1df6c48bc4e010520c6 Mon Sep 17 00:00:00 2001 From 004ddead436887fe99bfa9d0d25f6cdaf9f6148b Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com> From: Cody P Schafer <dev@codyps.com>
Date: Tue, 18 Nov 2014 13:48:14 -0500 Date: Tue, 18 Nov 2014 13:48:14 -0500
Subject: [PATCH 4/8] mk: add missing CFG_LIBDIR_RELATIVE Subject: [PATCH 4/9] mk: add missing CFG_LIBDIR_RELATIVE
--- ---
mk/grammar.mk | 4 ++-- mk/grammar.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-) 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mk/grammar.mk b/mk/grammar.mk diff --git a/mk/grammar.mk b/mk/grammar.mk
index d9c66e2..585206d 100644 index 0d527bd..926f247 100644
--- a/mk/grammar.mk --- a/mk/grammar.mk
+++ b/mk/grammar.mk +++ b/mk/grammar.mk
@@ -11,8 +11,8 @@ @@ -11,8 +11,8 @@
@@ -23,5 +23,5 @@ index d9c66e2..585206d 100644
ifeq ($(CFG_OSTYPE),apple-darwin) ifeq ($(CFG_OSTYPE),apple-darwin)
FLEX_LDFLAGS=-ll FLEX_LDFLAGS=-ll
-- --
2.4.3 2.4.10
@@ -1,7 +1,7 @@
From 08aecf1062fd85207e9b5c688b84def523eb05a0 Mon Sep 17 00:00:00 2001 From 1197d6ec82df147e8bbe0d42017fe1ee75804369 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com> From: Cody P Schafer <dev@codyps.com>
Date: Mon, 24 Nov 2014 13:10:15 -0500 Date: Mon, 24 Nov 2014 13:10:15 -0500
Subject: [PATCH 05/10] configure: support --bindir, and extend libdir to Subject: [PATCH 5/9] configure: support --bindir, and extend libdir to
non-blessed dirs non-blessed dirs
Adds --bindir, and: Adds --bindir, and:
@@ -23,7 +23,7 @@ windows platforms
7 files changed, 90 insertions(+), 71 deletions(-) 7 files changed, 90 insertions(+), 71 deletions(-)
diff --git a/configure b/configure diff --git a/configure b/configure
index 2c8d785..d214382 100755 index 60d3661..01c447b 100755
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -334,6 +334,31 @@ enable_if_not_disabled() { @@ -334,6 +334,31 @@ enable_if_not_disabled() {
@@ -58,7 +58,7 @@ index 2c8d785..d214382 100755
to_llvm_triple() { to_llvm_triple() {
case $1 in case $1 in
i686-w64-mingw32) echo i686-pc-windows-gnu ;; i686-w64-mingw32) echo i686-pc-windows-gnu ;;
@@ -626,6 +651,8 @@ putvar CFG_BUILD # Yes, this creates a duplicate entry, but the last one wins. @@ -632,6 +657,8 @@ putvar CFG_BUILD # Yes, this creates a duplicate entry, but the last one wins.
CFG_HOST=$(to_llvm_triple $CFG_HOST) CFG_HOST=$(to_llvm_triple $CFG_HOST)
CFG_TARGET=$(to_llvm_triple $CFG_TARGET) CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
@@ -67,7 +67,7 @@ index 2c8d785..d214382 100755
# On windows we just store the libraries in the bin directory because # On windows we just store the libraries in the bin directory because
# there's no rpath. This is where the build system itself puts libraries; # there's no rpath. This is where the build system itself puts libraries;
# --libdir is used to configure the installation directory. # --libdir is used to configure the installation directory.
@@ -633,24 +660,21 @@ CFG_TARGET=$(to_llvm_triple $CFG_TARGET) @@ -639,24 +666,21 @@ CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
if [ "$CFG_OSTYPE" = "pc-windows-gnu" ] || [ "$CFG_OSTYPE" = "pc-windows-msvc" ] if [ "$CFG_OSTYPE" = "pc-windows-gnu" ] || [ "$CFG_OSTYPE" = "pc-windows-msvc" ]
then then
CFG_LIBDIR_RELATIVE=bin CFG_LIBDIR_RELATIVE=bin
@@ -101,7 +101,7 @@ index 2c8d785..d214382 100755
fi fi
if [ $HELP -eq 1 ] if [ $HELP -eq 1 ]
@@ -1685,6 +1709,7 @@ putvar CFG_PREFIX @@ -1733,6 +1757,7 @@ putvar CFG_PREFIX
putvar CFG_HOST putvar CFG_HOST
putvar CFG_TARGET putvar CFG_TARGET
putvar CFG_LIBDIR_RELATIVE putvar CFG_LIBDIR_RELATIVE
@@ -129,10 +129,10 @@ index 59a0095..b8e8345 100644
endef endef
diff --git a/mk/main.mk b/mk/main.mk diff --git a/mk/main.mk b/mk/main.mk
index d907628..6782bed 100644 index 896c1df..ab12166 100644
--- a/mk/main.mk --- a/mk/main.mk
+++ b/mk/main.mk +++ b/mk/main.mk
@@ -338,7 +338,9 @@ export CFG_RELEASE_CHANNEL @@ -345,7 +345,9 @@ export CFG_RELEASE_CHANNEL
export CFG_LLVM_ROOT export CFG_LLVM_ROOT
export CFG_PREFIX export CFG_PREFIX
export CFG_LIBDIR export CFG_LIBDIR
@@ -142,7 +142,7 @@ index d907628..6782bed 100644
export CFG_DISABLE_INJECT_STD_VERSION export CFG_DISABLE_INJECT_STD_VERSION
ifdef CFG_DISABLE_UNSTABLE_FEATURES ifdef CFG_DISABLE_UNSTABLE_FEATURES
CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES)) CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES))
@@ -368,7 +370,16 @@ define SREQ @@ -375,7 +377,16 @@ define SREQ
# Destinations of artifacts for the host compiler # Destinations of artifacts for the host compiler
HROOT$(1)_H_$(3) = $(3)/stage$(1) HROOT$(1)_H_$(3) = $(3)/stage$(1)
@@ -180,22 +180,22 @@ index 16cbaab..f8a354c 100644
endif endif
diff --git a/mk/prepare.mk b/mk/prepare.mk diff --git a/mk/prepare.mk b/mk/prepare.mk
index fe619cc..b8aa0cb 100644 index e263a6d..45590ab 100644
--- a/mk/prepare.mk --- a/mk/prepare.mk
+++ b/mk/prepare.mk +++ b/mk/prepare.mk
@@ -186,10 +186,10 @@ INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\ @@ -186,10 +186,10 @@ INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\
define DEF_PREPARE define DEF_PREPARE
prepare-base-$(1): PREPARE_SOURCE_DIR=$$(PREPARE_HOST)/stage$$(PREPARE_STAGE) prepare-base-$(1)-%: PREPARE_SOURCE_DIR=$$(PREPARE_HOST)/stage$$(PREPARE_STAGE)
-prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/bin -prepare-base-$(1)-%: PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/bin
+prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_BINDIR_RELATIVE) +prepare-base-$(1)-%: PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_BINDIR_RELATIVE)
prepare-base-$(1): PREPARE_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_LIBDIR_RELATIVE) prepare-base-$(1)-%: PREPARE_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_LIBDIR_RELATIVE)
prepare-base-$(1): PREPARE_SOURCE_MAN_DIR=$$(S)/man prepare-base-$(1)-%: PREPARE_SOURCE_MAN_DIR=$$(S)/man
-prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/bin -prepare-base-$(1)-%: PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/bin
+prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_BINDIR_RELATIVE) +prepare-base-$(1)-%: PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_BINDIR_RELATIVE)
prepare-base-$(1): PREPARE_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE) prepare-base-$(1)-%: PREPARE_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)
prepare-base-$(1): PREPARE_DEST_MAN_DIR=$$(PREPARE_DEST_DIR)/share/man/man1 prepare-base-$(1)-%: PREPARE_DEST_MAN_DIR=$$(PREPARE_DEST_DIR)/share/man/man1
prepare-base-$(1): prepare-everything-$(1)
diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs
index 311ab1c..1b03b1a 100644 index 311ab1c..1b03b1a 100644
--- a/src/librustc/metadata/filesearch.rs --- a/src/librustc/metadata/filesearch.rs
@@ -341,10 +341,10 @@ index 311ab1c..1b03b1a 100644
// Used to be "rustc", now the default is "rustlib" // Used to be "rustc", now the default is "rustlib"
pub fn rustlibdir() -> String { pub fn rustlibdir() -> String {
diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
index 5bdc76b..25dd2e6 100644 index 6171ff1..32f41ff 100644
--- a/src/librustc_trans/back/link.rs --- a/src/librustc_trans/back/link.rs
+++ b/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs
@@ -1011,11 +1011,10 @@ fn link_args(cmd: &mut Linker, @@ -1033,11 +1033,10 @@ fn link_args(cmd: &mut Linker,
// where extern libraries might live, based on the // where extern libraries might live, based on the
// addl_lib_search_paths // addl_lib_search_paths
if sess.opts.cg.rpath { if sess.opts.cg.rpath {
@@ -358,5 +358,5 @@ index 5bdc76b..25dd2e6 100644
path.push(&tlib); path.push(&tlib);
-- --
2.5.1 2.4.10
@@ -1,17 +1,17 @@
From 1aebe22b98f797765293bafc1f5e8990a742b291 Mon Sep 17 00:00:00 2001 From 68662f758244a476b64b0772d93c7a1731e9d1ad Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com> From: Cody P Schafer <dev@codyps.com>
Date: Wed, 3 Dec 2014 19:15:19 -0500 Date: Wed, 3 Dec 2014 19:15:19 -0500
Subject: [PATCH 06/10] std/thread_local: workaround for NULL __dso_handle Subject: [PATCH 6/9] std/thread_local: workaround for NULL __dso_handle
--- ---
src/libstd/thread/local.rs | 2 +- src/libstd/thread/local.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index 9a6d68a..37a0ea0 100644 index c204f79..b2f6f1d 100644
--- a/src/libstd/thread/local.rs --- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs +++ b/src/libstd/thread/local.rs
@@ -337,7 +337,7 @@ mod imp { @@ -338,7 +338,7 @@ mod imp {
#[linkage = "extern_weak"] #[linkage = "extern_weak"]
static __cxa_thread_atexit_impl: *const libc::c_void; static __cxa_thread_atexit_impl: *const libc::c_void;
} }
@@ -21,5 +21,5 @@ index 9a6d68a..37a0ea0 100644
arg: *mut u8, arg: *mut u8,
dso_handle: *mut u8) -> libc::c_int; dso_handle: *mut u8) -> libc::c_int;
-- --
2.5.1 2.4.10
@@ -0,0 +1,30 @@
From be3663fcd9ae11a207b3c1649917bfff3c69b1c4 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 2 Mar 2015 13:34:59 -0500
Subject: [PATCH 7/9] mk/install: use disable-rewrite-paths
This stops the install scripts from doing work we've already handled.
Path rewriting is only useful for prepackaged binary installers.
---
mk/install.mk | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mk/install.mk b/mk/install.mk
index 8b81702..4fed072 100644
--- a/mk/install.mk
+++ b/mk/install.mk
@@ -12,7 +12,9 @@ RUN_INSALLER = cd tmp/empty_dir && \
sh ../../tmp/dist/$(1)/install.sh \
--prefix="$(DESTDIR)$(CFG_PREFIX)" \
--libdir="$(DESTDIR)$(CFG_LIBDIR)" \
- --mandir="$(DESTDIR)$(CFG_MANDIR)"
+ --mandir="$(DESTDIR)$(CFG_MANDIR)" \
+ "$(MAYBE_DISABLE_VERIFY)"
+ --disable-rewrite-paths
install:
ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER)))
--
2.4.10
@@ -0,0 +1,28 @@
From d7aa5e6824e8658c01f702259eebac02553fb7b8 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Tue, 26 May 2015 12:09:36 -0400
Subject: [PATCH 8/9] install: disable ldconfig
---
mk/install.mk | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mk/install.mk b/mk/install.mk
index 4fed072..92e66cd 100644
--- a/mk/install.mk
+++ b/mk/install.mk
@@ -13,8 +13,9 @@ RUN_INSALLER = cd tmp/empty_dir && \
--prefix="$(DESTDIR)$(CFG_PREFIX)" \
--libdir="$(DESTDIR)$(CFG_LIBDIR)" \
--mandir="$(DESTDIR)$(CFG_MANDIR)" \
- "$(MAYBE_DISABLE_VERIFY)"
- --disable-rewrite-paths
+ "$(MAYBE_DISABLE_VERIFY)" \
+ --disable-rewrite-paths \
+ --disable-ldconfig
install:
ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER)))
--
2.4.10
@@ -1,17 +1,17 @@
From ffacbea82a7e03fadc05d31313e2bbd3e10388fb Mon Sep 17 00:00:00 2001 From e6888f9b888911bdbd52e2ee7c37914ee4cee0e2 Mon Sep 17 00:00:00 2001
From: Steven Walter <swalter@lexmark.com> From: Steven Walter <swalter@lexmark.com>
Date: Tue, 7 Jul 2015 14:57:42 -0400 Date: Tue, 7 Jul 2015 14:57:42 -0400
Subject: [PATCH 09/10] Remove crate metadata from symbol hashing Subject: [PATCH 9/9] Remove crate metadata from symbol hashing
--- ---
src/librustc_trans/back/link.rs | 5 ----- src/librustc_trans/back/link.rs | 5 -----
1 file changed, 5 deletions(-) 1 file changed, 5 deletions(-)
diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
index 25dd2e6..d203d07 100644 index 32f41ff..2a87cd7 100644
--- a/src/librustc_trans/back/link.rs --- a/src/librustc_trans/back/link.rs
+++ b/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs
@@ -206,11 +206,6 @@ fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>, @@ -212,11 +212,6 @@ fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>,
symbol_hasher.reset(); symbol_hasher.reset();
symbol_hasher.input_str(&link_meta.crate_name); symbol_hasher.input_str(&link_meta.crate_name);
symbol_hasher.input_str("-"); symbol_hasher.input_str("-");
@@ -20,9 +20,9 @@ index 25dd2e6..d203d07 100644
- symbol_hasher.input_str(&meta[..]); - symbol_hasher.input_str(&meta[..]);
- } - }
- symbol_hasher.input_str("-"); - symbol_hasher.input_str("-");
symbol_hasher.input_str(&encoder::encoded_ty(tcx, t)); symbol_hasher.input(&encoder::encoded_ty(tcx, t));
// Prefix with 'h' so that it never blends into adjacent digits // Prefix with 'h' so that it never blends into adjacent digits
let mut hash = String::from("h"); let mut hash = String::from("h");
-- --
2.5.1 2.4.10
@@ -0,0 +1,158 @@
From 1bd3ab55ce24b2a54e021ba471a5f934b3b9ad6b Mon Sep 17 00:00:00 2001
From: Steven Walter <swalter@lexmark.com>
Date: Tue, 7 Jul 2015 16:49:44 -0400
Subject: [PATCH 10/12] rustc_trans: make .note.rustc look more like debug info
Mark the global variable as const and private so the resulting section
is not flagged as writable and to avoid putting an unnecessary symbol in
the dynamic table of shared objects.
Unfortunately there doesn't seem to be a way to avoid the section being
marked SHF_ALLOC when declared as a variable in LLVM. Hack around that
by using objcopy to clear the flags on the section before the final
link.
This places the section at the end of the executable so it can be
stripped later without rearranging important code/data sections.
---
mk/platform.mk | 1 +
src/librustc/session/config.rs | 2 ++
src/librustc_back/target/mod.rs | 4 ++++
src/librustc_trans/back/link.rs | 38 ++++++++++++++++++++++++++++++++++++++
src/librustc_trans/trans/base.rs | 3 +++
5 files changed, 48 insertions(+)
diff --git a/mk/platform.mk b/mk/platform.mk
index 0c90632..4681783 100644
--- a/mk/platform.mk
+++ b/mk/platform.mk
@@ -181,6 +181,7 @@ define CFG_MAKE_TOOLCHAIN
AR_$(1)=$(CROSS_PREFIX_$(1))$(AR_$(1))
LINK_$(1)=$(CROSS_PREFIX_$(1))$(LINK_$(1))
RUSTC_CROSS_FLAGS_$(1)=-C linker=$$(call FIND_COMPILER,$$(LINK_$(1))) \
+ -C objcopy=$$(call FIND_COMPILER,$$(OBJCOPY_$(1))) \
-C ar=$$(call FIND_COMPILER,$$(AR_$(1))) $(RUSTC_CROSS_FLAGS_$(1))
RUSTC_FLAGS_$(1)=$$(RUSTC_CROSS_FLAGS_$(1)) $(RUSTC_FLAGS_$(1))
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index ecb38d4..b74b3c4 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -460,6 +460,8 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
CG_OPTIONS, cg_type_desc, cgsetters,
ar: Option<String> = (None, parse_opt_string,
"tool to assemble archives with"),
+ objcopy: Option<String> = (None, parse_opt_string,
+ "system objcopy for manipulating objects"),
linker: Option<String> = (None, parse_opt_string,
"system linker to link outputs with"),
link_args: Option<Vec<String>> = (None, parse_opt_list,
diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs
index 3ffa484..d52e67c 100644
--- a/src/librustc_back/target/mod.rs
+++ b/src/librustc_back/target/mod.rs
@@ -110,6 +110,8 @@ pub struct TargetOptions {
/// sysroot folder.
pub pre_link_objects: Vec<String>,
pub post_link_objects: Vec<String>,
+ /// Path to objcopy. Defaults to "objcopy".
+ pub objcopy: String,
/// Default CPU to pass to LLVM. Corresponds to `llc -mcpu=$cpu`. Defaults
/// to "default".
pub cpu: String,
@@ -198,6 +200,7 @@ impl Default for TargetOptions {
ar: option_env!("CFG_DEFAULT_AR").unwrap_or("ar").to_string(),
pre_link_args: Vec::new(),
post_link_args: Vec::new(),
+ objcopy: "objcopy".to_string(),
cpu: "generic".to_string(),
features: "".to_string(),
dynamic_linking: false,
@@ -314,6 +317,7 @@ impl Target {
key!(cpu);
key!(ar);
key!(linker);
+ key!(objcopy);
key!(relocation_model);
key!(code_model);
key!(dll_prefix);
diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
index 2a87cd7..53fa913 100644
--- a/src/librustc_trans/back/link.rs
+++ b/src/librustc_trans/back/link.rs
@@ -393,6 +393,13 @@ fn command_path(sess: &Session) -> OsString {
env::join_paths(new_path).unwrap()
}
+pub fn get_objcopy_prog(sess: &Session) -> String {
+ match sess.opts.cg.objcopy {
+ Some(ref objcopy) => return objcopy.to_string(),
+ None => sess.target.target.options.objcopy.clone(),
+ }
+}
+
pub fn remove(sess: &Session, path: &Path) {
match fs::remove_file(path) {
Ok(..) => {}
@@ -919,6 +926,34 @@ fn link_natively(sess: &Session, dylib: bool,
}
}
+fn fix_meta_section_attributes(sess: &Session, meta_name: &PathBuf) {
+ // First, fix up the note section attributes. We want the SHF_ALLOC and
+ // SHF_WRITE flags to be unset so the section will get placed near the
+ // end along with the debug info. This allows the section to be
+ // stripped later without renumbering important sections that
+ // contain code and data.
+ let objcopy = get_objcopy_prog(sess);
+ let mut o_cmd = Command::new(&objcopy);
+ o_cmd.arg("--rename-section")
+ .arg(".note.rustc=.note.rustc,contents,noload,readonly")
+ .arg(&meta_name);
+ // Invoke objcopy
+ info!("{:?}", o_cmd);
+ match o_cmd.status() {
+ Ok(exitstatus) => {
+ if !exitstatus.success() {
+ sess.err(&format!("objcopy failed with exit code {:?}", exitstatus.code()));
+ sess.note(&format!("{:?}", &o_cmd));
+ }
+ },
+ Err(exitstatus) => {
+ sess.err(&format!("objcopy failed: {}", exitstatus));
+ sess.note(&format!("{:?}", &o_cmd));
+ }
+ }
+ sess.abort_if_errors();
+}
+
fn link_args(cmd: &mut Linker,
sess: &Session,
dylib: bool,
@@ -951,6 +986,9 @@ fn link_args(cmd: &mut Linker,
// executable. This metadata is in a separate object file from the main
// object file, so we link that in here.
if dylib {
+ let meta_name = outputs.with_extension("metadata.o");
+
+ fix_meta_section_attributes(sess, &meta_name);
cmd.add_object(&outputs.with_extension("metadata.o"));
}
diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs
index 14fea61..df019f7 100644
--- a/src/librustc_trans/trans/base.rs
+++ b/src/librustc_trans/trans/base.rs
@@ -2560,6 +2560,9 @@ pub fn write_metadata(cx: &SharedCrateContext, krate: &hir::Crate,
};
unsafe {
llvm::LLVMSetInitializer(llglobal, llconst);
+ llvm::LLVMSetGlobalConstant(llglobal, llvm::True);
+ llvm::LLVMSetUnnamedAddr(llglobal, llvm::True);
+ llvm::SetLinkage(llglobal, llvm::Linkage::PrivateLinkage);
let name = loader::meta_section_name(&cx.sess().target.target);
let name = CString::new(name).unwrap();
llvm::LLVMSetSection(llglobal, name.as_ptr())
--
1.9.1
@@ -0,0 +1,78 @@
From 128a81ede6b188637743a37a582b2267a49d0a32 Mon Sep 17 00:00:00 2001
From: Steven Walter <swalter@lexmark.com>
Date: Wed, 18 Nov 2015 08:33:26 -0500
Subject: [PATCH 11/12] Allow overriding crate_hash with -C crate_hash
The current crate hash is not stable from run-to-run. This causes
problems with bitbake; it needs a guarantee that every build with the
same input will generate compatible output, otherwise sstate won't work.
Using -C crate_hash, we can do that by using the bitbake input hash to
determine the crate hash; the bitbake input hash will be stable, but
still different for different rust recipes.
---
src/librustc/session/config.rs | 2 ++
src/librustc_trans/back/link.rs | 26 ++++++++++++++++++++++++--
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index b74b3c4..a11cb90 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -500,6 +500,8 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
"choose the code model to use (llc -code-model for details)"),
metadata: Vec<String> = (Vec::new(), parse_list,
"metadata to mangle symbol names with"),
+ crate_hash: String = ("".to_string(), parse_string,
+ "override crate hash with given value"),
extra_filename: String = ("".to_string(), parse_string,
"extra data to put in each output filename"),
codegen_units: usize = (1, parse_uint,
diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
index 53fa913..83619ae 100644
--- a/src/librustc_trans/back/link.rs
+++ b/src/librustc_trans/back/link.rs
@@ -46,7 +46,7 @@ use std::str;
use flate;
use serialize::hex::ToHex;
use syntax::ast;
-use syntax::codemap::Span;
+use syntax::codemap::{Span,BytePos,NO_EXPANSION};
use syntax::parse::token::{self, InternedString};
use syntax::attr::AttrMetaMethods;
@@ -185,9 +185,31 @@ pub fn find_crate_name(sess: Option<&Session>,
pub fn build_link_meta(sess: &Session, krate: &hir::Crate,
name: &str) -> LinkMeta {
+ let crate_hash = if sess.opts.cg.crate_hash != "" {
+ let dummy_span = Span {
+ lo: BytePos(0),
+ hi: BytePos(0),
+ expn_id: NO_EXPANSION
+ };
+ let dummy_module = hir::Mod {
+ inner: dummy_span,
+ items: vec!()
+ };
+ let dummy_krate = hir::Crate {
+ module: dummy_module,
+ attrs: vec!(),
+ config: vec!(),
+ span: dummy_span,
+ exported_macros: vec!()
+ };
+
+ Svh::calculate(&vec!(sess.opts.cg.crate_hash.clone()), &dummy_krate)
+ } else {
+ Svh::calculate(&sess.opts.cg.metadata, krate)
+ };
let r = LinkMeta {
crate_name: name.to_owned(),
- crate_hash: Svh::calculate(&sess.opts.cg.metadata, krate),
+ crate_hash: crate_hash,
};
info!("{:?}", r);
return r;
--
1.9.1
@@ -0,0 +1,25 @@
From d0fa41075317425b01262dd539c01e87e2eaf5f4 Mon Sep 17 00:00:00 2001
From: Steven Walter <swalter@lexmark.com>
Date: Wed, 18 Nov 2015 08:41:17 -0500
Subject: [PATCH 12/12] mk/platform.mk: pass -C crate_hash to builds
bitbake recipe will export FORCE_CRATE_HASH
---
mk/platform.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/mk/platform.mk b/mk/platform.mk
index 4681783..59aa560 100644
--- a/mk/platform.mk
+++ b/mk/platform.mk
@@ -182,6 +182,7 @@ define CFG_MAKE_TOOLCHAIN
LINK_$(1)=$(CROSS_PREFIX_$(1))$(LINK_$(1))
RUSTC_CROSS_FLAGS_$(1)=-C linker=$$(call FIND_COMPILER,$$(LINK_$(1))) \
-C objcopy=$$(call FIND_COMPILER,$$(OBJCOPY_$(1))) \
+ -C crate_hash=$(FORCE_CRATE_HASH) \
-C ar=$$(call FIND_COMPILER,$$(AR_$(1))) $(RUSTC_CROSS_FLAGS_$(1))
RUSTC_FLAGS_$(1)=$$(RUSTC_CROSS_FLAGS_$(1)) $(RUSTC_FLAGS_$(1))
--
1.9.1
@@ -0,0 +1,56 @@
From 1fbfa088007054c655741e547bb3e72f1d5f1746 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Thu, 4 Feb 2016 10:44:23 -0500
Subject: [PATCH] mk: allow changing the platform configuration source
directory
---
configure | 4 +++-
mk/platform.mk | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 01c447b..0f004cf 100755
--- a/configure
+++ b/configure
@@ -650,6 +650,7 @@ valopt_nosave local-rust-root "/usr/local" "set prefix for local rust binary"
valopt_nosave host "${CFG_BUILD}" "GNUs ./configure syntax LLVM host triples"
valopt_nosave target "${CFG_HOST}" "GNUs ./configure syntax LLVM target triples"
valopt_nosave mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
+valopt_nosave platform-cfg "${CFG_SRC_DIR}/mk/cfg" "Location platform configuration for non-rust code"
# Temporarily support old triples until buildbots get updated
CFG_BUILD=$(to_llvm_triple $CFG_BUILD)
@@ -1110,7 +1111,7 @@ CFG_MANDIR=${CFG_MANDIR%/}
CFG_HOST="$(echo $CFG_HOST | tr ',' ' ')"
CFG_TARGET="$(echo $CFG_TARGET | tr ',' ' ')"
CFG_SUPPORTED_TARGET=""
-for target_file in ${CFG_SRC_DIR}mk/cfg/*.mk; do
+for target_file in ${CFG_PLATFORM_CFG}/*.mk; do
CFG_SUPPORTED_TARGET="${CFG_SUPPORTED_TARGET} $(basename "$target_file" .mk)"
done
@@ -1763,6 +1764,7 @@ putvar CFG_AARCH64_LINUX_ANDROID_NDK
putvar CFG_ARM_LINUX_ANDROIDEABI_NDK
putvar CFG_I686_LINUX_ANDROID_NDK
putvar CFG_MANDIR
+putvar CFG_PLATFORM_CFG
# Avoid spurious warnings from clang by feeding it original source on
# ccache-miss rather than preprocessed input.
diff --git a/mk/platform.mk b/mk/platform.mk
index 59aa560..a964d6f 100644
--- a/mk/platform.mk
+++ b/mk/platform.mk
@@ -112,7 +112,7 @@ $(foreach cvar,CC CXX CPP CFLAGS CXXFLAGS CPPFLAGS, \
CFG_RLIB_GLOB=lib$(1)-*.rlib
-include $(wildcard $(CFG_SRC_DIR)mk/cfg/*.mk)
+include $(wildcard $(CFG_PLATFORM_CFG)/*.mk)
define ADD_INSTALLED_OBJECTS
INSTALLED_OBJECTS_$(1) += $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt)
--
2.7.0
-15
View File
@@ -1,15 +0,0 @@
SRC_URI[rust.md5sum] = "ffb3971cc96eccaf2de202f621fd415f"
SRC_URI[rust.sha256sum] = "ea02d7bc9e7de5b8be3fe6b37ea9b2bd823f9a532c8e4c47d02f37f24ffa3126"
## snapshot info taken from rust/src/snapshots.txt
## TODO: find a way to add aditional SRC_URIs based on the contents of an
## earlier SRC_URI.
RS_DATE = "2015-07-26"
RS_SRCHASH = "a5c12f4"
# linux-x86_64
RS_ARCH = "linux-x86_64"
RS_HASH = "e451e3bd6e5fcef71e41ae6f3da9fb1cf0e13a0c"
RUST_SNAPSHOT = "rust-stage0-${RS_DATE}-${RS_SRCHASH}-${RS_ARCH}-${RS_HASH}.tar.bz2"
SRC_URI[rust-snapshot.md5sum] = "8f804ec5cebf370c59563a2b35a808cb"
SRC_URI[rust-snapshot.sha256sum] = "779943595dd63d6869c747e2a31c13095f9c5354d4530327d6f9310cc580c2ff"
+44
View File
@@ -0,0 +1,44 @@
require rust.inc
inherit cross
# Otherwise we'll depend on what we provide
INHIBIT_DEFAULT_RUST_DEPS = "1"
# Unlike native (which nicely maps it's DEPENDS) cross wipes them out completely.
# Generally, we (and cross in general) need the same things that native needs,
# so it might make sense to take it's mapping. For now, though, we just mention
# the bits we need explicitly.
DEPENDS += "rust-llvm-native"
DEPENDS += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc"
PROVIDES = "virtual/${TARGET_PREFIX}rust"
PN = "rust-cross-${TARGET_ARCH}"
# In the cross compilation case, rustc doesn't seem to get the rpath quite
# right. It manages to include '../../lib/${TARGET_PREFIX}', but doesn't
# include the '../../lib' (ie: relative path from cross_bindir to normal
# libdir. As a result, we end up not being able to properly reference files in normal ${libdir}.
# Most of the time this happens to work fine as the systems libraries are
# subsituted, but sometimes a host system will lack a library, or the right
# version of a library (libtinfo was how I noticed this).
#
# FIXME: this should really be fixed in rust itself.
# FIXME: using hard-coded relative paths is wrong, we should ask bitbake for
# the relative path between 2 of it's vars.
HOST_POST_LINK_ARGS_append = " -Wl,-rpath=../../lib"
BUILD_POST_LINK_ARGS_append = " -Wl,-rpath=../../lib"
# We need the same thing for the calls to the compiler when building the runtime crap
TARGET_CC_ARCH_append = " --sysroot=${STAGING_DIR_TARGET}"
# cross.bbclass is "helpful" and overrides our do_install. Tell it not to.
do_install () {
rust_do_install
}
# using host-strip on target .so files generated by this recipie causes build errors.
# for now, disable stripping.
# A better (but more complex) approach would be to mimic gcc-runtime and build
# the target.so files in a seperate .bb file.
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
-7
View File
@@ -1,7 +0,0 @@
SRC_URI = "\
gitsm://github.com/rust-lang/rust.git;protocol=https \
"
S = "${WORKDIR}/git"
PV .= "+git${SRCPV}"
require rust.inc
+9
View File
@@ -0,0 +1,9 @@
require rust-llvm.inc
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa"
do_install_append () {
cd "${B}"
install -d "${D}${bindir}"
install -m755 "Release/bin/FileCheck" "${D}${bindir}"
}
+16 -2
View File
@@ -1,8 +1,9 @@
require rust-shared-source.inc
SUMMARY = "LLVM compiler framework (packaged with rust)" SUMMARY = "LLVM compiler framework (packaged with rust)"
LICENSE = "NCSA" LICENSE = "NCSA"
S = "${WORKDIR}/rustc-${PV}/src/llvm" S .= "/src/llvm"
inherit autotools inherit autotools
@@ -11,17 +12,30 @@ EXTRA_OECONF += "--enable-optimized"
EXTRA_OECONF += "--disable-assertions" EXTRA_OECONF += "--disable-assertions"
EXTRA_OECONF += "--disable-docs" EXTRA_OECONF += "--disable-docs"
EXTRA_OECONF += "--enable-bindings=none" EXTRA_OECONF += "--enable-bindings=none"
EXTRA_OECONF += "--disable-terminfo"
EXTRA_OECONF += "--disable-zlib"
EXTRA_OECONF += "--disable-libffi"
EXTRA_OECONF += "--enable-keep-symbols" EXTRA_OECONF += "--enable-keep-symbols"
EXTRA_OECONF += "--disable-terminfo" EXTRA_OECONF += "--disable-terminfo"
EXTRA_OECONF += "--disable-zlib" EXTRA_OECONF += "--disable-zlib"
EXTRA_OECONF += "--disable-libffi" EXTRA_OECONF += "--disable-libffi"
PACKAGES += "${PN}-data"
# Add the extra locations to avoid the complaints about unpackaged files
FILES_${PN}-data = "${datadir}"
FILES_${PN}-dev += "${libdir}"
do_install_append () { do_install_append () {
# Remove the debug info (>2 GB) as part of normal operation
rm -rf ${D}${bindir}/.debug
cd ${D}${bindir} cd ${D}${bindir}
ln -s *-llc llc ln -s *-llc llc
for i in *-llvm-*; do for i in *-llvm-*; do
link=$(echo $i | sed -e 's/.*-llvm-\(.*\)/\1/') link=$(echo $i | sed -e 's/.*-llvm-\(.*\)/\1/')
ln -s $i llvm-$link ln -sf $i llvm-$link
done done
} }
-5
View File
@@ -1,5 +0,0 @@
require rust-release.inc
require rust-${PV}.inc
require rust-llvm.inc
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa"
@@ -0,0 +1,3 @@
inherit shared-source-use
require rust-version.inc
S .= "/rustc-${PV}"
@@ -0,0 +1,14 @@
## snapshot info taken from rust/src/snapshots.txt
## TODO: find a way to add additional SRC_URIs based on the contents of an
## earlier SRC_URI.
RS_DATE = "2015-08-11"
RS_SRCHASH = "1af31d4"
# linux-x86_64
RS_ARCH = "linux-x86_64"
RS_HASH = "7df8ba9dec63ec77b857066109d4b6250f3d222f"
RUST_SNAPSHOT = "rust-stage0-${RS_DATE}-${RS_SRCHASH}-${RS_ARCH}-${RS_HASH}.tar.bz2"
SRC_URI[rust-snapshot.md5sum] = "53b2e1f553eaeb88e8d60d5380670283"
SRC_URI[rust-snapshot.sha256sum] = "5936f5ec4327d41f3aa9f98cbedebb6fd3d72715f8df578e0c9a669154c80bc3"
+31
View File
@@ -0,0 +1,31 @@
# In order to share the same source between multiple packages (.bb files), we
# unpack and patch the rustc source here into a shared dir.
#
# Take a look at gcc-source.inc for the general structure of this
inherit shared-source-provide
require rust-version.inc
require rust-release.inc
SRC_URI[rust.md5sum] = "234bd912481a04e93b7f2eff0d5b3485"
SRC_URI[rust.sha256sum] = "641037af7b7b6cad0b231cc20671f8a314fbf2f40fc0901d0b877c39fc8da5a0"
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=eb87dba71cb424233bcce88db3ae2f1a"
SRC_URI_append = "\
file://rust/0001-platform.mk-avoid-choking-on-i586.patch \
file://rust/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \
file://rust/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \
file://rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \
file://rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \
file://rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \
file://rust/0007-mk-install-use-disable-rewrite-paths.patch \
file://rust/0008-install-disable-ldconfig.patch \
file://rust/0009-Remove-crate-metadata-from-symbol-hashing.patch \
file://rust/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch \
file://rust/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch \
file://rust/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch \
file://rust/0013-mk-allow-changing-the-platform-configuration-source-.patch \
file://rust-llvm/0000-rust-llvm-remove-extra-slash.patch \
file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \
"
+6
View File
@@ -0,0 +1,6 @@
# Note: if you adjust this, you'll also need to change the hashes in
# rust-source.bb
SOURCE_NAME = "rust"
PV = "1.5.0"
LICENSE = "MIT | Apache-2.0"
+10
View File
@@ -0,0 +1,10 @@
require rust.inc
DEPENDS += "rust-llvm"
# Otherwise we'll depend on what we provide
INHIBIT_DEFAULT_RUST_DEPS_class-native = "1"
# We don't need to depend on gcc-native because yocto assumes it exists
PROVIDES_class-native = "virtual/${TARGET_PREFIX}rust"
BBCLASSEXTEND = "native"
+182 -151
View File
@@ -1,20 +1,22 @@
# ex: sts=4 et sw=4 ts=8
inherit rust inherit rust
inherit rust-installer inherit rust-installer
require rust-shared-source.inc
require rust-snapshot-2015-08-11.inc
LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=eb87dba71cb424233bcce88db3ae2f1a"
SUMMARY = "Rust compiler and runtime libaries" SUMMARY = "Rust compiler and runtime libaries"
HOMEPAGE = "http://www.rust-lang.org" HOMEPAGE = "http://www.rust-lang.org"
SECTION = "devel" SECTION = "devel"
LICENSE = "MIT | Apache-2.0"
B = "${WORKDIR}/build" B = "${WORKDIR}/build"
DEPENDS += "rust-llvm" DEPENDS += "file-native"
# Avoid having the default bitbake.conf disable sub-make parallelization # Avoid having the default bitbake.conf disable sub-make parallelization
EXTRA_OEMAKE = "" EXTRA_OEMAKE = ""
LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=b1ab5514343f97198b323e33779470a3"
PACKAGECONFIG ??= "" PACKAGECONFIG ??= ""
# Controls whether we use the local rust to build. # Controls whether we use the local rust to build.
@@ -28,6 +30,68 @@ SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '', 'https://sta
# We generate local targets, and need to be able to locate them # We generate local targets, and need to be able to locate them
export RUST_TARGET_PATH="${WORKDIR}/targets/" export RUST_TARGET_PATH="${WORKDIR}/targets/"
export FORCE_CRATE_HASH="${BB_TASKHASH}"
# Right now this is focused on arm-specific tune features.
# We get away with this for now as one can only use x86-64 as the build host
# (not arm).
# Note that TUNE_FEATURES is _always_ refering to the target, so we really
# don't want to use this for the host/build.
def llvm_features_from_tune(d):
f = []
feat = d.getVar('TUNE_FEATURES', True)
if not feat:
return ""
feat = frozenset(feat.split())
if 'vfpv4' in feat:
f.append("+vfp4")
if 'vfpv3' in feat:
f.append("+vfp3")
if 'vfpv3d16' in feat:
f.append("+d16")
if 'vfpv2' in feat or 'vfp' in feat:
f.append("+vfp2")
if 'neon' in feat:
f.append("+neon")
if 'aarch64' in feat:
f.append("+v8")
v7=frozenset(['armv7a', 'armv7r', 'armv7m', 'armv7ve'])
if not feat.isdisjoint(v7):
f.append("+v7")
if 'armv6' in feat:
f.append("+v6")
if 'dsp' in feat:
f.append("+dsp")
if d.getVar('ARM_THUMB_OPT', True) is "thumb":
if not feat.isdisjoint(v7):
f.append("+thumb2")
f.append("+thumb-mode")
if 'cortexa5' in feat:
f.append("+a5")
if 'cortexa7' in feat:
f.append("+a7")
if 'cortexa9' in feat:
f.append("+a9")
if 'cortexa15' in feat:
f.append("+a15")
if 'cortexa17' in feat:
f.append("+a17")
# Seems like it could be infered by the lack of vfp options, but we'll
# include it anyhow
if 'soft' in feat:
f.append("+soft-float")
return ','.join(f)
## arm-unknown-linux-gnueabihf ## arm-unknown-linux-gnueabihf
DATA_LAYOUT[arm] = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32" DATA_LAYOUT[arm] = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32"
LLVM_TARGET[arm] = "${RUST_TARGET_SYS}" LLVM_TARGET[arm] = "${RUST_TARGET_SYS}"
@@ -136,6 +200,13 @@ def ldflags_for(d, thing, arch):
a.extend(post_link_args_for(d, thing, arch)) a.extend(post_link_args_for(d, thing, arch))
return a return a
TARGET_LLVM_FEATURES = "${@llvm_features_from_tune(d)}"
TARGET_LLVM_FEATURES_class-cross = "${@llvm_features_from_tune(d)}"
# class-native implies TARGET=HOST, and TUNE_FEATURES only describes the real
# (original) target.
TARGET_LLVM_FEATURES_class-native = ""
def rust_gen_target(d, thing, wd): def rust_gen_target(d, thing, wd):
arch = arch_for(d, thing) arch = arch_for(d, thing)
sys = sys_for(d, thing) sys = sys_for(d, thing)
@@ -151,7 +222,12 @@ def rust_gen_target(d, thing, wd):
prefix = d.getVar('{}_PREFIX'.format(thing), True) prefix = d.getVar('{}_PREFIX'.format(thing), True)
ccache = d.getVar('CCACHE', True) ccache = d.getVar('CCACHE', True)
linker = "{}{}gcc".format(ccache, prefix) linker = "{}{}gcc".format(ccache, prefix)
features = d.getVarFlag('FEATURES', arch, True) or "" objcopy = "{}objcopy".format(prefix)
features = ""
if thing is "TARGET":
features = d.getVar('TARGET_LLVM_FEATURES', True) or ""
features = features or d.getVarFlag('FEATURES', arch, True) or ""
pre_link_args = pre_link_args_for(d, thing, arch) pre_link_args = pre_link_args_for(d, thing, arch)
post_link_args = post_link_args_for(d, thing, arch) post_link_args = post_link_args_for(d, thing, arch)
@@ -165,6 +241,7 @@ def rust_gen_target(d, thing, wd):
"arch": "{}", "arch": "{}",
"os": "linux", "os": "linux",
"linker": "{}", "linker": "{}",
"objcopy": "{}",
"features": "{}", "features": "{}",
"dynamic-linking": true, "dynamic-linking": true,
"executables": true, "executables": true,
@@ -182,6 +259,7 @@ def rust_gen_target(d, thing, wd):
target_pointer_width, target_pointer_width,
arch_to_rust_target_arch(arch), arch_to_rust_target_arch(arch),
linker, linker,
objcopy,
features, features,
as_json(pre_link_args), as_json(pre_link_args),
as_json(post_link_args), as_json(post_link_args),
@@ -190,16 +268,15 @@ def rust_gen_target(d, thing, wd):
python do_rust_gen_targets () { python do_rust_gen_targets () {
wd = d.getVar('WORKDIR', True) + '/targets/' wd = d.getVar('WORKDIR', True) + '/targets/'
try: # It is important 'TARGET' is last here so that it overrides our less
os.makedirs(wd) # informed choices for BUILD & HOST if TARGET happens to be the same as
except OSError as e: # either of them.
if e.errno != 17:
raise e
for thing in ['BUILD', 'HOST', 'TARGET']: for thing in ['BUILD', 'HOST', 'TARGET']:
bb.debug(1, "rust_gen_target for " + thing) bb.debug(1, "rust_gen_target for " + thing)
rust_gen_target(d, thing, wd) rust_gen_target(d, thing, wd)
} }
addtask rust_gen_targets after do_patch before do_compile addtask rust_gen_targets after do_patch before do_compile
do_rust_gen_targets[dirs] += "${WORKDIR}/targets"
def rust_gen_mk_cfg(d, thing): def rust_gen_mk_cfg(d, thing):
'''' ''''
@@ -213,8 +290,8 @@ def rust_gen_mk_cfg(d, thing):
Note that the configure process also depends on the existence of #1, so we Note that the configure process also depends on the existence of #1, so we
have to run this before do_configure have to run this before do_configure
''' '''
import subprocess
import shutil, subprocess
rust_base_sys = rust_base_triple(d, thing) rust_base_sys = rust_base_triple(d, thing)
arch = arch_for(d, thing) arch = arch_for(d, thing)
sys = sys_for(d, thing) sys = sys_for(d, thing)
@@ -222,10 +299,9 @@ def rust_gen_mk_cfg(d, thing):
llvm_target = d.getVarFlag('LLVM_TARGET', arch, True) llvm_target = d.getVarFlag('LLVM_TARGET', arch, True)
ldflags = ' '.join(ldflags_for(d, thing, arch)) ldflags = ' '.join(ldflags_for(d, thing, arch))
p = d.getVar('S', True) + '/mk/cfg/' b = d.getVar('WORKDIR', True) + '/mk-cfg/'
o = open(b + sys_for(d, thing) + '.mk', 'w')
o = open(p + sys_for(d, thing) + '.mk', 'w') i = open(d.getVar('S', True) + '/mk/cfg/' + rust_base_sys + '.mk', 'r')
i = open(p + rust_base_sys + '.mk', 'r')
r = subprocess.call(['sed', r = subprocess.call(['sed',
# update all triplets to the new one # update all triplets to the new one
@@ -257,6 +333,9 @@ def rust_gen_mk_cfg(d, thing):
], stdout=o, stdin=i) ], stdout=o, stdin=i)
if r: if r:
raise Exception raise Exception
o.write("OBJCOPY_{} := {}objcopy\n".format(sys, prefix))
o.close()
i.close()
python do_rust_arch_fixup () { python do_rust_arch_fixup () {
for thing in ['BUILD', 'HOST', 'TARGET']: for thing in ['BUILD', 'HOST', 'TARGET']:
@@ -264,167 +343,119 @@ python do_rust_arch_fixup () {
rust_gen_mk_cfg(d, thing) rust_gen_mk_cfg(d, thing)
} }
addtask rust_arch_fixup before do_configure after do_patch addtask rust_arch_fixup before do_configure after do_patch
do_rust_arch_fixup[dirs] = "${S}/mk/cfg" do_rust_arch_fixup[dirs] += "${WORKDIR}/mk-cfg"
llvmdir = "${STAGING_DIR_NATIVE}/${prefix_native}" llvmdir = "${STAGING_DIR_NATIVE}/${prefix_native}"
do_configure () { do_configure () {
# FIXME: target_prefix vs prefix, see cross.bbclass # Note: when we adjust the generated targets, rust doesn't rebuild (even
# when it should), so for now we need to remove the build dir to keep
# things in sync.
cd "${WORKDIR}"
rm -rf "${B}/"
mkdir -p "${B}/"
cd "${B}"
# CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a # FIXME: target_prefix vs prefix, see cross.bbclass
# wide range of targets (not just HOST). Yocto's settings for them will
# be inappropriate, avoid using.
unset CFLAGS
unset LDFLAGS
unset CXXFLAGS
unset CPPFLAGS
# FIXME: this path to rustc (via `which rustc`) may not be quite right in the case # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a
# where we're reinstalling the compiler. May want to try for a real # wide range of targets (not just HOST). Yocto's settings for them will
# path based on bitbake vars # be inappropriate, avoid using.
# Also will be wrong when relative libdir and/or bindir aren't 'bin' and 'lib'. unset CFLAGS
local_maybe_enable=disable unset LDFLAGS
local_rust_root=/not/set/do/not/use unset CXXFLAGS
if which rustc >/dev/null 2>&1; then unset CPPFLAGS
local_rustc=$(which rustc)
if [ -n "$local_rustc" ]; then # FIXME: this path to rustc (via `which rustc`) may not be quite right in the case
local_rust_root=$(dirname $(dirname $local_rustc)) # where we're reinstalling the compiler. May want to try for a real
if [ -e "$local_rust_root/bin/rustc" ]; then # path based on bitbake vars
local_maybe_enable=enable # Also will be wrong when relative libdir and/or bindir aren't 'bin' and 'lib'.
fi local_maybe_enable=disable
local_rust_root=/not/set/do/not/use
if which rustc >/dev/null 2>&1; then
local_rustc=$(which rustc)
if [ -n "$local_rustc" ]; then
local_rust_root=$(dirname $(dirname $local_rustc))
if [ -e "$local_rust_root/bin/rustc" ]; then
local_maybe_enable=enable
fi fi
fi fi
fi
# - rpath is required otherwise rustc fails to resolve symbols # - rpath is required otherwise rustc fails to resolve symbols
# - submodule management is done by bitbake's fetching # - submodule management is done by bitbake's fetching
${S}/configure \ ${S}/configure \
"--enable-rpath" \ "--enable-rpath" \
"--disable-docs" \ "--disable-docs" \
"--disable-manage-submodules" \ "--disable-manage-submodules" \
"--disable-debug" \ "--disable-debug" \
"--enable-debuginfo" \ "--enable-debuginfo" \
"--enable-optimize" \ "--enable-optimize" \
"--enable-optimize-cxx" \ "--enable-optimize-cxx" \
"--disable-llvm-version-check" \ "--disable-llvm-version-check" \
"--llvm-root=${llvmdir}" \ "--llvm-root=${llvmdir}" \
"--enable-optimize-tests" \ "--enable-optimize-tests" \
"--prefix=${prefix}" \ "--prefix=${prefix}" \
"--target=${TARGET_SYS}" \ "--target=${TARGET_SYS}" \
"--host=${HOST_SYS}" \ "--host=${HOST_SYS}" \
"--build=${BUILD_SYS}" \ "--build=${BUILD_SYS}" \
"--localstatedir=${localstatedir}" \ "--localstatedir=${localstatedir}" \
"--sysconfdir=${sysconfdir}" \ "--sysconfdir=${sysconfdir}" \
"--datadir=${datadir}" \ "--datadir=${datadir}" \
"--infodir=${infodir}" \ "--infodir=${infodir}" \
"--mandir=${mandir}" \ "--mandir=${mandir}" \
"--libdir=${libdir}" \ "--libdir=${libdir}" \
"--bindir=${bindir}" \ "--bindir=${bindir}" \
${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '--$local_maybe_enable-local-rust --local-rust-root=$local_rust_root', '--local-rust-root=/not/a/dir', d)} \ "--platform-cfg=${WORKDIR}/mk-cfg/" \
${EXTRA_OECONF} ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '--$local_maybe_enable-local-rust --local-rust-root=$local_rust_root', '--local-rust-root=/not/a/dir', d)} \
${EXTRA_OECONF}
} }
rust_runmake () { rust_runmake () {
echo "COMPILE ${PN}" "$@" echo "COMPILE ${PN}" "$@"
env env
# CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a
# wide range of targets (not just TARGET). Yocto's settings for them will # wide range of targets (not just TARGET). Yocto's settings for them will
# be inappropriate, avoid using. # be inappropriate, avoid using.
unset CFLAGS unset CFLAGS
unset LDFLAGS unset LDFLAGS
unset CXXFLAGS unset CXXFLAGS
unset CPPFLAGS unset CPPFLAGS
oe_runmake "VERBOSE=1" "$@" oe_runmake "VERBOSE=1" "$@"
} }
do_compile () { do_compile () {
if ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', 'false', 'true', d)}; then if ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', 'false', 'true', d)}; then
mkdir -p dl mkdir -p dl
cp -f ${WORKDIR}/${RUST_SNAPSHOT} dl cp -f ${WORKDIR}/${RUST_SNAPSHOT} dl
fi fi
rust_runmake rust_runmake
} }
rust_do_install () { rust_do_install () {
rust_runmake DESTDIR="${D}" install rust_runmake DESTDIR="${D}" install
# Rust's install.sh doesn't mark executables as executable because # Rust's install.sh doesn't mark executables as executable because
# we're using a custom bindir, do it ourselves. # we're using a custom bindir, do it ourselves.
chmod +x "${D}/${bindir}/rustc" chmod +x "${D}/${bindir}/rustc"
chmod +x "${D}/${bindir}/rustdoc" chmod +x "${D}/${bindir}/rustdoc"
chmod +x "${D}/${bindir}/rust-gdb" chmod +x "${D}/${bindir}/rust-gdb"
# Install our custom target.json files # Install our custom target.json files
local td="${D}${libdir}/rustlib/" local td="${D}${libdir}/rustlib/"
install -d "$td" install -d "$td"
for tgt in "${WORKDIR}/targets/"* ; do for tgt in "${WORKDIR}/targets/"* ; do
install -m 0644 "$tgt" "$td" install -m 0644 "$tgt" "$td"
done done
## rust will complain about multiple providers of the runtime libs ## rust will complain about multiple providers of the runtime libs
## (libstd, libsync, etc.) without this. ## (libstd, libsync, etc.) without this.
(cd "${D}${libdir}" && ln -sf "rustlib/${HOST_SYS}/lib/lib"*.so .) (cd "${D}${libdir}" && ln -sf "rustlib/${HOST_SYS}/lib/lib"*.so .)
} }
do_install () { do_install () {
rust_do_install rust_do_install
} }
## {{{ native bits
# Otherwise we'll depend on what we provide
INHIBIT_DEFAULT_RUST_DEPS_class-native = "1"
# We don't need to depend on gcc-native because yocto assumes it exists
PROVIDES_class-native = "virtual/${TARGET_PREFIX}rust"
## }}}
## {{{ cross bits
# Otherwise we'll depend on what we provide
INHIBIT_DEFAULT_RUST_DEPS_class-cross = "1"
# Unlike native (which nicely maps it's DEPENDS) cross wipes them out completely.
# Generally, we (and cross in general) need the same things that native needs,
# so it might make sense to take it's mapping. For now, though, we just mention
# the bits we need explicitly.
DEPENDS_class-cross += "${@bb.utils.contains('PACKAGECONFIG', 'local-rust', 'rust-native', '', d)}"
DEPENDS_class-cross += "rust-llvm-native"
DEPENDS_class-cross += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc"
PROVIDES_class-cross = "virtual/${TARGET_PREFIX}rust"
PN_class-cross = "rust-cross-${TARGET_ARCH}"
# In the cross compilation case, rustc doesn't seem to get the rpath quite
# right. It manages to include '../../lib/${TARGET_PREFIX}', but doesn't
# include the '../../lib' (ie: relative path from cross_bindir to normal
# libdir. As a result, we end up not being able to properly reference files in normal ${libdir}.
# Most of the time this happens to work fine as the systems libraries are
# subsituted, but sometimes a host system will lack a library, or the right
# version of a library (libtinfo was how I noticed this).
#
# FIXME: this should really be fixed in rust itself.
# FIXME: using hard-coded relative paths is wrong, we should ask bitbake for
# the relative path between 2 of it's vars.
HOST_POST_LINK_ARGS_append_class-cross = " -Wl,-rpath=../../lib"
BUILD_POST_LINK_ARGS_append_class-cross = " -Wl,-rpath=../../lib"
# We need the same thing for the calls to the compiler when building the runtime crap
TARGET_CC_ARCH_append_class-cross = " --sysroot=${STAGING_DIR_TARGET}"
# cross.bbclass is "helpful" and overrides our do_install. Tell it not to.
do_install_class-cross () {
rust_do_install
}
# using host-strip on target .so files generated by this recipie causes build errors.
# for now, disable stripping.
# A better (but more complex) approach would be to mimic gcc-runtime and build
# the target.so files in a seperate .bb file.
INHIBIT_PACKAGE_STRIP_class-cross = "1"
INHIBIT_SYSROOT_STRIP_class-cross = "1"
## }}}
BBCLASSEXTEND = "cross native"
-20
View File
@@ -1,20 +0,0 @@
require rust-release.inc
require rust.inc
require rust-${PV}.inc
# "patch-prefix"
PP = "rust-${PV}"
SRC_URI_append = "\
file://${PP}/0001-platform.mk-avoid-choking-on-i586.patch \
file://${PP}/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \
file://${PP}/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \
file://${PP}/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \
file://${PP}/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \
file://${PP}/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \
file://${PP}/0007-mk-install-use-disable-rewrite-paths.patch \
file://${PP}/0008-install-disable-ldconfig.patch \
file://${PP}/0009-Remove-crate-metadata-from-symbol-hashing.patch \
file://${PP}/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch \
\
file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \
"
-29
View File
@@ -1,29 +0,0 @@
# 2015-06-26
SRCREV = "378a370ff2057afeb1eae86eb6e78c476866a4a6"
require rust-git.inc
RS_DATE = "2015-05-24"
RS_SRCHASH = "ba0e1cd"
# linux-x86_64
RS_HASH = "5fd8698fdfe953e6c4d86cf4fa1d5f3a0053248c"
RUST_SNAPSHOT = "rust-stage0-${RS_DATE}-${RS_SRCHASH}-linux-x86_64-${RS_HASH}.tar.bz2"
SRC_URI[rust-snapshot.md5sum] = "e0d49475a787aaa9481ec0b1a28d1f7a"
SRC_URI[rust-snapshot.sha256sum] = "e7858a90c2c6c35299ebe2cb6425f3f84d0ba171dcbce20ff68295a1ff75c7e5"
# "patch-prefix"
PP = "rust-git"
SRC_URI_append = "\
file://${PP}/0001-platform.mk-avoid-choking-on-i586.patch \
file://${PP}/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \
file://${PP}/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \
file://${PP}/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \
file://${PP}/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \
file://${PP}/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \
file://${PP}/0007-mk-install-use-disable-rewrite-paths.patch \
file://${PP}/0008-install-disable-ldconfig.patch \
\
file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \
"
DEFAULT_PREFERENCE = "-1"