Index: head/lang/rust/Makefile =================================================================== --- head/lang/rust/Makefile +++ head/lang/rust/Makefile @@ -7,8 +7,10 @@ CATEGORIES= lang MASTER_SITES= http://static.rust-lang.org/dist/:src \ LOCAL/dumbbell/rust:rust_bootstrap \ + LOCAL/tobik/rust:rust_bootstrap \ https://static.rust-lang.org/dist/:rust_bootstrap \ LOCAL/dumbbell/rust:cargo_bootstrap \ + LOCAL/tobik/rust:cargo_bootstrap \ https://static.rust-lang.org/dist/:cargo_bootstrap \ https://s3.amazonaws.com/rust-lang-ci/cargo-builds/:cargo_bootstrap \ LOCAL/marino:bootstrap @@ -34,21 +36,27 @@ libgit2.so:devel/libgit2 \ libssh2.so:security/libssh2 -ONLY_FOR_ARCHS?= aarch64 amd64 i386 +ONLY_FOR_ARCHS?= aarch64 amd64 armv6 armv7 i386 powerpc64 ONLY_FOR_ARCHS_REASON= requires prebuilt bootstrap compiler -BROKEN_aarch64= fails to build: bootstrap compiler crashes - CONFLICTS_INSTALL?= rust-nightly # See WRKSRC/src/stage0.txt for this date and version values. BOOTSTRAPS_DATE?= 2018-12-20 RUST_BOOTSTRAP_VERSION?= 1.31.1 +RUST_BOOTSTRAP_VERSION_aarch64?= 1.32.0 +RUST_BOOTSTRAP_VERSION_armv6?= 1.32.0 +RUST_BOOTSTRAP_VERSION_armv7?= 1.32.0 +RUST_BOOTSTRAP_VERSION_powerpc64?= 1.32.0 RUSTC_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rustc-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${RUST_TARGET}.tar.gz RUST_STD_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rust-std-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${RUST_TARGET}.tar.gz CARGO_BOOTSTRAP_VERSION?= 0.32.0 +CARGO_BOOTSTRAP_VERSION_aarch64?= 0.33.0 +CARGO_BOOTSTRAP_VERSION_armv6?= 0.33.0 +CARGO_BOOTSTRAP_VERSION_armv7?= 0.33.0 +CARGO_BOOTSTRAP_VERSION_powerpc64?= 0.33.0 CARGO_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/cargo-${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}}-${RUST_TARGET}.tar.gz CARGO_VENDOR_DIR?= ${WRKSRC}/vendor @@ -58,9 +66,13 @@ # Rust's target arch string is different from *BSD arch strings RUST_ARCH_aarch64= aarch64 RUST_ARCH_amd64= x86_64 +RUST_ARCH_armv6= armv6 +RUST_ARCH_armv7= armv7 RUST_ARCH_i386= i686 +RUST_ARCH_powerpc64= powerpc64 RUST_ARCH_x86_64= x86_64 # dragonfly RUST_TARGET= ${RUST_ARCH_${ARCH}}-unknown-${OPSYS:tl} +LLVM_TARGET= ${ARCH:C/armv.*/ARM/:S/aarch64/AArch64/:S/powerpc64/PowerPC/} PLIST_SUB+= RUST_TARGET=${RUST_TARGET} USES= compiler gmake libedit pkgconfig python:2.7,build ssl tar:xz @@ -83,6 +95,13 @@ .include +.if ${ARCH} == powerpc64 +# The bootstrap is hardcoded to use gcc8 +# but we can build with a newer or older compiler as provided by USE_GCC=yes +BUILD_DEPENDS+= gcc8:lang/gcc8 +USE_GCC= yes +.endif + X_PY_ENV= HOME="${WRKDIR}" \ LIBGIT2_SYS_USE_PKG_CONFIG=1 \ LIBSSH2_SYS_USE_PKG_CONFIG=1 \ @@ -149,8 +168,19 @@ -e 's,%CHANNEL%,${RUST_CHANNEL},' \ -e 's,%TARGET%,${RUST_TARGET},' \ -e 's,%CCACHE%,${CCACHE_VALUE},' \ + -e 's,%CC%,${CC},' \ + -e 's,%CXX%,${CXX},' \ < ${FILESDIR}/config.toml \ > ${WRKSRC}/config.toml +# no need to build a crosscompiler for these targets +.if ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 || ${ARCH} == powerpc64 + @${REINPLACE_CMD} -e 's,^#targets =.*,targets = "${LLVM_TARGET}",' \ + -e 's,^#experimental-targets =.*,experimental-targets = "",' \ + ${WRKSRC}/config.toml +.endif + @${REINPLACE_CMD} -e 's,%CC%,${CC},g' \ + ${WRKSRC}/src/librustc_llvm/build.rs \ + ${WRKSRC}/src/bootstrap/native.rs post-configure: @for file in \ @@ -264,6 +294,9 @@ BOOTSTRAPS_SOURCE_PKG_FBSDVER= 10 BOOTSTRAPS_SOURCE_PKG_FBSDVER_aarch64= 11 +BOOTSTRAPS_SOURCE_PKG_FBSDVER_armv6= 11 +BOOTSTRAPS_SOURCE_PKG_FBSDVER_armv7= 12 +BOOTSTRAPS_SOURCE_PKG_FBSDVER_powerpc64= 11 BOOTSTRAPS_SOURCE_PKG_REV= BOOTSTRAPS_SOURCE_PKG_URL= https://pkg.freebsd.org/FreeBSD:${BOOTSTRAPS_SOURCE_PKG_FBSDVER_${ARCH}:U${BOOTSTRAPS_SOURCE_PKG_FBSDVER}}:${ARCH}/latest/All/rust-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}${BOOTSTRAPS_SOURCE_PKG_REV}.txz BOOTSTRAPS_SOURCE_PKG= ${_DISTDIR}/${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rust-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${ARCH}.txz Index: head/lang/rust/distinfo =================================================================== --- head/lang/rust/distinfo +++ head/lang/rust/distinfo @@ -13,3 +13,15 @@ SIZE (rust/2018-12-20/rust-std-1.31.1-i686-unknown-freebsd.tar.gz) = 69465005 SHA256 (rust/2018-12-20/cargo-0.32.0-i686-unknown-freebsd.tar.gz) = 32db6c8124e5cfeffb58576bbdbe9a8ec1317a31588d393a2be822e87efc55ab SIZE (rust/2018-12-20/cargo-0.32.0-i686-unknown-freebsd.tar.gz) = 6510783 +SHA256 (rust/2018-12-20/cargo-0.33.0-aarch64-unknown-freebsd.tar.gz) = a13c3f8c17beb6d19f54ac705d87b6dbb9cd09cd945d0ffbaed1a77e8ac38128 +SHA256 (rust/2018-12-20/cargo-0.33.0-armv6-unknown-freebsd.tar.gz) = 62158d26a9dbc17cfd92882cb48b6ee7a06432b9f18d1f78b90b6973d63be12c +SHA256 (rust/2018-12-20/cargo-0.33.0-armv7-unknown-freebsd.tar.gz) = bfb8986a11034cac7329037a2f24c07bcd62ba2d91838f6c28955b2ee639e361 +SHA256 (rust/2018-12-20/cargo-0.33.0-powerpc64-unknown-freebsd.tar.gz) = 043a4d68de71b868837bc0e30121d4d95282b0d098a1e13da9375f00dd6e51ef +SHA256 (rust/2018-12-20/rust-std-1.32.0-aarch64-unknown-freebsd.tar.gz) = c5cb52dab10c19a0bc0548b65a785fdf5765cf43a4a5c6635e44738b9ae69030 +SHA256 (rust/2018-12-20/rust-std-1.32.0-armv6-unknown-freebsd.tar.gz) = 9572c6db3daaaf1fa5dd1b5ddf2a077e55ebf392ed0bc578dcc5a1ffa75e0343 +SHA256 (rust/2018-12-20/rust-std-1.32.0-armv7-unknown-freebsd.tar.gz) = 0ad6c70d4c0d843f61845db77f7d571befa07e4623029e6b3dd3ce9f9d568c6f +SHA256 (rust/2018-12-20/rust-std-1.32.0-powerpc64-unknown-freebsd.tar.gz) = d619921dfaccf70cde71b4a00f9dc03a8138d3379a6cb4d8729d74d931c2a38b +SHA256 (rust/2018-12-20/rustc-1.32.0-aarch64-unknown-freebsd.tar.gz) = 3d1ee268ceba35c899c976fa6d539b39f7ef6fc109190662bc5f5bfd5c843d92 +SHA256 (rust/2018-12-20/rustc-1.32.0-armv6-unknown-freebsd.tar.gz) = c2896bc52a2e005077252062e97a4bd3543b9003b78f95ecd83dda0242f0e6b5 +SHA256 (rust/2018-12-20/rustc-1.32.0-armv7-unknown-freebsd.tar.gz) = faf708f0909d4b7e5f8862add9819f5f55cb52b08558760cbdd456e7014df00c +SHA256 (rust/2018-12-20/rustc-1.32.0-powerpc64-unknown-freebsd.tar.gz) = 83ccfca0e5c5e2df37ea3f4059dfe3e516c4f74045769dac4602a2da2b2ed1a5 Index: head/lang/rust/files/patch-src_bootstrap_bootstrap.py =================================================================== --- head/lang/rust/files/patch-src_bootstrap_bootstrap.py +++ head/lang/rust/files/patch-src_bootstrap_bootstrap.py @@ -0,0 +1,24 @@ +--- src/bootstrap/bootstrap.py.orig 2019-01-16 09:30:27 UTC ++++ src/bootstrap/bootstrap.py +@@ -240,6 +240,10 @@ def default_build_triple(): + err = "unknown OS type: {}".format(ostype) + sys.exit(err) + ++ if cputype == 'powerpc' and ostype == 'unknown-freebsd': ++ cputype = subprocess.check_output( ++ ['uname', '-p']).strip().decode(default_encoding) ++ + cputype_mapper = { + 'BePC': 'i686', + 'aarch64': 'aarch64', +@@ -269,6 +273,10 @@ def default_build_triple(): + cputype = 'arm' + if ostype == 'linux-android': + ostype = 'linux-androideabi' ++ elif ostype == 'unknown-freebsd': ++ cputype = subprocess.check_output( ++ ['uname', '-p']).strip().decode(default_encoding) ++ ostype = 'unknown-freebsd' + elif cputype == 'armv6l': + cputype = 'arm' + if ostype == 'linux-android': Index: head/lang/rust/files/patch-src_bootstrap_native.rs =================================================================== --- head/lang/rust/files/patch-src_bootstrap_native.rs +++ head/lang/rust/files/patch-src_bootstrap_native.rs @@ -0,0 +1,13 @@ +--- src/bootstrap/native.rs.orig 2019-01-16 09:30:27 UTC ++++ src/bootstrap/native.rs +@@ -218,6 +218,10 @@ impl Step for Llvm { + } + } + ++ if target == "powerpc64-unknown-freebsd" { ++ cfg.define("CMAKE_EXE_LINKER_FLAGS", "-Wl,-rpath=/usr/local/lib/%CC% -L/usr/local/lib/%CC%"); ++ } ++ + // http://llvm.org/docs/HowToCrossCompileLLVM.html + if target != builder.config.build && !emscripten { + builder.ensure(Llvm { Index: head/lang/rust/files/patch-src_libbacktrace_fileline.c =================================================================== --- head/lang/rust/files/patch-src_libbacktrace_fileline.c +++ head/lang/rust/files/patch-src_libbacktrace_fileline.c @@ -1,10 +1,10 @@ This file is in the public domain. ---- src/libbacktrace/fileline.c.orig 2017-06-06 00:42:59 UTC +--- src/libbacktrace/fileline.c.orig 2019-01-16 09:30:44 UTC +++ src/libbacktrace/fileline.c -@@ -38,8 +38,39 @@ POSSIBILITY OF SUCH DAMAGE. */ - #include +@@ -39,8 +39,39 @@ POSSIBILITY OF SUCH DAMAGE. */ #include + #include +#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) +#include Index: head/lang/rust/files/patch-src_libcompiler__builtins_build.rs =================================================================== --- head/lang/rust/files/patch-src_libcompiler__builtins_build.rs +++ head/lang/rust/files/patch-src_libcompiler__builtins_build.rs @@ -0,0 +1,13 @@ +--- src/libcompiler_builtins/build.rs.orig 2019-01-16 09:30:44 UTC ++++ src/libcompiler_builtins/build.rs +@@ -308,6 +308,10 @@ mod c { + ], + ); + ++ if target_os == "freebsd" { ++ sources.extend(&["clear_cache.c"]); ++ } ++ + // First of all aeabi_cdcmp and aeabi_cfcmp are never called by LLVM. + // Second are little-endian only, so build fail on big-endian targets. + // Temporally workaround: exclude these files for big-endian targets. Index: head/lang/rust/files/patch-src_liblibc_src_unix_bsd_freebsdlike_freebsd_arm.rs =================================================================== --- head/lang/rust/files/patch-src_liblibc_src_unix_bsd_freebsdlike_freebsd_arm.rs +++ head/lang/rust/files/patch-src_liblibc_src_unix_bsd_freebsdlike_freebsd_arm.rs @@ -0,0 +1,40 @@ +--- src/liblibc/src/unix/bsd/freebsdlike/freebsd/arm.rs.orig 2019-02-15 13:41:07 UTC ++++ src/liblibc/src/unix/bsd/freebsdlike/freebsd/arm.rs +@@ -0,0 +1,37 @@ ++pub type c_char = u8; ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type time_t = i64; ++pub type suseconds_t = i32; ++ ++s! { ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_mode: ::mode_t, ++ pub st_nlink: ::nlink_t, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ pub st_rdev: ::dev_t, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ pub st_atime_pad: ::c_long, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ pub st_mtime_pad: ::c_long, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ pub st_ctime_pad: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: ::uint32_t, ++ pub st_lspare: ::int32_t, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_birthtime_pad: ::c_long, ++ } ++} ++ ++pub const MAP_32BIT: ::c_int = 0x00080000; Index: head/lang/rust/files/patch-src_liblibc_src_unix_bsd_freebsdlike_freebsd_mod.rs =================================================================== --- head/lang/rust/files/patch-src_liblibc_src_unix_bsd_freebsdlike_freebsd_mod.rs +++ head/lang/rust/files/patch-src_liblibc_src_unix_bsd_freebsdlike_freebsd_mod.rs @@ -0,0 +1,15 @@ +--- src/liblibc/src/unix/bsd/freebsdlike/freebsd/mod.rs.orig 2019-01-16 09:30:47 UTC ++++ src/liblibc/src/unix/bsd/freebsdlike/freebsd/mod.rs +@@ -1068,6 +1068,12 @@ cfg_if! { + } else if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; ++ } else if #[cfg(target_arch = "arm")] { ++ mod arm; ++ pub use self::arm::*; ++ } else if #[cfg(target_arch = "powerpc64")] { ++ mod powerpc64; ++ pub use self::powerpc64::*; + } else { + // Unknown target_arch + } Index: head/lang/rust/files/patch-src_liblibc_src_unix_bsd_freebsdlike_freebsd_powerpc64.rs =================================================================== --- head/lang/rust/files/patch-src_liblibc_src_unix_bsd_freebsdlike_freebsd_powerpc64.rs +++ head/lang/rust/files/patch-src_liblibc_src_unix_bsd_freebsdlike_freebsd_powerpc64.rs @@ -0,0 +1,34 @@ +--- src/liblibc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs.orig 2019-02-15 13:41:07 UTC ++++ src/liblibc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +@@ -0,0 +1,31 @@ ++pub type c_char = u8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type time_t = i64; ++pub type suseconds_t = i64; ++ ++s! { ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_mode: ::mode_t, ++ pub st_nlink: ::nlink_t, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ pub st_rdev: ::dev_t, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: ::uint32_t, ++ pub st_lspare: ::int32_t, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ } ++} Index: head/lang/rust/files/patch-src_liblibc_src_unix_bsd_freebsdlike_mod.rs =================================================================== --- head/lang/rust/files/patch-src_liblibc_src_unix_bsd_freebsdlike_mod.rs +++ head/lang/rust/files/patch-src_liblibc_src_unix_bsd_freebsdlike_mod.rs @@ -1,17 +1,16 @@ ---- src/liblibc/src/unix/bsd/freebsdlike/mod.rs.orig 2018-06-19 04:36:14 UTC +--- src/liblibc/src/unix/bsd/freebsdlike/mod.rs.orig 2019-01-16 09:30:47 UTC +++ src/liblibc/src/unix/bsd/freebsdlike/mod.rs @@ -1,4 +1,3 @@ -pub type c_char = i8; pub type dev_t = u32; pub type mode_t = u16; pub type pthread_attr_t = *mut ::c_void; -@@ -84,7 +83,10 @@ s! { +@@ -83,8 +82,7 @@ s! { + } pub struct stack_t { - // In FreeBSD 11 and later, ss_sp is actually a void* -+ #[cfg(not(target_arch = "aarch64"))] - pub ss_sp: *mut ::c_char, -+ #[cfg(target_arch = "aarch64")] +- // In FreeBSD 11 and later, ss_sp is actually a void* +- pub ss_sp: *mut ::c_char, + pub ss_sp: *mut ::c_void, pub ss_size: ::size_t, pub ss_flags: ::c_int, Index: head/lang/rust/files/patch-src_librustc__llvm_build.rs =================================================================== --- head/lang/rust/files/patch-src_librustc__llvm_build.rs +++ head/lang/rust/files/patch-src_librustc__llvm_build.rs @@ -0,0 +1,14 @@ +--- src/librustc_llvm/build.rs.orig 2019-01-16 09:30:27 UTC ++++ src/librustc_llvm/build.rs +@@ -256,7 +256,10 @@ fn main() { + }; + + // C++ runtime library +- if !target.contains("msvc") { ++ if target == "powerpc64-unknown-freebsd" { ++ println!("cargo:rustc-link-search=native=/usr/local/lib/%CC%"); ++ println!("cargo:rustc-link-lib=static=stdc++"); ++ } else if !target.contains("msvc") { + if let Some(s) = llvm_static_stdcpp { + assert!(!cxxflags.contains("stdlib=libc++")); + let path = PathBuf::from(s); Index: head/lang/rust/files/patch-src_librustc__target_spec_armv6__unknown__freebsd.rs =================================================================== --- head/lang/rust/files/patch-src_librustc__target_spec_armv6__unknown__freebsd.rs +++ head/lang/rust/files/patch-src_librustc__target_spec_armv6__unknown__freebsd.rs @@ -0,0 +1,27 @@ +--- src/librustc_target/spec/armv6_unknown_freebsd.rs.orig 2019-02-15 13:41:07 UTC ++++ src/librustc_target/spec/armv6_unknown_freebsd.rs +@@ -0,0 +1,24 @@ ++use spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; ++ ++pub fn target() -> TargetResult { ++ let base = super::freebsd_base::opts(); ++ Ok(Target { ++ llvm_target: "armv6-unknown-freebsd-gnueabihf".to_string(), ++ target_endian: "little".to_string(), ++ target_pointer_width: "32".to_string(), ++ target_c_int_width: "32".to_string(), ++ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), ++ arch: "arm".to_string(), ++ target_os: "freebsd".to_string(), ++ target_env: "gnueabihf".to_string(), ++ target_vendor: "unknown".to_string(), ++ linker_flavor: LinkerFlavor::Gcc, ++ ++ options: TargetOptions { ++ features: "+v6,+vfp2".to_string(), ++ max_atomic_width: Some(64), ++ abi_blacklist: super::arm_base::abi_blacklist(), ++ .. base ++ } ++ }) ++} Index: head/lang/rust/files/patch-src_librustc__target_spec_armv7__unknown__freebsd.rs =================================================================== --- head/lang/rust/files/patch-src_librustc__target_spec_armv7__unknown__freebsd.rs +++ head/lang/rust/files/patch-src_librustc__target_spec_armv7__unknown__freebsd.rs @@ -0,0 +1,27 @@ +--- src/librustc_target/spec/armv7_unknown_freebsd.rs.orig 2019-02-15 13:41:07 UTC ++++ src/librustc_target/spec/armv7_unknown_freebsd.rs +@@ -0,0 +1,24 @@ ++use spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; ++ ++pub fn target() -> TargetResult { ++ let base = super::freebsd_base::opts(); ++ Ok(Target { ++ llvm_target: "armv7-unknown-freebsd-gnueabihf".to_string(), ++ target_endian: "little".to_string(), ++ target_pointer_width: "32".to_string(), ++ target_c_int_width: "32".to_string(), ++ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), ++ arch: "arm".to_string(), ++ target_os: "freebsd".to_string(), ++ target_env: "gnueabihf".to_string(), ++ target_vendor: "unknown".to_string(), ++ linker_flavor: LinkerFlavor::Gcc, ++ ++ options: TargetOptions { ++ features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(), ++ max_atomic_width: Some(64), ++ abi_blacklist: super::arm_base::abi_blacklist(), ++ .. base ++ } ++ }) ++} Index: head/lang/rust/files/patch-src_librustc__target_spec_mod.rs =================================================================== --- head/lang/rust/files/patch-src_librustc__target_spec_mod.rs +++ head/lang/rust/files/patch-src_librustc__target_spec_mod.rs @@ -0,0 +1,13 @@ +--- src/librustc_target/spec/mod.rs.orig 2019-01-16 09:30:27 UTC ++++ src/librustc_target/spec/mod.rs +@@ -333,7 +333,10 @@ supported_targets! { + ("aarch64-linux-android", aarch64_linux_android), + + ("aarch64-unknown-freebsd", aarch64_unknown_freebsd), ++ ("armv6-unknown-freebsd", armv6_unknown_freebsd), ++ ("armv7-unknown-freebsd", armv7_unknown_freebsd), + ("i686-unknown-freebsd", i686_unknown_freebsd), ++ ("powerpc64-unknown-freebsd", powerpc64_unknown_freebsd), + ("x86_64-unknown-freebsd", x86_64_unknown_freebsd), + + ("i686-unknown-dragonfly", i686_unknown_dragonfly), Index: head/lang/rust/files/patch-src_librustc__target_spec_powerpc64__unknown__freebsd.rs =================================================================== --- head/lang/rust/files/patch-src_librustc__target_spec_powerpc64__unknown__freebsd.rs +++ head/lang/rust/files/patch-src_librustc__target_spec_powerpc64__unknown__freebsd.rs @@ -0,0 +1,25 @@ +--- src/librustc_target/spec/powerpc64_unknown_freebsd.rs.orig 2019-02-15 13:41:07 UTC ++++ src/librustc_target/spec/powerpc64_unknown_freebsd.rs +@@ -0,0 +1,22 @@ ++use spec::{LinkerFlavor, Target, TargetResult}; ++ ++pub fn target() -> TargetResult { ++ let mut base = super::freebsd_base::opts(); ++ base.cpu = "ppc64".to_string(); ++ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string()); ++ base.max_atomic_width = Some(64); ++ ++ Ok(Target { ++ llvm_target: "powerpc64-unknown-freebsd".to_string(), ++ target_endian: "big".to_string(), ++ target_pointer_width: "64".to_string(), ++ target_c_int_width: "32".to_string(), ++ data_layout: "E-m:e-i64:64-n32:64".to_string(), ++ arch: "powerpc64".to_string(), ++ target_os: "freebsd".to_string(), ++ target_env: String::new(), ++ target_vendor: "unknown".to_string(), ++ linker_flavor: LinkerFlavor::Gcc, ++ options: base, ++ }) ++} Index: head/lang/rust/files/patch-src_libstd_build.rs =================================================================== --- head/lang/rust/files/patch-src_libstd_build.rs +++ head/lang/rust/files/patch-src_libstd_build.rs @@ -1,6 +1,6 @@ ---- src/libstd/build.rs.orig 2018-09-03 18:29:12 UTC +--- src/libstd/build.rs.orig 2019-01-16 09:30:27 UTC +++ src/libstd/build.rs -@@ -94,13 +94,18 @@ fn build_libbacktrace(target: &str) -> Result<(), ()> +@@ -92,13 +92,18 @@ fn build_libbacktrace(target: &str) -> Result<(), ()> .out_dir(&native.out_dir) .warnings(false) .file("../libbacktrace/alloc.c") @@ -18,5 +18,5 @@ + build.file("../libbacktrace/backtrace.c"); + } - if target.contains("darwin") { - build.file("../libbacktrace/macho.c"); + let any_debug = env::var("RUSTC_DEBUGINFO").unwrap_or_default() == "true" || + env::var("RUSTC_DEBUGINFO_LINES").unwrap_or_default() == "true"; Index: head/lang/rust/files/patch-src_libstd_os_raw_mod.rs =================================================================== --- head/lang/rust/files/patch-src_libstd_os_raw_mod.rs +++ head/lang/rust/files/patch-src_libstd_os_raw_mod.rs @@ -1,18 +1,24 @@ ---- src/libstd/os/raw/mod.rs.orig 2018-10-24 20:00:01 UTC +--- src/libstd/os/raw/mod.rs.orig 2019-01-16 09:30:27 UTC +++ src/libstd/os/raw/mod.rs -@@ -27,6 +27,7 @@ +@@ -27,6 +27,10 @@ all(target_os = "android", any(target_arch = "aarch64", target_arch = "arm")), all(target_os = "l4re", target_arch = "x86_64"), -+ all(target_os = "freebsd", target_arch = "aarch64"), ++ all(target_os = "freebsd", any(target_arch = "aarch64", ++ target_arch = "arm", ++ target_arch = "powerpc", ++ target_arch = "powerpc64")), all(target_os = "netbsd", any(target_arch = "aarch64", target_arch = "arm", target_arch = "powerpc")), -@@ -42,6 +43,7 @@ +@@ -42,6 +46,10 @@ all(target_os = "android", any(target_arch = "aarch64", target_arch = "arm")), all(target_os = "l4re", target_arch = "x86_64"), -+ all(target_os = "freebsd", target_arch = "aarch64"), ++ all(target_os = "freebsd", any(target_arch = "aarch64", ++ target_arch = "arm", ++ target_arch = "powerpc", ++ target_arch = "powerpc64")), all(target_os = "netbsd", any(target_arch = "aarch64", target_arch = "arm", target_arch = "powerpc")), Index: head/lang/rust/files/patch-src_libstd_sys_unix_stack__overflow.rs =================================================================== --- head/lang/rust/files/patch-src_libstd_sys_unix_stack__overflow.rs +++ head/lang/rust/files/patch-src_libstd_sys_unix_stack__overflow.rs @@ -1,31 +1,20 @@ ---- src/libstd/sys/unix/stack_overflow.rs.orig 2018-06-19 04:35:53 UTC +--- src/libstd/sys/unix/stack_overflow.rs.orig 2019-01-16 09:30:27 UTC +++ src/libstd/sys/unix/stack_overflow.rs -@@ -148,18 +148,20 @@ mod imp { - stackp - } - -- #[cfg(any(target_os = "linux", -- target_os = "macos", -- target_os = "bitrig", -- target_os = "netbsd", -- target_os = "openbsd", -- target_os = "solaris"))] -+ #[cfg(any(any(target_os = "linux", -+ target_os = "macos", -+ target_os = "bitrig", -+ target_os = "netbsd", -+ target_os = "openbsd", -+ target_os = "solaris"), -+ all(target_os = "freebsd", target_arch = "aarch64")))] - unsafe fn get_stack() -> libc::stack_t { +@@ -151,6 +151,7 @@ mod imp { + #[cfg(any(target_os = "linux", + target_os = "macos", + target_os = "bitrig", ++ target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] +@@ -158,8 +159,7 @@ mod imp { libc::stack_t { ss_sp: get_stackp(), ss_flags: 0, ss_size: SIGSTKSZ } } - #[cfg(any(target_os = "freebsd", - target_os = "dragonfly"))] -+ #[cfg(all(any(target_os = "freebsd", -+ target_os = "dragonfly"), -+ not(target_arch = "aarch64")))] ++ #[cfg(target_os = "dragonfly")] unsafe fn get_stack() -> libc::stack_t { libc::stack_t { ss_sp: get_stackp() as *mut i8, ss_flags: 0, ss_size: SIGSTKSZ } } Index: head/lang/rust/files/patch-src_llvm_utils_llvm-build_llvmbuild_main.py =================================================================== --- head/lang/rust/files/patch-src_llvm_utils_llvm-build_llvmbuild_main.py +++ head/lang/rust/files/patch-src_llvm_utils_llvm-build_llvmbuild_main.py @@ -1,6 +1,6 @@ ---- src/llvm/utils/llvm-build/llvmbuild/main.py.orig 2018-04-04 08:39:57 UTC +--- src/llvm/utils/llvm-build/llvmbuild/main.py.orig 2018-12-13 15:33:50 UTC +++ src/llvm/utils/llvm-build/llvmbuild/main.py -@@ -752,6 +752,8 @@ def add_magic_target_components(parser, project, opts) +@@ -659,6 +659,8 @@ def add_magic_target_components(parser, project, opts) # We handle a few special cases of target names here for historical # reasons, as these are the names configure currently comes up with. native_target_name = { 'x86' : 'X86', Index: head/lang/rust/files/patch-vendor_backtrace_src_backtrace_libunwind.rs =================================================================== --- head/lang/rust/files/patch-vendor_backtrace_src_backtrace_libunwind.rs +++ head/lang/rust/files/patch-vendor_backtrace_src_backtrace_libunwind.rs @@ -0,0 +1,41 @@ +--- vendor/backtrace/src/backtrace/libunwind.rs.orig 2019-01-16 11:06:07 UTC ++++ vendor/backtrace/src/backtrace/libunwind.rs +@@ -115,12 +115,14 @@ mod uw { + + // available since GCC 4.2.0, should be fine for our purpose + #[cfg(all(not(all(target_os = "android", target_arch = "arm")), ++ not(all(target_os = "freebsd", target_arch = "arm")), + not(all(target_os = "linux", target_arch = "arm"))))] + pub fn _Unwind_GetIPInfo(ctx: *mut _Unwind_Context, + ip_before_insn: *mut c_int) + -> libc::uintptr_t; + + #[cfg(all(not(target_os = "android"), ++ not(all(target_os = "freebsd", target_arch = "arm")), + not(all(target_os = "linux", target_arch = "arm"))))] + pub fn _Unwind_FindEnclosingFunction(pc: *mut c_void) + -> *mut c_void; +@@ -130,6 +132,7 @@ mod uw { + // expansion of the macro. This is all copy/pasted directly from the + // header file with the definition of _Unwind_GetIP. + #[cfg(any(all(target_os = "android", target_arch = "arm"), ++ all(target_os = "freebsd", target_arch = "arm"), + all(target_os = "linux", target_arch = "arm")))] + pub unsafe fn _Unwind_GetIP(ctx: *mut _Unwind_Context) -> libc::uintptr_t { + #[repr(C)] +@@ -177,6 +180,7 @@ mod uw { + // This function doesn't exist on Android or ARM/Linux, so make it same + // to _Unwind_GetIP + #[cfg(any(all(target_os = "android", target_arch = "arm"), ++ all(target_os = "freebsd", target_arch = "arm"), + all(target_os = "linux", target_arch = "arm")))] + pub unsafe fn _Unwind_GetIPInfo(ctx: *mut _Unwind_Context, + ip_before_insn: *mut c_int) +@@ -189,6 +193,7 @@ mod uw { + // This function also doesn't exist on Android or ARM/Linux, so make it + // a no-op + #[cfg(any(target_os = "android", ++ all(target_os = "freebsd", target_arch = "arm"), + all(target_os = "linux", target_arch = "arm")))] + pub unsafe fn _Unwind_FindEnclosingFunction(pc: *mut c_void) + -> *mut c_void Index: head/lang/rust/files/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_arm.rs =================================================================== --- head/lang/rust/files/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_arm.rs +++ head/lang/rust/files/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_arm.rs @@ -0,0 +1,40 @@ +--- vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs.orig 2019-02-15 13:41:07 UTC ++++ vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs +@@ -0,0 +1,37 @@ ++pub type c_char = u8; ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type time_t = i64; ++pub type suseconds_t = i32; ++ ++s! { ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_mode: ::mode_t, ++ pub st_nlink: ::nlink_t, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ pub st_rdev: ::dev_t, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ pub st_atime_pad: ::c_long, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ pub st_mtime_pad: ::c_long, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ pub st_ctime_pad: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: ::uint32_t, ++ pub st_lspare: ::int32_t, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_birthtime_pad: ::c_long, ++ } ++} ++ ++pub const MAP_32BIT: ::c_int = 0x00080000; Index: head/lang/rust/files/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_mod.rs =================================================================== --- head/lang/rust/files/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_mod.rs +++ head/lang/rust/files/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_mod.rs @@ -0,0 +1,15 @@ +--- vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs.orig 2019-01-16 11:06:08 UTC ++++ vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs +@@ -1154,6 +1154,12 @@ cfg_if! { + } else if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; ++ } else if #[cfg(target_arch = "arm")] { ++ mod arm; ++ pub use self::arm::*; ++ } else if #[cfg(target_arch = "powerpc64")] { ++ mod powerpc64; ++ pub use self::powerpc64::*; + } else { + // Unknown target_arch + } Index: head/lang/rust/files/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_powerpc64.rs =================================================================== --- head/lang/rust/files/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_powerpc64.rs +++ head/lang/rust/files/patch-vendor_libc_src_unix_bsd_freebsdlike_freebsd_powerpc64.rs @@ -0,0 +1,34 @@ +--- vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs.orig 2019-02-15 13:41:07 UTC ++++ vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +@@ -0,0 +1,31 @@ ++pub type c_char = u8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type time_t = i64; ++pub type suseconds_t = i64; ++ ++s! { ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_mode: ::mode_t, ++ pub st_nlink: ::nlink_t, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ pub st_rdev: ::dev_t, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: ::uint32_t, ++ pub st_lspare: ::int32_t, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ } ++} Index: head/lang/rust/files/patch-vendor_libc_src_unix_bsd_freebsdlike_mod.rs =================================================================== --- head/lang/rust/files/patch-vendor_libc_src_unix_bsd_freebsdlike_mod.rs +++ head/lang/rust/files/patch-vendor_libc_src_unix_bsd_freebsdlike_mod.rs @@ -1,17 +1,16 @@ ---- vendor/libc/src/unix/bsd/freebsdlike/mod.rs.orig 2018-06-19 05:52:22 UTC +--- vendor/libc/src/unix/bsd/freebsdlike/mod.rs.orig 2019-01-16 11:06:08 UTC +++ vendor/libc/src/unix/bsd/freebsdlike/mod.rs @@ -1,4 +1,3 @@ -pub type c_char = i8; pub type dev_t = u32; pub type mode_t = u16; pub type pthread_attr_t = *mut ::c_void; -@@ -84,7 +83,10 @@ s! { +@@ -83,8 +82,7 @@ s! { + } pub struct stack_t { - // In FreeBSD 11 and later, ss_sp is actually a void* -+ #[cfg(not(target_arch = "aarch64"))] - pub ss_sp: *mut ::c_char, -+ #[cfg(target_arch = "aarch64")] +- // In FreeBSD 11 and later, ss_sp is actually a void* +- pub ss_sp: *mut ::c_char, + pub ss_sp: *mut ::c_void, pub ss_size: ::size_t, pub ss_flags: ::c_int, Index: head/lang/rust/files/patch-vendor_rustc-ap-rustc__target_spec_armv6__unknown__freebsd.rs =================================================================== --- head/lang/rust/files/patch-vendor_rustc-ap-rustc__target_spec_armv6__unknown__freebsd.rs +++ head/lang/rust/files/patch-vendor_rustc-ap-rustc__target_spec_armv6__unknown__freebsd.rs @@ -0,0 +1,27 @@ +--- vendor/rustc-ap-rustc_target/spec/armv6_unknown_freebsd.rs.orig 2019-02-15 13:41:07 UTC ++++ vendor/rustc-ap-rustc_target/spec/armv6_unknown_freebsd.rs +@@ -0,0 +1,24 @@ ++use spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; ++ ++pub fn target() -> TargetResult { ++ let base = super::freebsd_base::opts(); ++ Ok(Target { ++ llvm_target: "armv6-unknown-freebsd-gnueabihf".to_string(), ++ target_endian: "little".to_string(), ++ target_pointer_width: "32".to_string(), ++ target_c_int_width: "32".to_string(), ++ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), ++ arch: "arm".to_string(), ++ target_os: "freebsd".to_string(), ++ target_env: "gnueabihf".to_string(), ++ target_vendor: "unknown".to_string(), ++ linker_flavor: LinkerFlavor::Gcc, ++ ++ options: TargetOptions { ++ features: "+v6,+vfp2".to_string(), ++ max_atomic_width: Some(64), ++ abi_blacklist: super::arm_base::abi_blacklist(), ++ .. base ++ } ++ }) ++} Index: head/lang/rust/files/patch-vendor_rustc-ap-rustc__target_spec_armv7__unknown__freebsd.rs =================================================================== --- head/lang/rust/files/patch-vendor_rustc-ap-rustc__target_spec_armv7__unknown__freebsd.rs +++ head/lang/rust/files/patch-vendor_rustc-ap-rustc__target_spec_armv7__unknown__freebsd.rs @@ -0,0 +1,27 @@ +--- vendor/rustc-ap-rustc_target/spec/armv7_unknown_freebsd.rs.orig 2019-02-15 13:41:07 UTC ++++ vendor/rustc-ap-rustc_target/spec/armv7_unknown_freebsd.rs +@@ -0,0 +1,24 @@ ++use spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; ++ ++pub fn target() -> TargetResult { ++ let base = super::freebsd_base::opts(); ++ Ok(Target { ++ llvm_target: "armv7-unknown-freebsd-gnueabihf".to_string(), ++ target_endian: "little".to_string(), ++ target_pointer_width: "32".to_string(), ++ target_c_int_width: "32".to_string(), ++ data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), ++ arch: "arm".to_string(), ++ target_os: "freebsd".to_string(), ++ target_env: "gnueabihf".to_string(), ++ target_vendor: "unknown".to_string(), ++ linker_flavor: LinkerFlavor::Gcc, ++ ++ options: TargetOptions { ++ features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(), ++ max_atomic_width: Some(64), ++ abi_blacklist: super::arm_base::abi_blacklist(), ++ .. base ++ } ++ }) ++} Index: head/lang/rust/files/patch-vendor_rustc-ap-rustc__target_spec_mod.rs =================================================================== --- head/lang/rust/files/patch-vendor_rustc-ap-rustc__target_spec_mod.rs +++ head/lang/rust/files/patch-vendor_rustc-ap-rustc__target_spec_mod.rs @@ -0,0 +1,13 @@ +--- vendor/rustc-ap-rustc_target/spec/mod.rs.orig 2019-01-16 11:06:09 UTC ++++ vendor/rustc-ap-rustc_target/spec/mod.rs +@@ -331,7 +331,10 @@ supported_targets! { + ("aarch64-linux-android", aarch64_linux_android), + + ("aarch64-unknown-freebsd", aarch64_unknown_freebsd), ++ ("armv6-unknown-freebsd", armv6_unknown_freebsd), ++ ("armv7-unknown-freebsd", armv7_unknown_freebsd), + ("i686-unknown-freebsd", i686_unknown_freebsd), ++ ("powerpc64-unknown-freebsd", powerpc64_unknown_freebsd), + ("x86_64-unknown-freebsd", x86_64_unknown_freebsd), + + ("i686-unknown-dragonfly", i686_unknown_dragonfly), Index: head/lang/rust/files/patch-vendor_rustc-ap-rustc__target_spec_powerpc64__unknown__freebsd.rs =================================================================== --- head/lang/rust/files/patch-vendor_rustc-ap-rustc__target_spec_powerpc64__unknown__freebsd.rs +++ head/lang/rust/files/patch-vendor_rustc-ap-rustc__target_spec_powerpc64__unknown__freebsd.rs @@ -0,0 +1,25 @@ +--- vendor/rustc-ap-rustc_target/spec/powerpc64_unknown_freebsd.rs.orig 2019-02-15 13:41:07 UTC ++++ vendor/rustc-ap-rustc_target/spec/powerpc64_unknown_freebsd.rs +@@ -0,0 +1,22 @@ ++use spec::{LinkerFlavor, Target, TargetResult}; ++ ++pub fn target() -> TargetResult { ++ let mut base = super::freebsd_base::opts(); ++ base.cpu = "ppc64".to_string(); ++ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string()); ++ base.max_atomic_width = Some(64); ++ ++ Ok(Target { ++ llvm_target: "powerpc64-unknown-freebsd".to_string(), ++ target_endian: "big".to_string(), ++ target_pointer_width: "64".to_string(), ++ target_c_int_width: "32".to_string(), ++ data_layout: "E-m:e-i64:64-n32:64".to_string(), ++ arch: "powerpc64".to_string(), ++ target_os: "freebsd".to_string(), ++ target_env: String::new(), ++ target_vendor: "unknown".to_string(), ++ linker_flavor: LinkerFlavor::Gcc, ++ options: base, ++ }) ++}