Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Mar 2021 06:39:48 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r569007 - in head/lang: rust rust-bootstrap rust/files
Message-ID:  <202103230639.12N6dmER073194@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Tue Mar 23 06:39:47 2021
New Revision: 569007
URL: https://svnweb.freebsd.org/changeset/ports/569007

Log:
  lang/rust: Fix DOCS build, unbreak RUST_BACKTRACE
  
  - Fix DOCS build by disabling deny-warnings (rustc equivalent to
    -Werror).  Let's not fail the entire build just because a handful
    of docs fail to build due to -D broken-intra-doc-links [0]
  - Only install the host target docs.  We otherwise waste time with
    a rust-docs install-uninstall-install cycle for each additional
    target during stage.
  - Backport FreeBSD support for gimli, unbreak RUST_BACKTRACE, and
    have useful stack traces with actual content again [1]
  - While here also strip binaries under libexec/ and ack reading of
    src/bootstrap/CHANGELOG.md (changelog-seen=2)
  
  [0] https://github.com/rust-lang/rust/issues/76526
  
  PR:		253557 [1]
  Submitted by:	jbeich [1]

Added:
  head/lang/rust/files/patch-backtrace   (contents, props changed)
  head/lang/rust/files/patch-src_bootstrap_install.rs   (contents, props changed)
Modified:
  head/lang/rust-bootstrap/Makefile
  head/lang/rust/Makefile

Modified: head/lang/rust-bootstrap/Makefile
==============================================================================
--- head/lang/rust-bootstrap/Makefile	Tue Mar 23 02:44:18 2021	(r569006)
+++ head/lang/rust-bootstrap/Makefile	Tue Mar 23 06:39:47 2021	(r569007)
@@ -2,6 +2,7 @@
 
 PORTNAME=	rust
 PORTVERSION=	1.50.0
+PORTREVISION=	1
 CATEGORIES=	lang
 MASTER_SITES=	https://static.rust-lang.org/dist/:rust \
 		LOCAL/mikael:armbase \

Modified: head/lang/rust/Makefile
==============================================================================
--- head/lang/rust/Makefile	Tue Mar 23 02:44:18 2021	(r569006)
+++ head/lang/rust/Makefile	Tue Mar 23 06:39:47 2021	(r569007)
@@ -3,7 +3,7 @@
 
 PORTNAME=	rust
 PORTVERSION?=	1.50.0
-PORTREVISION?=	0
+PORTREVISION?=	1
 CATEGORIES=	lang
 MASTER_SITES=	https://static.rust-lang.org/dist/:src \
 		https://dev-static.rust-lang.org/dist/:src \
@@ -46,7 +46,6 @@ CONFLICTS_INSTALL?=	rust-nightly
 
 OPTIONS_DEFINE=		DOCS GDB SOURCES WASM
 OPTIONS_DEFAULT=	SOURCES WASM
-OPTIONS_EXCLUDE=	DOCS # https://github.com/rust-lang/rust/issues/76526
 .if defined(NIGHTLY_DATE)
 OPTIONS_EXCLUDE+=	SOURCES
 .endif
@@ -122,7 +121,8 @@ do-configure:
 	@cd ${WRKDIR}/${_component}-*-${OPSYS:tl} && \
 		${SH} install.sh --prefix=${WRKDIR}/bootstrap --verbose
 .endfor
-	@${ECHO_CMD} '[build]' > ${WRKSRC}/config.toml
+	@${ECHO_CMD} 'changelog-seen=2' > ${WRKSRC}/config.toml
+	@${ECHO_CMD} '[build]' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} 'vendor=true' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} 'extended=true' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} 'python="${PYTHON_CMD}"' >> ${WRKSRC}/config.toml
@@ -141,6 +141,7 @@ do-configure:
 	@${ECHO_CMD} '[rust]' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} 'channel="${PKGNAMESUFFIX:Ustable:S/^-//}"' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml
+	@${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} 'lld=${_RUST_BUILD_WASM}' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml
@@ -196,11 +197,18 @@ do-install:
 		${STAGEDIR}${PREFIX}/lib/rustlib/install.log \
 		${STAGEDIR}${PREFIX}/lib/rustlib/manifest-* \
 		${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh
-	@${FIND} ${STAGEDIR}${PREFIX}/bin ${STAGEDIR}${PREFIX}/lib -exec ${FILE} -i {} + | \
+	@${FIND} ${STAGEDIR}${PREFIX}/bin ${STAGEDIR}${PREFIX}/lib \
+		${STAGEDIR}${PREFIX}/libexec -exec ${FILE} -i {} + | \
 		${AWK} -F: '/executable|sharedlib/ { print $$1 }' | ${XARGS} ${STRIP_CMD}
 	@${FIND} ${STAGEDIR}${PREFIX} -not -type d | \
 		${SED} -E -e 's,^${STAGEDIR}${PREFIX}/,,' \
 			-e 's,(share/man/man[1-9]/.*\.[0-9]),\1.gz,' >> ${TMPPLIST}
+
+post-install-DOCS-on:
+# Ignore any left behind empty directories in case some docs fail
+# to build (failures are ignored due to deny-warnings=false).
+	@${FIND} ${STAGEDIR}${DOCSDIR}/html -empty -type d | \
+		${SED} 's,^${STAGEDIR},@comment @dir ,' >> ${TMPPLIST}
 
 post-install-SOURCES-on:
 # Silence stage-qa warnings by sanitizing permissions on sources

Added: head/lang/rust/files/patch-backtrace
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-backtrace	Tue Mar 23 06:39:47 2021	(r569007)
@@ -0,0 +1,918 @@
+https://github.com/rust-lang/rust/issues/78184
+
+--- library/backtrace/src/symbolize/gimli.rs.orig	2021-02-10 17:36:59 UTC
++++ library/backtrace/src/symbolize/gimli.rs
+@@ -361,6 +361,7 @@ cfg_if::cfg_if! {
+     } else if #[cfg(any(
+         target_os = "linux",
+         target_os = "fuchsia",
++        target_os = "freebsd",
+     ))] {
+         // Other Unix (e.g. Linux) platforms use ELF as an object file format
+         // and typically implement an API called `dl_iterate_phdr` to load
+--- vendor/libc-0.2.77/src/unix/bsd/freebsdlike/mod.rs.orig	2021-02-10 18:18:38 UTC
++++ vendor/libc-0.2.77/src/unix/bsd/freebsdlike/mod.rs
+@@ -14,6 +14,38 @@ pub type nl_item = ::c_int;
+ pub type id_t = i64;
+ pub type vm_size_t = ::uintptr_t;
+ 
++// elf.h
++
++pub type Elf32_Addr = u32;
++pub type Elf32_Half = u16;
++pub type Elf32_Lword = u64;
++pub type Elf32_Off = u32;
++pub type Elf32_Sword = i32;
++pub type Elf32_Word = u32;
++
++pub type Elf64_Addr = u64;
++pub type Elf64_Half = u16;
++pub type Elf64_Lword = u64;
++pub type Elf64_Off = u64;
++pub type Elf64_Sword = i32;
++pub type Elf64_Sxword = i64;
++pub type Elf64_Word = u32;
++pub type Elf64_Xword = u64;
++
++cfg_if! {
++    if #[cfg(target_pointer_width = "64")] {
++        type Elf_Addr = Elf64_Addr;
++        type Elf_Half = Elf64_Half;
++        type Elf_Phdr = Elf64_Phdr;
++    } else if #[cfg(target_pointer_width = "32")] {
++        type Elf_Addr = Elf32_Addr;
++        type Elf_Half = Elf32_Half;
++        type Elf_Phdr = Elf32_Phdr;
++    }
++}
++
++// link.h
++
+ #[cfg_attr(feature = "extra_traits", derive(Debug))]
+ pub enum timezone {}
+ impl ::Copy for timezone {}
+@@ -233,6 +265,43 @@ s! {
+         pub piod_addr: *mut ::c_void,
+         pub piod_len: ::size_t,
+     }
++
++    // elf.h
++
++    pub struct Elf32_Phdr {
++        pub p_type: Elf32_Word,
++        pub p_offset: Elf32_Off,
++        pub p_vaddr: Elf32_Addr,
++        pub p_paddr: Elf32_Addr,
++        pub p_filesz: Elf32_Word,
++        pub p_memsz: Elf32_Word,
++        pub p_flags: Elf32_Word,
++        pub p_align: Elf32_Word,
++    }
++
++    pub struct Elf64_Phdr {
++        pub p_type: Elf64_Word,
++        pub p_flags: Elf64_Word,
++        pub p_offset: Elf64_Off,
++        pub p_vaddr: Elf64_Addr,
++        pub p_paddr: Elf64_Addr,
++        pub p_filesz: Elf64_Xword,
++        pub p_memsz: Elf64_Xword,
++        pub p_align: Elf64_Xword,
++    }
++
++    // link.h
++
++    pub struct dl_phdr_info {
++        pub dlpi_addr: Elf_Addr,
++        pub dlpi_name: *const ::c_char,
++        pub dlpi_phdr: *const Elf_Phdr,
++        pub dlpi_phnum: Elf_Half,
++        pub dlpi_adds: ::c_ulonglong,
++        pub dlpi_subs: ::c_ulonglong,
++        pub dlpi_tls_modid: usize,
++        pub dlpi_tls_data: *mut ::c_void,
++    }
+ }
+ 
+ s_no_extra_traits! {
+@@ -1514,6 +1583,18 @@ extern "C" {
+ 
+     pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
+     pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
++
++    // #include <link.h>
++    pub fn dl_iterate_phdr(
++        callback: ::Option<
++            unsafe extern "C" fn(
++                info: *mut dl_phdr_info,
++                size: usize,
++                data: *mut ::c_void,
++            ) -> ::c_int,
++        >,
++        data: *mut ::c_void,
++    ) -> ::c_int;
+ }
+ 
+ #[link(name = "rt")]
+--- vendor/libc-0.2.77/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig	2021-02-10 18:18:38 UTC
++++ vendor/libc-0.2.77/src/unix/bsd/netbsdlike/netbsd/mod.rs
+@@ -11,6 +11,36 @@ pub type vm_size_t = ::uintptr_t;
+ pub type lwpid_t = ::c_uint;
+ pub type shmatt_t = ::c_uint;
+ 
++// elf.h
++
++pub type Elf32_Addr = u32;
++pub type Elf32_Half = u16;
++pub type Elf32_Lword = u64;
++pub type Elf32_Off = u32;
++pub type Elf32_Sword = i32;
++pub type Elf32_Word = u32;
++
++pub type Elf64_Addr = u64;
++pub type Elf64_Half = u16;
++pub type Elf64_Lword = u64;
++pub type Elf64_Off = u64;
++pub type Elf64_Sword = i32;
++pub type Elf64_Sxword = i64;
++pub type Elf64_Word = u32;
++pub type Elf64_Xword = u64;
++
++cfg_if! {
++    if #[cfg(target_pointer_width = "64")] {
++        type Elf_Addr = Elf64_Addr;
++        type Elf_Half = Elf64_Half;
++        type Elf_Phdr = Elf64_Phdr;
++    } else if #[cfg(target_pointer_width = "32")] {
++        type Elf_Addr = Elf32_Addr;
++        type Elf_Half = Elf32_Half;
++        type Elf_Phdr = Elf32_Phdr;
++    }
++}
++
+ impl siginfo_t {
+     pub unsafe fn si_value(&self) -> ::sigval {
+         #[repr(C)]
+@@ -341,6 +371,42 @@ s! {
+         pub time_state: ::c_int,
+     }
+ 
++    // elf.h
++
++    pub struct Elf32_Phdr {
++        pub p_type: Elf32_Word,
++        pub p_offset: Elf32_Off,
++        pub p_vaddr: Elf32_Addr,
++        pub p_paddr: Elf32_Addr,
++        pub p_filesz: Elf32_Word,
++        pub p_memsz: Elf32_Word,
++        pub p_flags: Elf32_Word,
++        pub p_align: Elf32_Word,
++    }
++
++    pub struct Elf64_Phdr {
++        pub p_type: Elf64_Word,
++        pub p_flags: Elf64_Word,
++        pub p_offset: Elf64_Off,
++        pub p_vaddr: Elf64_Addr,
++        pub p_paddr: Elf64_Addr,
++        pub p_filesz: Elf64_Xword,
++        pub p_memsz: Elf64_Xword,
++        pub p_align: Elf64_Xword,
++    }
++
++    // link.h
++
++    pub struct dl_phdr_info {
++        pub dlpi_addr: Elf_Addr,
++        pub dlpi_name: *const ::c_char,
++        pub dlpi_phdr: *const Elf_Phdr,
++        pub dlpi_phnum: Elf_Half,
++        pub dlpi_adds: ::c_ulonglong,
++        pub dlpi_subs: ::c_ulonglong,
++        pub dlpi_tls_modid: usize,
++        pub dlpi_tls_data: *mut ::c_void,
++    }
+ }
+ 
+ s_no_extra_traits! {
+@@ -1988,6 +2054,19 @@ extern "C" {
+         needle: *const ::c_void,
+         needlelen: ::size_t,
+     ) -> *mut ::c_void;
++
++    // link.h
++
++    pub fn dl_iterate_phdr(
++        callback: ::Option<
++            unsafe extern "C" fn(
++                info: *mut dl_phdr_info,
++                size: usize,
++                data: *mut ::c_void,
++            ) -> ::c_int,
++        >,
++        data: *mut ::c_void,
++    ) -> ::c_int;
+ }
+ 
+ #[link(name = "util")]
+--- vendor/libc-0.2.77/src/unix/bsd/netbsdlike/openbsd/mod.rs.orig	2021-02-10 18:18:38 UTC
++++ vendor/libc-0.2.77/src/unix/bsd/netbsdlike/openbsd/mod.rs
+@@ -16,6 +16,36 @@ pub type pthread_rwlock_t = *mut ::c_void;
+ pub type pthread_rwlockattr_t = *mut ::c_void;
+ pub type caddr_t = *mut ::c_char;
+ 
++// elf.h
++
++pub type Elf32_Addr = u32;
++pub type Elf32_Half = u16;
++pub type Elf32_Lword = u64;
++pub type Elf32_Off = u32;
++pub type Elf32_Sword = i32;
++pub type Elf32_Word = u32;
++
++pub type Elf64_Addr = u64;
++pub type Elf64_Half = u16;
++pub type Elf64_Lword = u64;
++pub type Elf64_Off = u64;
++pub type Elf64_Sword = i32;
++pub type Elf64_Sxword = i64;
++pub type Elf64_Word = u32;
++pub type Elf64_Xword = u64;
++
++cfg_if! {
++    if #[cfg(target_pointer_width = "64")] {
++        type Elf_Addr = Elf64_Addr;
++        type Elf_Half = Elf64_Half;
++        type Elf_Phdr = Elf64_Phdr;
++    } else if #[cfg(target_pointer_width = "32")] {
++        type Elf_Addr = Elf32_Addr;
++        type Elf_Half = Elf32_Half;
++        type Elf_Phdr = Elf32_Phdr;
++    }
++}
++
+ s! {
+     pub struct glob_t {
+         pub gl_pathc:   ::size_t,
+@@ -321,6 +351,38 @@ s! {
+         __shm_ctimensec: c_long,
+         pub shm_internal: *mut ::c_void,
+     }
++
++    // elf.h
++    pub struct Elf32_Phdr {
++        pub p_type: Elf32_Word,
++        pub p_offset: Elf32_Off,
++        pub p_vaddr: Elf32_Addr,
++        pub p_paddr: Elf32_Addr,
++        pub p_filesz: Elf32_Word,
++        pub p_memsz: Elf32_Word,
++        pub p_flags: Elf32_Word,
++        pub p_align: Elf32_Word,
++    }
++
++    pub struct Elf64_Phdr {
++        pub p_type: Elf64_Word,
++        pub p_flags: Elf64_Word,
++        pub p_offset: Elf64_Off,
++        pub p_vaddr: Elf64_Addr,
++        pub p_paddr: Elf64_Addr,
++        pub p_filesz: Elf64_Xword,
++        pub p_memsz: Elf64_Xword,
++        pub p_align: Elf64_Xword,
++    }
++
++    // link.h
++
++    pub struct dl_phdr_info {
++        pub dlpi_addr: Elf_Addr,
++        pub dlpi_name: *const ::c_char,
++        pub dlpi_phdr: *const Elf_Phdr,
++        pub dlpi_phnum: Elf_Half,
++    }
+ }
+ 
+ impl siginfo_t {
+@@ -1480,6 +1542,17 @@ extern "C" {
+         needle: *const ::c_void,
+         needlelen: ::size_t,
+     ) -> *mut ::c_void;
++    // #include <link.h>
++    pub fn dl_iterate_phdr(
++        callback: ::Option<
++            unsafe extern "C" fn(
++                info: *mut dl_phdr_info,
++                size: usize,
++                data: *mut ::c_void,
++            ) -> ::c_int,
++        >,
++        data: *mut ::c_void,
++    ) -> ::c_int;
+ }
+ 
+ cfg_if! {
+--- vendor/libc-0.2.79/src/unix/bsd/freebsdlike/mod.rs.orig	2021-02-10 18:18:38 UTC
++++ vendor/libc-0.2.79/src/unix/bsd/freebsdlike/mod.rs
+@@ -14,6 +14,38 @@ pub type nl_item = ::c_int;
+ pub type id_t = i64;
+ pub type vm_size_t = ::uintptr_t;
+ 
++// elf.h
++
++pub type Elf32_Addr = u32;
++pub type Elf32_Half = u16;
++pub type Elf32_Lword = u64;
++pub type Elf32_Off = u32;
++pub type Elf32_Sword = i32;
++pub type Elf32_Word = u32;
++
++pub type Elf64_Addr = u64;
++pub type Elf64_Half = u16;
++pub type Elf64_Lword = u64;
++pub type Elf64_Off = u64;
++pub type Elf64_Sword = i32;
++pub type Elf64_Sxword = i64;
++pub type Elf64_Word = u32;
++pub type Elf64_Xword = u64;
++
++cfg_if! {
++    if #[cfg(target_pointer_width = "64")] {
++        type Elf_Addr = Elf64_Addr;
++        type Elf_Half = Elf64_Half;
++        type Elf_Phdr = Elf64_Phdr;
++    } else if #[cfg(target_pointer_width = "32")] {
++        type Elf_Addr = Elf32_Addr;
++        type Elf_Half = Elf32_Half;
++        type Elf_Phdr = Elf32_Phdr;
++    }
++}
++
++// link.h
++
+ #[cfg_attr(feature = "extra_traits", derive(Debug))]
+ pub enum timezone {}
+ impl ::Copy for timezone {}
+@@ -233,6 +265,43 @@ s! {
+         pub piod_addr: *mut ::c_void,
+         pub piod_len: ::size_t,
+     }
++
++    // elf.h
++
++    pub struct Elf32_Phdr {
++        pub p_type: Elf32_Word,
++        pub p_offset: Elf32_Off,
++        pub p_vaddr: Elf32_Addr,
++        pub p_paddr: Elf32_Addr,
++        pub p_filesz: Elf32_Word,
++        pub p_memsz: Elf32_Word,
++        pub p_flags: Elf32_Word,
++        pub p_align: Elf32_Word,
++    }
++
++    pub struct Elf64_Phdr {
++        pub p_type: Elf64_Word,
++        pub p_flags: Elf64_Word,
++        pub p_offset: Elf64_Off,
++        pub p_vaddr: Elf64_Addr,
++        pub p_paddr: Elf64_Addr,
++        pub p_filesz: Elf64_Xword,
++        pub p_memsz: Elf64_Xword,
++        pub p_align: Elf64_Xword,
++    }
++
++    // link.h
++
++    pub struct dl_phdr_info {
++        pub dlpi_addr: Elf_Addr,
++        pub dlpi_name: *const ::c_char,
++        pub dlpi_phdr: *const Elf_Phdr,
++        pub dlpi_phnum: Elf_Half,
++        pub dlpi_adds: ::c_ulonglong,
++        pub dlpi_subs: ::c_ulonglong,
++        pub dlpi_tls_modid: usize,
++        pub dlpi_tls_data: *mut ::c_void,
++    }
+ }
+ 
+ s_no_extra_traits! {
+@@ -1514,6 +1583,18 @@ extern "C" {
+ 
+     pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
+     pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
++
++    // #include <link.h>
++    pub fn dl_iterate_phdr(
++        callback: ::Option<
++            unsafe extern "C" fn(
++                info: *mut dl_phdr_info,
++                size: usize,
++                data: *mut ::c_void,
++            ) -> ::c_int,
++        >,
++        data: *mut ::c_void,
++    ) -> ::c_int;
+ }
+ 
+ #[link(name = "rt")]
+--- vendor/libc-0.2.79/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig	2021-02-10 18:18:38 UTC
++++ vendor/libc-0.2.79/src/unix/bsd/netbsdlike/netbsd/mod.rs
+@@ -11,6 +11,36 @@ pub type vm_size_t = ::uintptr_t;
+ pub type lwpid_t = ::c_uint;
+ pub type shmatt_t = ::c_uint;
+ 
++// elf.h
++
++pub type Elf32_Addr = u32;
++pub type Elf32_Half = u16;
++pub type Elf32_Lword = u64;
++pub type Elf32_Off = u32;
++pub type Elf32_Sword = i32;
++pub type Elf32_Word = u32;
++
++pub type Elf64_Addr = u64;
++pub type Elf64_Half = u16;
++pub type Elf64_Lword = u64;
++pub type Elf64_Off = u64;
++pub type Elf64_Sword = i32;
++pub type Elf64_Sxword = i64;
++pub type Elf64_Word = u32;
++pub type Elf64_Xword = u64;
++
++cfg_if! {
++    if #[cfg(target_pointer_width = "64")] {
++        type Elf_Addr = Elf64_Addr;
++        type Elf_Half = Elf64_Half;
++        type Elf_Phdr = Elf64_Phdr;
++    } else if #[cfg(target_pointer_width = "32")] {
++        type Elf_Addr = Elf32_Addr;
++        type Elf_Half = Elf32_Half;
++        type Elf_Phdr = Elf32_Phdr;
++    }
++}
++
+ impl siginfo_t {
+     pub unsafe fn si_value(&self) -> ::sigval {
+         #[repr(C)]
+@@ -341,6 +371,42 @@ s! {
+         pub time_state: ::c_int,
+     }
+ 
++    // elf.h
++
++    pub struct Elf32_Phdr {
++        pub p_type: Elf32_Word,
++        pub p_offset: Elf32_Off,
++        pub p_vaddr: Elf32_Addr,
++        pub p_paddr: Elf32_Addr,
++        pub p_filesz: Elf32_Word,
++        pub p_memsz: Elf32_Word,
++        pub p_flags: Elf32_Word,
++        pub p_align: Elf32_Word,
++    }
++
++    pub struct Elf64_Phdr {
++        pub p_type: Elf64_Word,
++        pub p_flags: Elf64_Word,
++        pub p_offset: Elf64_Off,
++        pub p_vaddr: Elf64_Addr,
++        pub p_paddr: Elf64_Addr,
++        pub p_filesz: Elf64_Xword,
++        pub p_memsz: Elf64_Xword,
++        pub p_align: Elf64_Xword,
++    }
++
++    // link.h
++
++    pub struct dl_phdr_info {
++        pub dlpi_addr: Elf_Addr,
++        pub dlpi_name: *const ::c_char,
++        pub dlpi_phdr: *const Elf_Phdr,
++        pub dlpi_phnum: Elf_Half,
++        pub dlpi_adds: ::c_ulonglong,
++        pub dlpi_subs: ::c_ulonglong,
++        pub dlpi_tls_modid: usize,
++        pub dlpi_tls_data: *mut ::c_void,
++    }
+ }
+ 
+ s_no_extra_traits! {
+@@ -1990,6 +2056,19 @@ extern "C" {
+         needle: *const ::c_void,
+         needlelen: ::size_t,
+     ) -> *mut ::c_void;
++
++    // link.h
++
++    pub fn dl_iterate_phdr(
++        callback: ::Option<
++            unsafe extern "C" fn(
++                info: *mut dl_phdr_info,
++                size: usize,
++                data: *mut ::c_void,
++            ) -> ::c_int,
++        >,
++        data: *mut ::c_void,
++    ) -> ::c_int;
+ }
+ 
+ #[link(name = "util")]
+--- vendor/libc-0.2.79/src/unix/bsd/netbsdlike/openbsd/mod.rs.orig	2021-02-10 18:18:38 UTC
++++ vendor/libc-0.2.79/src/unix/bsd/netbsdlike/openbsd/mod.rs
+@@ -16,6 +16,36 @@ pub type pthread_rwlock_t = *mut ::c_void;
+ pub type pthread_rwlockattr_t = *mut ::c_void;
+ pub type caddr_t = *mut ::c_char;
+ 
++// elf.h
++
++pub type Elf32_Addr = u32;
++pub type Elf32_Half = u16;
++pub type Elf32_Lword = u64;
++pub type Elf32_Off = u32;
++pub type Elf32_Sword = i32;
++pub type Elf32_Word = u32;
++
++pub type Elf64_Addr = u64;
++pub type Elf64_Half = u16;
++pub type Elf64_Lword = u64;
++pub type Elf64_Off = u64;
++pub type Elf64_Sword = i32;
++pub type Elf64_Sxword = i64;
++pub type Elf64_Word = u32;
++pub type Elf64_Xword = u64;
++
++cfg_if! {
++    if #[cfg(target_pointer_width = "64")] {
++        type Elf_Addr = Elf64_Addr;
++        type Elf_Half = Elf64_Half;
++        type Elf_Phdr = Elf64_Phdr;
++    } else if #[cfg(target_pointer_width = "32")] {
++        type Elf_Addr = Elf32_Addr;
++        type Elf_Half = Elf32_Half;
++        type Elf_Phdr = Elf32_Phdr;
++    }
++}
++
+ s! {
+     pub struct glob_t {
+         pub gl_pathc:   ::size_t,
+@@ -321,6 +351,38 @@ s! {
+         __shm_ctimensec: c_long,
+         pub shm_internal: *mut ::c_void,
+     }
++
++    // elf.h
++    pub struct Elf32_Phdr {
++        pub p_type: Elf32_Word,
++        pub p_offset: Elf32_Off,
++        pub p_vaddr: Elf32_Addr,
++        pub p_paddr: Elf32_Addr,
++        pub p_filesz: Elf32_Word,
++        pub p_memsz: Elf32_Word,
++        pub p_flags: Elf32_Word,
++        pub p_align: Elf32_Word,
++    }
++
++    pub struct Elf64_Phdr {
++        pub p_type: Elf64_Word,
++        pub p_flags: Elf64_Word,
++        pub p_offset: Elf64_Off,
++        pub p_vaddr: Elf64_Addr,
++        pub p_paddr: Elf64_Addr,
++        pub p_filesz: Elf64_Xword,
++        pub p_memsz: Elf64_Xword,
++        pub p_align: Elf64_Xword,
++    }
++
++    // link.h
++
++    pub struct dl_phdr_info {
++        pub dlpi_addr: Elf_Addr,
++        pub dlpi_name: *const ::c_char,
++        pub dlpi_phdr: *const Elf_Phdr,
++        pub dlpi_phnum: Elf_Half,
++    }
+ }
+ 
+ impl siginfo_t {
+@@ -1482,6 +1544,17 @@ extern "C" {
+         needle: *const ::c_void,
+         needlelen: ::size_t,
+     ) -> *mut ::c_void;
++    // #include <link.h>
++    pub fn dl_iterate_phdr(
++        callback: ::Option<
++            unsafe extern "C" fn(
++                info: *mut dl_phdr_info,
++                size: usize,
++                data: *mut ::c_void,
++            ) -> ::c_int,
++        >,
++        data: *mut ::c_void,
++    ) -> ::c_int;
+ }
+ 
+ cfg_if! {
+--- vendor/libc/src/unix/bsd/freebsdlike/mod.rs.orig	2021-02-10 18:18:38 UTC
++++ vendor/libc/src/unix/bsd/freebsdlike/mod.rs
+@@ -14,6 +14,38 @@ pub type nl_item = ::c_int;
+ pub type id_t = i64;
+ pub type vm_size_t = ::uintptr_t;
+ 
++// elf.h
++
++pub type Elf32_Addr = u32;
++pub type Elf32_Half = u16;
++pub type Elf32_Lword = u64;
++pub type Elf32_Off = u32;
++pub type Elf32_Sword = i32;
++pub type Elf32_Word = u32;
++
++pub type Elf64_Addr = u64;
++pub type Elf64_Half = u16;
++pub type Elf64_Lword = u64;
++pub type Elf64_Off = u64;
++pub type Elf64_Sword = i32;
++pub type Elf64_Sxword = i64;
++pub type Elf64_Word = u32;
++pub type Elf64_Xword = u64;
++
++cfg_if! {
++    if #[cfg(target_pointer_width = "64")] {
++        type Elf_Addr = Elf64_Addr;
++        type Elf_Half = Elf64_Half;
++        type Elf_Phdr = Elf64_Phdr;
++    } else if #[cfg(target_pointer_width = "32")] {
++        type Elf_Addr = Elf32_Addr;
++        type Elf_Half = Elf32_Half;
++        type Elf_Phdr = Elf32_Phdr;
++    }
++}
++
++// link.h
++
+ #[cfg_attr(feature = "extra_traits", derive(Debug))]
+ pub enum timezone {}
+ impl ::Copy for timezone {}
+@@ -233,6 +265,43 @@ s! {
+         pub piod_addr: *mut ::c_void,
+         pub piod_len: ::size_t,
+     }
++
++    // elf.h
++
++    pub struct Elf32_Phdr {
++        pub p_type: Elf32_Word,
++        pub p_offset: Elf32_Off,
++        pub p_vaddr: Elf32_Addr,
++        pub p_paddr: Elf32_Addr,
++        pub p_filesz: Elf32_Word,
++        pub p_memsz: Elf32_Word,
++        pub p_flags: Elf32_Word,
++        pub p_align: Elf32_Word,
++    }
++
++    pub struct Elf64_Phdr {
++        pub p_type: Elf64_Word,
++        pub p_flags: Elf64_Word,
++        pub p_offset: Elf64_Off,
++        pub p_vaddr: Elf64_Addr,
++        pub p_paddr: Elf64_Addr,
++        pub p_filesz: Elf64_Xword,
++        pub p_memsz: Elf64_Xword,
++        pub p_align: Elf64_Xword,
++    }
++
++    // link.h
++
++    pub struct dl_phdr_info {
++        pub dlpi_addr: Elf_Addr,
++        pub dlpi_name: *const ::c_char,
++        pub dlpi_phdr: *const Elf_Phdr,
++        pub dlpi_phnum: Elf_Half,
++        pub dlpi_adds: ::c_ulonglong,
++        pub dlpi_subs: ::c_ulonglong,
++        pub dlpi_tls_modid: usize,
++        pub dlpi_tls_data: *mut ::c_void,
++    }
+ }
+ 
+ s_no_extra_traits! {
+@@ -1514,6 +1583,18 @@ extern "C" {
+ 
+     pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
+     pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
++
++    // #include <link.h>
++    pub fn dl_iterate_phdr(
++        callback: ::Option<
++            unsafe extern "C" fn(
++                info: *mut dl_phdr_info,
++                size: usize,
++                data: *mut ::c_void,
++            ) -> ::c_int,
++        >,
++        data: *mut ::c_void,
++    ) -> ::c_int;
+ }
+ 
+ #[link(name = "rt")]
+--- vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig	2021-02-10 18:18:38 UTC
++++ vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
+@@ -11,6 +11,36 @@ pub type vm_size_t = ::uintptr_t;
+ pub type lwpid_t = ::c_uint;
+ pub type shmatt_t = ::c_uint;
+ 
++// elf.h
++
++pub type Elf32_Addr = u32;
++pub type Elf32_Half = u16;
++pub type Elf32_Lword = u64;
++pub type Elf32_Off = u32;
++pub type Elf32_Sword = i32;
++pub type Elf32_Word = u32;
++
++pub type Elf64_Addr = u64;
++pub type Elf64_Half = u16;
++pub type Elf64_Lword = u64;
++pub type Elf64_Off = u64;
++pub type Elf64_Sword = i32;
++pub type Elf64_Sxword = i64;
++pub type Elf64_Word = u32;
++pub type Elf64_Xword = u64;
++
++cfg_if! {
++    if #[cfg(target_pointer_width = "64")] {
++        type Elf_Addr = Elf64_Addr;
++        type Elf_Half = Elf64_Half;
++        type Elf_Phdr = Elf64_Phdr;
++    } else if #[cfg(target_pointer_width = "32")] {
++        type Elf_Addr = Elf32_Addr;
++        type Elf_Half = Elf32_Half;
++        type Elf_Phdr = Elf32_Phdr;
++    }
++}
++
+ impl siginfo_t {
+     pub unsafe fn si_value(&self) -> ::sigval {
+         #[repr(C)]
+@@ -341,6 +371,42 @@ s! {
+         pub time_state: ::c_int,
+     }
+ 
++    // elf.h
++
++    pub struct Elf32_Phdr {
++        pub p_type: Elf32_Word,
++        pub p_offset: Elf32_Off,
++        pub p_vaddr: Elf32_Addr,
++        pub p_paddr: Elf32_Addr,
++        pub p_filesz: Elf32_Word,
++        pub p_memsz: Elf32_Word,
++        pub p_flags: Elf32_Word,
++        pub p_align: Elf32_Word,
++    }
++
++    pub struct Elf64_Phdr {
++        pub p_type: Elf64_Word,
++        pub p_flags: Elf64_Word,
++        pub p_offset: Elf64_Off,
++        pub p_vaddr: Elf64_Addr,
++        pub p_paddr: Elf64_Addr,
++        pub p_filesz: Elf64_Xword,
++        pub p_memsz: Elf64_Xword,
++        pub p_align: Elf64_Xword,
++    }
++
++    // link.h
++
++    pub struct dl_phdr_info {
++        pub dlpi_addr: Elf_Addr,
++        pub dlpi_name: *const ::c_char,
++        pub dlpi_phdr: *const Elf_Phdr,
++        pub dlpi_phnum: Elf_Half,
++        pub dlpi_adds: ::c_ulonglong,
++        pub dlpi_subs: ::c_ulonglong,
++        pub dlpi_tls_modid: usize,
++        pub dlpi_tls_data: *mut ::c_void,
++    }
+ }
+ 
+ s_no_extra_traits! {
+@@ -2002,6 +2068,19 @@ extern "C" {
+         needle: *const ::c_void,
+         needlelen: ::size_t,
+     ) -> *mut ::c_void;
++
++    // link.h
++
++    pub fn dl_iterate_phdr(
++        callback: ::Option<
++            unsafe extern "C" fn(
++                info: *mut dl_phdr_info,
++                size: usize,
++                data: *mut ::c_void,
++            ) -> ::c_int,
++        >,
++        data: *mut ::c_void,
++    ) -> ::c_int;
+ }
+ 
+ #[link(name = "util")]
+--- vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs.orig	2021-02-10 18:18:38 UTC
++++ vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs
+@@ -16,6 +16,36 @@ pub type pthread_rwlock_t = *mut ::c_void;
+ pub type pthread_rwlockattr_t = *mut ::c_void;
+ pub type caddr_t = *mut ::c_char;
+ 
++// elf.h
++
++pub type Elf32_Addr = u32;
++pub type Elf32_Half = u16;
++pub type Elf32_Lword = u64;
++pub type Elf32_Off = u32;
++pub type Elf32_Sword = i32;
++pub type Elf32_Word = u32;
++
++pub type Elf64_Addr = u64;
++pub type Elf64_Half = u16;
++pub type Elf64_Lword = u64;
++pub type Elf64_Off = u64;
++pub type Elf64_Sword = i32;
++pub type Elf64_Sxword = i64;
++pub type Elf64_Word = u32;
++pub type Elf64_Xword = u64;
++
++cfg_if! {
++    if #[cfg(target_pointer_width = "64")] {
++        type Elf_Addr = Elf64_Addr;
++        type Elf_Half = Elf64_Half;
++        type Elf_Phdr = Elf64_Phdr;
++    } else if #[cfg(target_pointer_width = "32")] {
++        type Elf_Addr = Elf32_Addr;
++        type Elf_Half = Elf32_Half;
++        type Elf_Phdr = Elf32_Phdr;
++    }
++}
++
+ s! {
+     pub struct glob_t {
+         pub gl_pathc:   ::size_t,
+@@ -321,6 +351,38 @@ s! {
+         __shm_ctimensec: c_long,
+         pub shm_internal: *mut ::c_void,
+     }
++
++    // elf.h
++    pub struct Elf32_Phdr {
++        pub p_type: Elf32_Word,
++        pub p_offset: Elf32_Off,
++        pub p_vaddr: Elf32_Addr,
++        pub p_paddr: Elf32_Addr,
++        pub p_filesz: Elf32_Word,
++        pub p_memsz: Elf32_Word,
++        pub p_flags: Elf32_Word,
++        pub p_align: Elf32_Word,
++    }
++
++    pub struct Elf64_Phdr {
++        pub p_type: Elf64_Word,
++        pub p_flags: Elf64_Word,
++        pub p_offset: Elf64_Off,
++        pub p_vaddr: Elf64_Addr,
++        pub p_paddr: Elf64_Addr,
++        pub p_filesz: Elf64_Xword,
++        pub p_memsz: Elf64_Xword,
++        pub p_align: Elf64_Xword,
++    }
++
++    // link.h
++
++    pub struct dl_phdr_info {
++        pub dlpi_addr: Elf_Addr,
++        pub dlpi_name: *const ::c_char,
++        pub dlpi_phdr: *const Elf_Phdr,
++        pub dlpi_phnum: Elf_Half,
++    }
+ }
+ 
+ impl siginfo_t {
+@@ -1482,6 +1544,17 @@ extern "C" {
+         needle: *const ::c_void,
+         needlelen: ::size_t,
+     ) -> *mut ::c_void;
++    // #include <link.h>
++    pub fn dl_iterate_phdr(
++        callback: ::Option<
++            unsafe extern "C" fn(
++                info: *mut dl_phdr_info,
++                size: usize,
++                data: *mut ::c_void,
++            ) -> ::c_int,
++        >,
++        data: *mut ::c_void,
++    ) -> ::c_int;
+ }
+ 
+ cfg_if! {

Added: head/lang/rust/files/patch-src_bootstrap_install.rs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-src_bootstrap_install.rs	Tue Mar 23 06:39:47 2021	(r569007)
@@ -0,0 +1,17 @@
+Only install docs for the host target
+
+It otherwise wastes significant time (there are a lot of individual
+files) and stages host docs, wasm docs, which unstages the host
+docs first.
+
+--- src/bootstrap/install.rs.orig	2021-03-22 17:05:25 UTC
++++ src/bootstrap/install.rs
+@@ -133,7 +133,7 @@ macro_rules! install {

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103230639.12N6dmER073194>