Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Sep 2021 09:15:59 GMT
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 4e617b25b87c - main - lang/rust-bootstrap: Use devel/freebsd-sysroot
Message-ID:  <202109190915.18J9FxKZ009449@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by tobik:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4e617b25b87c681c05e6575d6ffec2fc1c86fd5b

commit 4e617b25b87c681c05e6575d6ffec2fc1c86fd5b
Author:     Tobias Kortkamp <tobik@FreeBSD.org>
AuthorDate: 2021-09-11 23:46:02 +0000
Commit:     Tobias Kortkamp <tobik@FreeBSD.org>
CommitDate: 2021-09-19 09:03:22 +0000

    lang/rust-bootstrap: Use devel/freebsd-sysroot
---
 lang/rust-bootstrap/Makefile | 105 ++++---------------------------------------
 lang/rust-bootstrap/distinfo |  20 ---------
 2 files changed, 8 insertions(+), 117 deletions(-)

diff --git a/lang/rust-bootstrap/Makefile b/lang/rust-bootstrap/Makefile
index 76c7b3050f36..6a8d9d1ed894 100644
--- a/lang/rust-bootstrap/Makefile
+++ b/lang/rust-bootstrap/Makefile
@@ -4,14 +4,10 @@
 PORTNAME=	rust
 PORTVERSION=	1.55.0
 CATEGORIES=	lang
-MASTER_SITES=	https://static.rust-lang.org/dist/:rust \
-		LOCAL/tobik/rust:${FLAVOR} \
-		https://download.freebsd.org/ftp/${_RUST_FBSD_SUBDIR_${FLAVOR}}/:${FLAVOR}
-#		http://pkg.freebsd.org/FreeBSD:12:powerpc64/quarterly/All/gcc9-9.3.0_1.txz?dummy=/:powerpc64_gcc
+MASTER_SITES=	https://static.rust-lang.org/dist/
+PKGNAMEPREFIX=	${FLAVOR:S/_/-/g}-
 PKGNAMESUFFIX=	-bootstrap
 DISTNAME=	${PORTNAME}c-${PORTVERSION}-src
-DISTFILES=	${DISTNAME}${EXTRACT_SUFX}:rust \
-		${_RUST_FBSD_DIST_${FLAVOR}:@f@bootstrap/$f:${FLAVOR}@}
 DIST_SUBDIR=	rust
 
 MAINTAINER=	rust@FreeBSD.org
@@ -25,7 +21,8 @@ LICENSE_FILE_MIT=	${WRKSRC}/LICENSE-MIT
 ONLY_FOR_ARCHS=	amd64
 ONLY_FOR_ARCHS_REASON=	untested on other archs
 
-BUILD_DEPENDS=	cmake:devel/cmake \
+BUILD_DEPENDS=	${FLAVOR:S/_/-/g}-freebsd-sysroot>=a2021.09.14:devel/freebsd-sysroot@${FLAVOR} \
+		cmake:devel/cmake \
 		gmake:devel/gmake \
 		rust>=${PORTVERSION}:lang/rust
 
@@ -33,18 +30,6 @@ FLAVORS=	aarch64 amd64 armv6 armv7 i386 powerpc64_elfv1 powerpc64_elfv2 \
 		powerpc64le powerpc
 FLAVOR?=	${FLAVORS:[1]}
 
-aarch64_PKGNAMEPREFIX=		aarch64-
-amd64_PKGNAMEPREFIX=		amd64-
-armv6_PKGNAMEPREFIX=		armv6-
-armv7_PKGNAMEPREFIX=		armv7-
-i386_PKGNAMEPREFIX=		i386-
-powerpc64_elfv1_PKGNAMEPREFIX=	powerpc64-elfv1-
-powerpc64_elfv1_BUILD_DEPENDS=	powerpc64-gcc9>0:devel/freebsd-gcc9@powerpc64
-powerpc64_elfv2_PKGNAMEPREFIX=	powerpc64-elfv2-
-powerpc64le_PKGNAMEPREFIX=	powerpc64le-
-powerpc_PKGNAMEPREFIX=		powerpc-
-powerpc_BUILD_DEPENDS=		powerpc-binutils>0:devel/binutils@powerpc
-
 USES=		ninja:build perl5 python:3.6+,build tar:xz
 .if ${FLAVOR} == powerpc64_elfv1
 USE_GCC=	9:build
@@ -60,40 +45,11 @@ TMPDIR?=	${WRKDIR}
 # Resulting packages are not specific to amd64
 NO_ARCH=	yes
 
-_RUST_FBSD_DIST_aarch64=		FreeBSD-${_RUST_FBSD_VER}-arm64${EXTRACT_SUFX}
-_RUST_FBSD_DIST_amd64=			FreeBSD-${_RUST_FBSD_VER}-amd64${EXTRACT_SUFX}
-# base.txz for armv* created from WANDBOARD images as there seem
-# to be no generic base.txz for it.
-_RUST_FBSD_DIST_armv6=			FreeBSD-${_RUST_FBSD_VER}-arm-armv6${EXTRACT_SUFX}
-_RUST_FBSD_DIST_armv7=			FreeBSD-${_RUST_FBSD_VER}-arm-armv7${EXTRACT_SUFX}
-_RUST_FBSD_DIST_i386=			FreeBSD-${_RUST_FBSD_VER}-i386${EXTRACT_SUFX}
-_RUST_FBSD_DIST_powerpc64_elfv1=	FreeBSD-${_RUST_FBSD_VER}-powerpc64-elfv1${EXTRACT_SUFX} \
-					FreeBSD-${_RUST_FBSD_VER}-powerpc64-elfv1-gcc9-9.3.0${EXTRACT_SUFX}
-_RUST_FBSD_DIST_powerpc64_elfv2=	FreeBSD-${_RUST_FBSD_VER}-powerpc64-elfv2-v1300123${EXTRACT_SUFX}
-_RUST_FBSD_DIST_powerpc64le=		FreeBSD-${_RUST_FBSD_VER}-powerpc64le-r366300${EXTRACT_SUFX}
-_RUST_FBSD_DIST_powerpc=		FreeBSD-${_RUST_FBSD_VER}-powerpc${EXTRACT_SUFX}
-_RUST_FBSD_VER=				${_RUST_FBSD_VER_${FLAVOR}:U11.4-RELEASE}
-_RUST_FBSD_VER_aarch64=			12.2-RELEASE
-_RUST_FBSD_VER_armv7=			12.2-RELEASE
-_RUST_FBSD_VER_powerpc64_elfv1=		12.2-RELEASE
-_RUST_FBSD_VER_powerpc64_elfv2=		13.0-CURRENT
-_RUST_FBSD_VER_powerpc64le=		13.0-CURRENT
-_RUST_FBSD_VER_powerpc=			13.0-RELEASE
-_RUST_FBSD_SUBDIR_aarch64=		releases/arm64/${_RUST_FBSD_VER}/base.txz?dummy=
-_RUST_FBSD_SUBDIR_amd64=		releases/amd64/${_RUST_FBSD_VER}/base.txz?dummy=
-_RUST_FBSD_SUBDIR_i386=			releases/i386/${_RUST_FBSD_VER}/base.txz?dummy=
-_RUST_FBSD_SUBDIR_powerpc64_elfv1=	releases/powerpc/powerpc64/${_RUST_FBSD_VER}/base.txz?dummy=
-_RUST_FBSD_SUBDIR_powerpc64_elfv2=	snapshots/powerpc/powerpc64/${_RUST_FBSD_VER}/base.txz?dummy=
-_RUST_FBSD_SUBDIR_powerpc64le=		snapshots/powerpc/powerpc64le/${_RUST_FBSD_VER}/base.txz?dummy=
-_RUST_FBSD_SUBDIR_powerpc=		releases/powerpc/powerpc/${_RUST_FBSD_VER}/base.txz?dummy=
-
 _CARGO_VENDOR_DIR=			${WRKSRC}/vendor
 _RUST_ARCH_amd64=			x86_64
 _RUST_ARCH_i386=			i686
 _RUST_ARCH_powerpc64_elfv1=		powerpc64
 _RUST_ARCH_powerpc64_elfv2=		powerpc64
-_RUST_ARCH_powerpc64le=			powerpc64le
-_RUST_ARCH_powerpc=			powerpc
 _RUST_HOST=				${_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl}
 _RUST_TARGET=				${_RUST_ARCH_${FLAVOR}:U${FLAVOR}}-unknown-${OPSYS:tl}
 _RUST_LLVM_TARGET=			${_RUST_LLVM_TARGET_${FLAVOR}}
@@ -106,11 +62,6 @@ _RUST_LLVM_TARGET_powerpc64_elfv1=	PowerPC
 _RUST_LLVM_TARGET_powerpc64_elfv2=	PowerPC
 _RUST_LLVM_TARGET_powerpc64le=		PowerPC
 _RUST_LLVM_TARGET_powerpc=		PowerPC
-_RUST_LLVM_TRIPLE=			${_RUST_LLVM_TRIPLE_${FLAVOR}:U${_RUST_TARGET}}
-_RUST_LLVM_TRIPLE_aarch64=		aarch64-unknown-freebsd12.0
-_RUST_LLVM_TRIPLE_armv6=		armv6-gnueabihf-freebsd
-_RUST_LLVM_TRIPLE_armv7=		armv7-gnueabihf-freebsd
-_RUST_LLVM_TRIPLE_powerpc=		powerpc-unknown-freebsd13.0 # secure-plt
 
 .include <bsd.port.pre.mk>
 
@@ -127,12 +78,6 @@ IGNORE=	will not build on 12.x due to old system
 EXTRA_PATCHES+=	${PATCHDIR}/${FLAVOR:S/_/-/}
 .endif
 
-.if make(distclean) || make(makesum)
-.MAKEFLAGS:	MASTER_SITES="${FLAVORS:@_flavor@${:!${SETENV} FLAVOR=${_flavor} ${MAKE} -VMASTER_SITES!}@:O:u:q}" # PR 249537
-DISTFILES:=	${DISTFILES:M*\:rust} \
-		${FLAVORS:O:@_flavor@${:!${SETENV} FLAVOR=${_flavor} ${MAKE} -V'DISTFILES:N*\:rust'!}@}
-.endif
-
 post-patch:
 # Disable vendor checksums
 	@${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \
@@ -141,7 +86,7 @@ post-patch:
 	@${REINPLACE_CMD} -e 's,"c++","stdc++",g' \
 		${WRKSRC}/compiler/rustc_llvm/build.rs
 	@${REINPLACE_CMD} -e 's,%CC%,${CC},g' \
-		-e 's,%WRKDIR%,${WRKDIR},g' \
+		-e 's,%WRKDIR%,${LOCALBASE}/freebsd-sysroot/powerpc64-elfv1,g' \
 		${WRKSRC}/compiler/rustc_llvm/build.rs \
 		${WRKSRC}/src/bootstrap/native.rs
 .endif
@@ -184,9 +129,9 @@ do-configure:
 # host compiler that can build the host->target compiler
 	@${ECHO_CMD} 'targets="${_RUST_LLVM_TARGET};X86"' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} '[target.${_RUST_TARGET}]' >> ${WRKSRC}/config.toml
-	@${ECHO_CMD} 'cc="${WRKDIR}/${_RUST_TARGET}-cc"' >> ${WRKSRC}/config.toml
-	@${ECHO_CMD} 'cxx="${WRKDIR}/${_RUST_TARGET}-c++"' >> ${WRKSRC}/config.toml
-	@${ECHO_CMD} 'linker="${WRKDIR}/${_RUST_TARGET}-cc"' >> ${WRKSRC}/config.toml
+	@${ECHO_CMD} 'cc="${LOCALBASE}/freebsd-sysroot/${FLAVOR:S/_/-/g}/bin/cc"' >> ${WRKSRC}/config.toml
+	@${ECHO_CMD} 'cxx="${LOCALBASE}/freebsd-sysroot/${FLAVOR:S/_/-/g}/bin/c++"' >> ${WRKSRC}/config.toml
+	@${ECHO_CMD} 'linker="${LOCALBASE}/freebsd-sysroot/${FLAVOR:S/_/-/g}/bin/cc"' >> ${WRKSRC}/config.toml
 .for _key _util in ar ${AR} ranlib ${RANLIB}
 	@bin="$$(which ${_util})"; \
 		${ECHO_CMD} "${_key}=\"$$bin\"" >> ${WRKSRC}/config.toml
@@ -199,40 +144,6 @@ do-configure:
 .endif
 	@${ECHO_CMD} '[dist]' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml
-.if ${FLAVOR} == powerpc64_elfv1
-	@${RLN} ${WRKDIR}${LOCALBASE}/lib/gcc9/libstdc++.a ${WRKDIR}/usr/lib/libstdc++.a
-	@${RLN} ${WRKDIR}${LOCALBASE}/lib/gcc9/libstdc++.a ${WRKDIR}/usr/lib/libc++.a
-	@gcc="$$(${ECHO_CMD} ${LOCALBASE}/bin/${_RUST_TARGET}*[0-9]-gcc9)"; \
-		${PRINTF} '#!/bin/sh\nexec %s --sysroot=${WRKDIR} -Wl,-rpath=${LOCALBASE}/lib/gcc9 -L${WRKDIR}${LOCALBASE}/lib/gcc9 "$$@"\n' "$${gcc}" \
-			> ${WRKDIR}/${_RUST_TARGET}-cc
-	@gcc="$$(${ECHO_CMD} ${LOCALBASE}/bin/${_RUST_TARGET}*[0-9]-g++9)"; \
-		cxxinc="/$$(cd ${WRKDIR} && ${ECHO_CMD} ${LOCALBASE:S,^/,,}/lib/gcc9/include/c++/powerpc64-*)"; \
-		${PRINTF} '#!/bin/sh\nexec %s --sysroot=${WRKDIR} -isystem=${LOCALBASE}/lib/gcc9/include/c++ -isystem=%s -Wl,-rpath=${LOCALBASE}/lib/gcc9 -L${WRKDIR}${LOCALBASE}/lib/gcc9 "$$@"\n' "$${gcc}" "$${cxxinc}" \
-			> ${WRKDIR}/${_RUST_TARGET}-c++
-.elif ${FLAVOR} == powerpc64_elfv2
-	@${PRINTF} '#!/bin/sh\nexec ${CC} --sysroot=${WRKDIR} -mabi=elfv2 --target=${_RUST_LLVM_TRIPLE} "$$@"\n' \
-		> ${WRKDIR}/${_RUST_TARGET}-cc
-	@${PRINTF} '#!/bin/sh\nexec ${CXX} --sysroot=${WRKDIR} -mabi=elfv2 --target=${_RUST_LLVM_TRIPLE} -stdlib=libc++ "$$@"\n' \
-		> ${WRKDIR}/${_RUST_TARGET}-c++
-.elif ${FLAVOR} == powerpc
-	@bfd="$$(${ECHO_CMD} ${LOCALBASE}/bin/${_RUST_TARGET}*[0-9]-ld.bfd)"; \
-		${PRINTF} '#!/bin/sh\nexec ${CC} --sysroot=${WRKDIR} --target=${_RUST_LLVM_TRIPLE} -Wno-unused-command-line-argument -fuse-ld=%s "$$@"\n' "$${bfd}" \
-			> ${WRKDIR}/${_RUST_TARGET}-cc; \
-		${PRINTF} '#!/bin/sh\nexec ${CXX} --sysroot=${WRKDIR} --target=${_RUST_LLVM_TRIPLE} -Wno-unused-command-line-argument -fuse-ld=%s "$$@"\n' "$${bfd}" \
-			> ${WRKDIR}/${_RUST_TARGET}-c++
-.else
-	@${PRINTF} '#!/bin/sh\nexec ${CC} --sysroot=${WRKDIR} --target=${_RUST_LLVM_TRIPLE} "$$@"\n' \
-		> ${WRKDIR}/${_RUST_TARGET}-cc
-	@${PRINTF} '#!/bin/sh\nexec ${CXX} --sysroot=${WRKDIR} --target=${_RUST_LLVM_TRIPLE} -stdlib=libc++ "$$@"\n' \
-		> ${WRKDIR}/${_RUST_TARGET}-c++
-.endif
-	@${CHMOD} +x ${WRKDIR}/${_RUST_TARGET}-c*
-# sanity check cross compilers.  we cannot execute the result but
-# at least check that it can link a simple program before going further.
-	@${PRINTF} '#include <stdio.h>\nint main(){return printf("hello\\n");}' | ${WRKDIR}/${_RUST_TARGET}-cc -o ${WRKDIR}/test-c -xc -
-# produce some useful info for the build logs like what release/arch test-c is compiled for
-	@cd ${WRKDIR} && ${FILE} test-c && ${READELF} -A test-c
-	@${PRINTF} '#include <iostream>\nint main(){std::cout<<"hello"<<std::endl;return 0;}' | ${WRKDIR}/${_RUST_TARGET}-c++ -o ${WRKDIR}/test-c++ -xc++ -
 
 do-build:
 	@cd ${WRKSRC} && \
diff --git a/lang/rust-bootstrap/distinfo b/lang/rust-bootstrap/distinfo
index 1e004183dca8..b92fe56d5432 100644
--- a/lang/rust-bootstrap/distinfo
+++ b/lang/rust-bootstrap/distinfo
@@ -1,23 +1,3 @@
 TIMESTAMP = 1631002417
 SHA256 (rust/rustc-1.55.0-src.tar.xz) = aec85a7c1f40b7a40818a58ae13632f8a12cfaa4d3e2a10957d0e9d16dfdd556
 SIZE (rust/rustc-1.55.0-src.tar.xz) = 117197580
-SHA256 (rust/bootstrap/FreeBSD-12.2-RELEASE-arm64.tar.xz) = 3f82224fbcc6b2a2e1a1358cec5f32c0a08b5c5e6796e1a998369eb624a11cf3
-SIZE (rust/bootstrap/FreeBSD-12.2-RELEASE-arm64.tar.xz) = 158493712
-SHA256 (rust/bootstrap/FreeBSD-11.4-RELEASE-amd64.tar.xz) = 3bac8257bdd5e5b071f7b80cc591ebecd01b9314ca7839a2903096cbf82169f9
-SIZE (rust/bootstrap/FreeBSD-11.4-RELEASE-amd64.tar.xz) = 132075024
-SHA256 (rust/bootstrap/FreeBSD-11.4-RELEASE-arm-armv6.tar.xz) = 8a7c95aaac4fe9591f586fa274c1ffb9adba2e0f191a5a26f6222331a7ae0afb
-SIZE (rust/bootstrap/FreeBSD-11.4-RELEASE-arm-armv6.tar.xz) = 25605880
-SHA256 (rust/bootstrap/FreeBSD-12.2-RELEASE-arm-armv7.tar.xz) = b56bfaf0e9994723b2bb8c36b268ea1d0c6e9378c83211ed84ecca5c0a5420da
-SIZE (rust/bootstrap/FreeBSD-12.2-RELEASE-arm-armv7.tar.xz) = 70116512
-SHA256 (rust/bootstrap/FreeBSD-11.4-RELEASE-i386.tar.xz) = ae602552ff4c26f31b304e4a1ffc066db826e75d07ba9a4bf33649e9549bf27b
-SIZE (rust/bootstrap/FreeBSD-11.4-RELEASE-i386.tar.xz) = 110296208
-SHA256 (rust/bootstrap/FreeBSD-13.0-RELEASE-powerpc.tar.xz) = 8d980deacf7db15775445d00ce49b56a2a8eb519994052a92d2c6a40985910ab
-SIZE (rust/bootstrap/FreeBSD-13.0-RELEASE-powerpc.tar.xz) = 146274724
-SHA256 (rust/bootstrap/FreeBSD-12.2-RELEASE-powerpc64-elfv1.tar.xz) = 762ec55a9bd40dc93231e24f2df53c58d90b7cef63892b2740a59f9e8f40898e
-SIZE (rust/bootstrap/FreeBSD-12.2-RELEASE-powerpc64-elfv1.tar.xz) = 109121900
-SHA256 (rust/bootstrap/FreeBSD-12.2-RELEASE-powerpc64-elfv1-gcc9-9.3.0.tar.xz) = b1bd46b347e0ef55e8868537aaefe323622adf6fa081bef9ca5f24fc711d40ea
-SIZE (rust/bootstrap/FreeBSD-12.2-RELEASE-powerpc64-elfv1-gcc9-9.3.0.tar.xz) = 36842348
-SHA256 (rust/bootstrap/FreeBSD-13.0-CURRENT-powerpc64-elfv2-v1300123.tar.xz) = 0713b0c4bd3c19520714054b087d8f0d8dc7acc3610d8ae30df51ab07d566d92
-SIZE (rust/bootstrap/FreeBSD-13.0-CURRENT-powerpc64-elfv2-v1300123.tar.xz) = 75289700
-SHA256 (rust/bootstrap/FreeBSD-13.0-CURRENT-powerpc64le-r366300.tar.xz) = a828a3a968c9911655148fa080587ecd7673aa3d58588ed3dafa55a5c2e12dd3
-SIZE (rust/bootstrap/FreeBSD-13.0-CURRENT-powerpc64le-r366300.tar.xz) = 167748612



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