Index: lang/rust/Makefile =================================================================== --- lang/rust/Makefile +++ lang/rust/Makefile @@ -34,7 +34,7 @@ libgit2.so:devel/libgit2 \ libssh2.so:security/libssh2 -ONLY_FOR_ARCHS?= aarch64 amd64 i386 +ONLY_FOR_ARCHS?= aarch64 amd64 i386 powerpc64 ONLY_FOR_ARCHS_REASON= requires prebuilt bootstrap compiler BROKEN_aarch64= fails to build: bootstrap compiler crashes @@ -50,10 +50,12 @@ BOOTSTRAPS_DATE?= 2018-10-12 RUST_BOOTSTRAP_VERSION?= 1.29.2 +RUST_BOOTSTRAP_VERSION_powerpc64?= 1.30.1 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.30.0 +CARGO_BOOTSTRAP_VERSION_powerpc64?= 0.31.0 CARGO_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/cargo-${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}}-${RUST_TARGET}.tar.gz RUST_CHANNEL= ${PKGNAMESUFFIX:Ustable:S/^-//} @@ -62,8 +64,10 @@ RUST_ARCH_aarch64= aarch64 RUST_ARCH_amd64= x86_64 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:S/aarch64/AArch64/:S/powerpc64/PowerPC/} PLIST_SUB+= RUST_TARGET=${RUST_TARGET} USES= compiler gmake libedit pkgconfig python:2.7,build ssl tar:xz @@ -97,6 +101,10 @@ .include +.if ${ARCH} == powerpc64 +USE_GCC= 7 +.endif + X_PY_ENV= HOME="${WRKDIR}" \ LIBGIT2_SYS_USE_PKG_CONFIG=1 \ LIBSSH2_SYS_USE_PKG_CONFIG=1 \ @@ -158,35 +166,8 @@ @${REINPLACE_CMD} -e \ 's|^cargo:.*|cargo: ${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}}|' \ ${WRKSRC}/src/stage0.txt -# After patching crates, we need to update their corresponding -# `.cargo-checksum.json` to reflect the new checksums verified by Cargo. - @for dir in "${WRKSRC}/src/vendor/libc" \ - "${WRKSRC}/src/vendor/libgit2-sys" \ - "${WRKSRC}/src/vendor/openssl"; do \ - if ! test -d "$$dir"; then \ - continue; \ - fi; \ - cd "$$dir"; \ - for file in $$(${FIND} * -name "*.orig"); do \ - old_checksum=$$(${SHA256} -q "$$file"); \ - new_checksum=$$(${SHA256} -q "$${file%%.orig}"); \ - regex="$$regex -e s|\"$${file%%.orig}\":\"$$old_checksum\"|\"$${file%%.orig}\":\"$$new_checksum\"|"; \ - done; \ - if test "$$regex"; then \ - ${REINPLACE_CMD} -E $$regex .cargo-checksum.json; \ - fi; \ - done -# We make a backup of a few files before the FreeBSD 10 autotools -# fix is applied. We'll need them in `do-configure` to update the -# `.cargo-checksum.json` files. - @for crate in ${CRATES_PATCHED_BY_FBSD10_FIX}; do \ - if ! test -d "${WRKSRC}/$$crate"; then \ - continue; \ - fi; \ - for file in $$(${FIND} "${WRKSRC}/$$crate" -name "config.rpath"); do \ - ${CP} "$$file" "$$file.orig"; \ - done; \ - done +# No need to check the cargo-checksum file, we've already checked the distinfo + @${REINPLACE_CMD} 's/"files":{[^}]*}/"files":{}/' ${WRKSRC}/src/vendor/*/.cargo-checksum.json .if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE) CCACHE_VALUE= "${CCACHE_WRAPPER_PATH:C,/libexec/ccache$,,}/bin/ccache" @@ -210,26 +191,21 @@ -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 -# The FreeBSD 10 autotools fix may modify some files just before -# `do-configure`. Like after `extra-path-ino64`, we need to update -# `.cargo-checksum.json`. - @for crate in ${CRATES_PATCHED_BY_FBSD10_FIX}; do \ - if ! test -d "${WRKSRC}/$$crate"; then \ - continue; \ - fi; \ - cd "${WRKSRC}/$$crate"; \ - for file in $$(${FIND} * -name "*.orig"); do \ - old_checksum=$$(${SHA256} -q "$$file"); \ - new_checksum=$$(${SHA256} -q "$${file%%.orig}"); \ - regex="$$regex -e s|\"$${file%%.orig}\":\"$$old_checksum\"|\"$${file%%.orig}\":\"$$new_checksum\"|"; \ - done; \ - if test "$$regex"; then \ - ${REINPLACE_CMD} -E $$regex .cargo-checksum.json; \ - fi; \ - done +# no need to build a crosscompiler for these targets +.if ${ARCH} == aarch64 || ${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 \ ${WRKSRC}/src/vendor/backtrace-sys/src/libbacktrace/configure \ @@ -367,6 +343,7 @@ BOOTSTRAPS_SOURCE_PKG_FBSDVER= 10 BOOTSTRAPS_SOURCE_PKG_FBSDVER_aarch64= 11 +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: lang/rust/distinfo =================================================================== --- lang/rust/distinfo +++ lang/rust/distinfo @@ -13,3 +13,9 @@ SIZE (rust/2018-10-12/rust-std-1.29.2-i686-unknown-freebsd.tar.gz) = 64847326 SHA256 (rust/2018-10-12/cargo-0.30.0-i686-unknown-freebsd.tar.gz) = e62e26635f1ee70bcbe5d6bef69dea938668ba6933fa96f32df84d2f47d131c3 SIZE (rust/2018-10-12/cargo-0.30.0-i686-unknown-freebsd.tar.gz) = 7198097 +SHA256 (rust/2018-10-12/rustc-1.30.1-powerpc64-unknown-freebsd.tar.gz) = 97a41998e5efe7a46c6099472eb4fd380765960f9904fcff82262aba297cedda +SIZE (rust/2018-10-12/rustc-1.30.1-powerpc64-unknown-freebsd.tar.gz) = rustc-1.30.1-powerpc64-unknown-freebsd.tar.gz +SHA256 (rust/2018-10-12/rust-std-1.30.1-powerpc64-unknown-freebsd.tar.gz) = 2ea0c55ed586668dd1bc60a2719a917547f6ec8a712e6e48a956f059d4cba1b9 +SIZE (rust/2018-10-12/rust-std-1.30.1-powerpc64-unknown-freebsd.tar.gz) = rust-std-1.30.1-powerpc64-unknown-freebsd.tar.gz +SHA256 (rust/2018-10-12/cargo-0.31.0-powerpc64-unknown-freebsd.tar.gz) = 8ff1ff75cef3ac36430b0838725bd61d292d228cde4ee32cf0445633d688858a +SIZE (rust/2018-10-12/cargo-0.31.0-powerpc64-unknown-freebsd.tar.gz) = cargo-0.31.0-powerpc64-unknown-freebsd.tar.gz Index: lang/rust/files/config.toml =================================================================== --- lang/rust/files/config.toml +++ lang/rust/files/config.toml @@ -24,10 +24,17 @@ # Rust release channel. channel = "%CHANNEL%" +default-linker = "%CC%" + [llvm] ccache = %CCACHE% +#targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX;Hexagon" +#experimental-targets = "WebAssembly;RISCV" [target.%TARGET%] +cc = "%CC%" +cxx = "%CXX%" +linker = "%CC%" [dist] Index: lang/rust/files/patch-src_vendor_openssl-sys_.cargo-checksum.json =================================================================== --- lang/rust/files/patch-src_vendor_openssl-sys_.cargo-checksum.json +++ lang/rust/files/patch-src_vendor_openssl-sys_.cargo-checksum.json @@ -1,6 +0,0 @@ ---- src/vendor/openssl-sys/.cargo-checksum.json.orig 2018-09-11 04:49:55 UTC -+++ src/vendor/openssl-sys/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"15b9e9f5255d11898d5f373ba8ac750d567155b1c81fa903f02e97b18cea5f18","Cargo.toml.orig":"3ec9308dd6326a80e0e30c076dd778f42cb1f1f616e666e924a210554681dd97","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"15b264aba47e69aa522c8cb37b320a156f0c3a3a72393338818046eac8ef4c3a","build/cfgs.rs":"b853b4100ed5421e4f4d436c3bb067f33c2a0349ff64ee121390bf23e1b769d5","build/main.rs":"bbb6b8a9b43fa47dc985c84ab6a5e64d7b77ae60c54b3038b68a4cef1a6759ab","src/lib.rs":"008a98eb5da8cb154b8f59904a9524a0a9cb22818ec734696c52d7ece384ab97","src/libressl/mod.rs":"412020ed9f0cbbb500f3f4d7157d8b2fc4a86eab6f6ba3293ca6ffd7bd0ac4f6","src/libressl/v250.rs":"8e64255d67e9e684b6d76184f96cfb8dca34c7f241fdbc08a982a221644257ea","src/libressl/v251.rs":"e823b2b5b103a9a2b3c307893f6fc8ca4213104fe3829b32fa3ce879bbc1ada9","src/libressl/v273.rs":"01492f8c44438a82466eac1b827dbed3213f21f0b5f6425259a0131e9e036aeb","src/openssl/mod.rs":"b63d420700cb96626e7795a10000e178477af90db6d6830c70a66f6d2b4e64d2","src/openssl/v10x.rs":"6b53ce40257a5ff8326ec5f0d6a83807c728c243ad5bde34b9782cdf8f157a21","src/openssl/v110.rs":"0e670f6af0bfbdb635012a3667b599a2b7c468e55ef29b289ab288e01c795e02","src/openssl/v111.rs":"26e5ef4c4faa628d8cec33cf77fc3736f9d01334227429114e91920439b65876"},"package":"912f301a749394e1025d9dcddef6106ddee9252620e6d0a0e5f8d0681de9b129"} -\ No newline at end of file -+{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"15b9e9f5255d11898d5f373ba8ac750d567155b1c81fa903f02e97b18cea5f18","Cargo.toml.orig":"3ec9308dd6326a80e0e30c076dd778f42cb1f1f616e666e924a210554681dd97","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"15b264aba47e69aa522c8cb37b320a156f0c3a3a72393338818046eac8ef4c3a","build/cfgs.rs":"499f32ddaa16e3771dca2b70f1d4f66f91491456ffb3e1954901abd57bc64e10","build/main.rs":"2383c602ce6ab23e9980e0d1dcf808ae5fb953c3b6ec7d7ea406293ddde679fd","src/lib.rs":"d3cd894a42d59f3e3d19ef1a376f2287971b68227c3ce142b307c5c05e1b2840"},"package":"912f301a749394e1025d9dcddef6106ddee9252620e6d0a0e5f8d0681de9b129"} Index: lang/rust/files/patch-src_vendor_xattr_src_sys_bsd.rs =================================================================== --- lang/rust/files/patch-src_vendor_xattr_src_sys_bsd.rs +++ lang/rust/files/patch-src_vendor_xattr_src_sys_bsd.rs @@ -0,0 +1,81 @@ +--- src/vendor/xattr/src/sys/bsd.rs 2018-09-20 20:58:00.000000000 +0200 ++++ src/vendor/xattr/src/sys/bsd.rs 2018-10-08 09:44:51.084304000 +0200 +@@ -192,7 +192,7 @@ pub fn get_fd(fd: RawFd, name: &OsStr) -> io::Result io::Result<()> { + let (ns, name) = name_to_ns(name)?; +- let ret = unsafe { extattr_delete_fd(fd, ns, name.as_ptr()) }; ++ let ret = unsafe { extattr_delete_fd(fd, ns, name.as_ptr() as *const c_char) }; + if ret != 0 { + Err(io::Error::last_os_error()) + } else { +@@ -278,9 +278,9 @@ pub fn get_path(path: &Path, name: &OsStr) -> io::Resu + unsafe { + allocate_loop(|buf, len| { + extattr_get_link( +- path.as_ptr(), ++ path.as_ptr() as *const c_char, + ns, +- name.as_ptr(), ++ name.as_ptr() as *const c_char, + buf as *mut c_void, + len as size_t, + ) +@@ -293,9 +293,9 @@ pub fn set_path(path: &Path, name: &OsStr, value: &[u8 + let path = path_to_c(path)?; + let ret = unsafe { + extattr_set_link( +- path.as_ptr(), ++ path.as_ptr() as *const c_char, + ns, +- name.as_ptr(), ++ name.as_ptr() as *const c_char, + value.as_ptr() as *const c_void, + value.len() as size_t, + ) +@@ -310,7 +310,7 @@ pub fn set_path(path: &Path, name: &OsStr, value: &[u8 + pub fn remove_path(path: &Path, name: &OsStr) -> io::Result<()> { + let (ns, name) = name_to_ns(name)?; + let path = path_to_c(path)?; +- let ret = unsafe { extattr_delete_link(path.as_ptr(), ns, name.as_ptr()) }; ++ let ret = unsafe { extattr_delete_link(path.as_ptr() as *const c_char, ns, name.as_ptr() as *const c_char) }; + if ret != 0 { + Err(io::Error::last_os_error()) + } else { +@@ -323,7 +323,7 @@ pub fn list_path(path: &Path) -> io::Result { + let sysvec = unsafe { + let res = allocate_loop(|buf, len| { + extattr_list_link( +- path.as_ptr(), ++ path.as_ptr() as *const c_char, + EXTATTR_NAMESPACE_SYSTEM, + buf as *mut c_void, + len as size_t, +@@ -347,7 +347,7 @@ pub fn list_path(path: &Path) -> io::Result { + let uservec = unsafe { + let res = allocate_loop(|buf, len| { + extattr_list_link( +- path.as_ptr(), ++ path.as_ptr() as *const c_char, + EXTATTR_NAMESPACE_USER, + buf as *mut c_void, + len as size_t, + Index: lang/rust/files/patch-zz-powerpc64 =================================================================== --- lang/rust/files/patch-zz-powerpc64 +++ lang/rust/files/patch-zz-powerpc64 @@ -0,0 +1,292 @@ +--- src/vendor/rustc-ap-rustc_target/spec/powerpc64_unknown_freebsd.rs.orig 2018-11-19 14:17:53.621623000 +0100 ++++ src/vendor/rustc-ap-rustc_target/spec/powerpc64_unknown_freebsd.rs 2018-11-19 13:00:26.616060000 +0100 +@@ -0,0 +1,32 @@ ++// Copyright 2018 The Rust Project Developers. See the COPYRIGHT ++// file at the top-level directory of this distribution and at ++// http://rust-lang.org/COPYRIGHT. ++// ++// Licensed under the Apache License, Version 2.0 or the MIT license ++// , at your ++// option. This file may not be copied, modified, or distributed ++// except according to those terms. ++ ++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, ++ }) ++} +--- src/librustc_target/spec/powerpc64_unknown_freebsd.rs.orig 2018-11-19 14:19:21.284903000 +0100 ++++ src/librustc_target/spec/powerpc64_unknown_freebsd.rs 2018-11-19 13:00:21.384070000 +0100 +@@ -0,0 +1,32 @@ ++// Copyright 2018 The Rust Project Developers. See the COPYRIGHT ++// file at the top-level directory of this distribution and at ++// http://rust-lang.org/COPYRIGHT. ++// ++// Licensed under the Apache License, Version 2.0 or the MIT license ++// , at your ++// option. This file may not be copied, modified, or distributed ++// except according to those terms. ++ ++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, ++ }) ++} +--- src/librustc_target/spec/mod.rs.orig 2018-11-19 14:18:59.960896000 +0100 ++++ src/librustc_target/spec/mod.rs 2018-11-19 14:16:39.783975000 +0100 +@@ -332,6 +332,7 @@ supported_targets! { + + ("aarch64-unknown-freebsd", aarch64_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), +--- src/vendor/rustc-ap-rustc_target/spec/mod.rs.orig 2018-11-19 14:17:34.551246000 +0100 ++++ src/vendor/rustc-ap-rustc_target/spec/mod.rs 2018-11-19 14:17:10.216186000 +0100 +@@ -331,6 +331,7 @@ supported_targets! { + + ("aarch64-unknown-freebsd", aarch64_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), +--- src/liblibc/src/unix/bsd/freebsdlike/freebsd/mod.rs.orig 2018-11-19 14:20:07.096038000 +0100 ++++ src/liblibc/src/unix/bsd/freebsdlike/freebsd/mod.rs 2018-11-19 13:01:59.292790000 +0100 +@@ -1034,6 +1034,9 @@ cfg_if! { + } else if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; ++ } else if #[cfg(target_arch = "powerpc64")] { ++ mod powerpc64; ++ pub use self::powerpc64::*; + } else { + // Unknown target_arch + } +--- src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs.orig 2018-11-19 14:21:36.314181000 +0100 ++++ src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs 2018-11-19 14:22:10.808966000 +0100 +@@ -1034,6 +1034,9 @@ cfg_if! { + } else if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; ++ } else if #[cfg(target_arch = "powerpc64")] { ++ mod powerpc64; ++ pub use self::powerpc64::*; + } else { + // Unknown target_arch + } +--- src/liblibc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs.orig 2018-11-19 14:20:12.837254000 +0100 ++++ src/liblibc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs 2018-11-19 14:20:12.837191000 +0100 +@@ -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, ++ } ++} +--- src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs.orig 2018-11-19 14:21:23.597821000 +0100 ++++ src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs 2018-11-19 14:21:23.597719000 +0100 +@@ -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, ++ } ++} +--- src/bootstrap/native.rs.orig 2018-11-07 04:22:38.000000000 +0100 ++++ src/bootstrap/native.rs 2018-11-26 19:35:51.645221000 +0100 +@@ -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 { +--- src/librustc_llvm/build.rs.orig 2018-11-07 04:22:38.000000000 +0100 ++++ src/librustc_llvm/build.rs 2018-11-27 10:03:29.412777000 +0100 +@@ -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); +--- src/bootstrap/bootstrap.py.orig 2018-11-21 11:18:58.129031000 +0100 ++++ src/bootstrap/bootstrap.py 2018-11-21 11:21:11.736925000 +0100 +@@ -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', +--- src/liblibc/src/unix/bsd/freebsdlike/mod.rs 2018-11-22 13:49:08.899796000 +0100 ++++ src/liblibc/src/unix/bsd/freebsdlike/mod.rs 2018-11-22 13:49:38.884754000 +0100 +@@ -83,9 +83,9 @@ s! { + + pub struct stack_t { + // In FreeBSD 11 and later, ss_sp is actually a void* +- #[cfg(not(target_arch = "aarch64"))] ++ #[cfg(not(any(target_arch = "aarch64", target_arch = "powerpc64")))] + pub ss_sp: *mut ::c_char, +- #[cfg(target_arch = "aarch64")] ++ #[cfg(any(target_arch = "aarch64", target_arch = "powerpc64"))] + pub ss_sp: *mut ::c_void, + pub ss_size: ::size_t, + pub ss_flags: ::c_int, +--- src/vendor/libc/src/unix/bsd/freebsdlike/mod.rs 2018-11-22 13:47:52.038109000 +0100 ++++ src/vendor/libc/src/unix/bsd/freebsdlike/mod.rs 2018-11-22 13:48:31.862867000 +0100 +@@ -83,9 +83,9 @@ s! { + + pub struct stack_t { + // In FreeBSD 11 and later, ss_sp is actually a void* +- #[cfg(not(target_arch = "aarch64"))] ++ #[cfg(not(any(target_arch = "aarch64", target_arch = "powerpc64")))] + pub ss_sp: *mut ::c_char, +- #[cfg(target_arch = "aarch64")] ++ #[cfg(any(target_arch = "aarch64", target_arch = "powerpc64"))] + pub ss_sp: *mut ::c_void, + pub ss_size: ::size_t, + pub ss_flags: ::c_int, +--- src/libstd/os/raw/mod.rs 2018-11-22 13:53:58.570657000 +0100 ++++ src/libstd/os/raw/mod.rs 2018-11-22 13:54:47.466328000 +0100 +@@ -27,7 +27,8 @@ + 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 = "powerpc64")), + all(target_os = "netbsd", any(target_arch = "aarch64", + target_arch = "arm", + target_arch = "powerpc")), +@@ -43,7 +44,8 @@ + 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 = "powerpc64")), + all(target_os = "netbsd", any(target_arch = "aarch64", + target_arch = "arm", + target_arch = "powerpc")), +--- src/libstd/sys/unix/stack_overflow.rs 2018-11-22 13:55:32.806715000 +0100 ++++ src/libstd/sys/unix/stack_overflow.rs 2018-11-22 13:56:11.591672000 +0100 +@@ -154,14 +154,15 @@ mod imp { + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"), +- all(target_os = "freebsd", target_arch = "aarch64")))] ++ all(target_os = "freebsd", any(target_arch = "aarch64", ++ target_arch = "powerpc64"))))] + unsafe fn get_stack() -> libc::stack_t { + libc::stack_t { ss_sp: get_stackp(), ss_flags: 0, ss_size: SIGSTKSZ } + } + + #[cfg(all(any(target_os = "freebsd", + target_os = "dragonfly"), +- not(target_arch = "aarch64")))] ++ not(any(target_arch = "aarch64", target_arch = "powerpc64"))))] + unsafe fn get_stack() -> libc::stack_t { + libc::stack_t { ss_sp: get_stackp() as *mut i8, ss_flags: 0, ss_size: SIGSTKSZ } + }