2021-03-23 07:42:43 +01:00
|
|
|
# Once the bootstraps are available on pkg.FreeBSD.org run sync.sh
|
|
|
|
# to upload them to ~/public_distfiles on freefall in preparation
|
|
|
|
# for the next lang/rust update.
|
2020-02-25 19:18:26 +01:00
|
|
|
PORTNAME= rust
|
2021-05-04 08:05:04 +02:00
|
|
|
PORTVERSION= 1.52.1
|
2021-05-11 20:30:18 +02:00
|
|
|
PORTREVISION= 1
|
2020-02-25 19:18:26 +01:00
|
|
|
CATEGORIES= lang
|
|
|
|
MASTER_SITES= https://static.rust-lang.org/dist/:rust \
|
2020-10-28 11:49:15 +01:00
|
|
|
LOCAL/mikael:armbase \
|
|
|
|
LOCAL/mikael:base \
|
2020-10-13 10:36:35 +02:00
|
|
|
LOCAL/bdragon:ppc64lebase \
|
2020-02-25 19:18:26 +01:00
|
|
|
https://download.freebsd.org/ftp/${_RUST_FBSD_SUBDIR_${FLAVOR}}/:base \
|
2021-02-19 14:22:42 +01:00
|
|
|
LOCAL/mikael:powerpc64_gcc
|
|
|
|
# http://pkg.freebsd.org/FreeBSD:12:powerpc64/quarterly/All/gcc9-9.3.0_1.txz?dummy=/:powerpc64_gcc
|
2020-02-25 19:18:26 +01:00
|
|
|
PKGNAMESUFFIX= -bootstrap
|
|
|
|
DISTNAME= ${PORTNAME}c-${PORTVERSION}-src
|
|
|
|
DISTFILES= rust/${DISTNAME}${EXTRACT_SUFX}:rust \
|
|
|
|
${_RUST_FBSD_DIST_${FLAVOR}}
|
|
|
|
|
|
|
|
MAINTAINER= rust@FreeBSD.org
|
|
|
|
COMMENT= Create bootstrap compilers for building lang/rust
|
|
|
|
|
|
|
|
LICENSE= APACHE20 MIT
|
|
|
|
LICENSE_COMB= dual
|
|
|
|
LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE-APACHE
|
|
|
|
LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT
|
|
|
|
|
|
|
|
ONLY_FOR_ARCHS= amd64
|
|
|
|
ONLY_FOR_ARCHS_REASON= untested on other archs
|
|
|
|
|
|
|
|
BUILD_DEPENDS= cmake:devel/cmake \
|
|
|
|
gmake:devel/gmake \
|
|
|
|
rust>=${PORTVERSION}:lang/rust
|
|
|
|
|
2021-05-04 08:05:04 +02:00
|
|
|
FLAVORS= aarch64 amd64 armv6 armv7 i386 powerpc64_elfv1 powerpc64_elfv2 \
|
|
|
|
powerpc64le powerpc
|
2020-02-25 19:18:26 +01:00
|
|
|
FLAVOR?= ${FLAVORS:[1]}
|
|
|
|
|
|
|
|
aarch64_PKGNAMEPREFIX= aarch64-
|
2021-03-26 08:34:49 +01:00
|
|
|
aarch64_BUILD_DEPENDS= llvm90>0:devel/llvm90
|
2020-02-25 19:18:26 +01:00
|
|
|
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-
|
2020-10-13 10:36:35 +02:00
|
|
|
powerpc64le_PKGNAMEPREFIX= powerpc64le-
|
2021-05-04 08:05:04 +02:00
|
|
|
powerpc_PKGNAMEPREFIX= powerpc-
|
2021-05-14 13:25:17 +02:00
|
|
|
powerpc_BUILD_DEPENDS= powerpc-binutils>0:devel/binutils@powerpc
|
2020-02-25 19:18:26 +01:00
|
|
|
|
2021-04-06 09:23:13 +02:00
|
|
|
USES= ninja:build perl5 python:3.6+,build tar:xz
|
2020-02-25 19:18:26 +01:00
|
|
|
.if ${FLAVOR} == powerpc64_elfv1
|
2021-03-22 08:22:00 +01:00
|
|
|
USE_GCC= 9:build
|
2020-02-25 19:18:26 +01:00
|
|
|
.endif
|
|
|
|
# for openssl-src crate
|
|
|
|
USE_PERL5= build
|
2021-03-26 08:34:49 +01:00
|
|
|
.if ${FLAVOR} == aarch64
|
|
|
|
CC= clang90
|
|
|
|
CXX= clang++90
|
|
|
|
.endif
|
2020-02-25 19:18:26 +01:00
|
|
|
PATCHDIR= ${.CURDIR}/../rust/files
|
|
|
|
# Resulting packages are not specific to amd64
|
|
|
|
NO_ARCH= yes
|
|
|
|
|
|
|
|
_RUST_FBSD_DIST_aarch64= FreeBSD-${_RUST_FBSD_VER}-arm64${EXTRACT_SUFX}:base
|
|
|
|
_RUST_FBSD_DIST_amd64= FreeBSD-${_RUST_FBSD_VER}-amd64${EXTRACT_SUFX}:base
|
|
|
|
# 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}:armbase
|
|
|
|
_RUST_FBSD_DIST_armv7= FreeBSD-${_RUST_FBSD_VER}-arm-armv7${EXTRACT_SUFX}:armbase
|
|
|
|
_RUST_FBSD_DIST_i386= FreeBSD-${_RUST_FBSD_VER}-i386${EXTRACT_SUFX}:base
|
|
|
|
_RUST_FBSD_DIST_powerpc64_elfv1= FreeBSD-${_RUST_FBSD_VER}-powerpc64-elfv1${EXTRACT_SUFX}:base \
|
2021-02-19 14:22:42 +01:00
|
|
|
FreeBSD-${_RUST_FBSD_VER}-powerpc64-elfv1-gcc9-9.3.0${EXTRACT_SUFX}:powerpc64_gcc
|
2020-10-28 11:49:15 +01:00
|
|
|
_RUST_FBSD_DIST_powerpc64_elfv2= FreeBSD-${_RUST_FBSD_VER}-powerpc64-elfv2-v1300123${EXTRACT_SUFX}:base
|
2020-10-13 10:36:35 +02:00
|
|
|
_RUST_FBSD_DIST_powerpc64le= FreeBSD-${_RUST_FBSD_VER}-powerpc64le-r366300${EXTRACT_SUFX}:ppc64lebase
|
2021-05-04 08:05:04 +02:00
|
|
|
_RUST_FBSD_DIST_powerpc= FreeBSD-${_RUST_FBSD_VER}-powerpc${EXTRACT_SUFX}:base
|
2020-10-28 11:49:15 +01:00
|
|
|
_RUST_FBSD_VER= ${_RUST_FBSD_VER_${FLAVOR}:U11.4-RELEASE}
|
2021-02-19 14:22:42 +01:00
|
|
|
_RUST_FBSD_VER_aarch64= 12.2-RELEASE
|
|
|
|
_RUST_FBSD_VER_armv7= 12.2-RELEASE
|
|
|
|
_RUST_FBSD_VER_powerpc64_elfv1= 12.2-RELEASE
|
2020-02-25 19:18:26 +01:00
|
|
|
_RUST_FBSD_VER_powerpc64_elfv2= 13.0-CURRENT
|
2020-10-13 10:36:35 +02:00
|
|
|
_RUST_FBSD_VER_powerpc64le= 13.0-CURRENT
|
2021-05-04 08:05:04 +02:00
|
|
|
_RUST_FBSD_VER_powerpc= 13.0-RELEASE
|
2020-02-25 19:18:26 +01:00
|
|
|
_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=
|
2020-10-13 10:36:35 +02:00
|
|
|
_RUST_FBSD_SUBDIR_powerpc64le= snapshots/powerpc/powerpc64le/${_RUST_FBSD_VER}/base.txz?dummy=
|
2021-05-04 08:05:04 +02:00
|
|
|
_RUST_FBSD_SUBDIR_powerpc= releases/powerpc/powerpc/${_RUST_FBSD_VER}/base.txz?dummy=
|
2020-02-25 19:18:26 +01:00
|
|
|
|
|
|
|
_CARGO_VENDOR_DIR= ${WRKSRC}/vendor
|
|
|
|
_RUST_ARCH_amd64= x86_64
|
|
|
|
_RUST_ARCH_i386= i686
|
|
|
|
_RUST_ARCH_powerpc64_elfv1= powerpc64
|
|
|
|
_RUST_ARCH_powerpc64_elfv2= powerpc64
|
2020-10-13 10:36:35 +02:00
|
|
|
_RUST_ARCH_powerpc64le= powerpc64le
|
2021-05-04 08:05:04 +02:00
|
|
|
_RUST_ARCH_powerpc= powerpc
|
2020-02-25 19:18:26 +01:00
|
|
|
_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}}
|
|
|
|
_RUST_LLVM_TARGET_aarch64= AArch64
|
|
|
|
_RUST_LLVM_TARGET_amd64= X86
|
|
|
|
_RUST_LLVM_TARGET_armv6= ARM
|
|
|
|
_RUST_LLVM_TARGET_armv7= ARM
|
|
|
|
_RUST_LLVM_TARGET_i386= X86
|
|
|
|
_RUST_LLVM_TARGET_powerpc64_elfv1= PowerPC
|
|
|
|
_RUST_LLVM_TARGET_powerpc64_elfv2= PowerPC
|
2020-10-13 10:36:35 +02:00
|
|
|
_RUST_LLVM_TARGET_powerpc64le= PowerPC
|
2021-05-04 08:05:04 +02:00
|
|
|
_RUST_LLVM_TARGET_powerpc= PowerPC
|
2020-02-25 19:18:26 +01:00
|
|
|
_RUST_LLVM_TRIPLE= ${_RUST_LLVM_TRIPLE_${FLAVOR}:U${_RUST_TARGET}}
|
|
|
|
_RUST_LLVM_TRIPLE_armv6= armv6-gnueabihf-freebsd
|
|
|
|
_RUST_LLVM_TRIPLE_armv7= armv7-gnueabihf-freebsd
|
2021-05-04 08:05:04 +02:00
|
|
|
_RUST_LLVM_TRIPLE_powerpc= powerpc-unknown-freebsd13.0 # secure-plt
|
2020-02-25 19:18:26 +01:00
|
|
|
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
|
|
|
.if ${OPSYS} != FreeBSD
|
|
|
|
IGNORE= is only for FreeBSD
|
|
|
|
.elif ${OSVERSION} < 1200502
|
|
|
|
IGNORE= will not build on 12.0 due to old toolchain; 11.x untested
|
|
|
|
.endif
|
2020-11-01 09:06:42 +01:00
|
|
|
.if ${FLAVOR} == powerpc64le && ${OSVERSION} < 1300116
|
|
|
|
IGNORE= will not build on 12.x due to old system
|
|
|
|
.endif
|
2020-02-25 19:18:26 +01:00
|
|
|
|
|
|
|
.if exists(${PATCHDIR}/${FLAVOR:S/_/-/})
|
|
|
|
EXTRA_PATCHES+= ${PATCHDIR}/${FLAVOR:S/_/-/}
|
|
|
|
.endif
|
|
|
|
|
2021-05-11 18:56:40 +02:00
|
|
|
.if make(makesum)
|
|
|
|
DISTFILES:= ${DISTFILES:M*\:rust} \
|
|
|
|
${FLAVORS:O:@_flavor@${:!${SETENV} FLAVOR=${_flavor} ${MAKE} -V'DISTFILES:N*\:rust'!}@}
|
|
|
|
.endif
|
|
|
|
|
2020-02-25 19:18:26 +01:00
|
|
|
post-patch:
|
|
|
|
# Disable vendor checksums
|
|
|
|
@${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \
|
|
|
|
${_CARGO_VENDOR_DIR}/*/.cargo-checksum.json
|
|
|
|
.if ${FLAVOR} == powerpc64_elfv1
|
|
|
|
@${REINPLACE_CMD} -e 's,"c++","stdc++",g' \
|
2020-11-27 18:05:22 +01:00
|
|
|
${WRKSRC}/compiler/rustc_llvm/build.rs
|
2020-02-25 19:18:26 +01:00
|
|
|
@${REINPLACE_CMD} -e 's,%CC%,${CC},g' \
|
|
|
|
-e 's,%WRKDIR%,${WRKDIR},g' \
|
2020-11-27 18:05:22 +01:00
|
|
|
${WRKSRC}/compiler/rustc_llvm/build.rs \
|
2020-02-25 19:18:26 +01:00
|
|
|
${WRKSRC}/src/bootstrap/native.rs
|
2021-05-14 13:02:43 +02:00
|
|
|
.endif
|
2020-02-25 19:18:26 +01:00
|
|
|
|
|
|
|
do-configure:
|
|
|
|
# Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64
|
|
|
|
@${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \
|
|
|
|
${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh
|
|
|
|
@${ECHO_CMD} '[build]' > ${WRKSRC}/config.toml
|
|
|
|
@${ECHO_CMD} 'vendor=true' >> ${WRKSRC}/config.toml
|
|
|
|
@${ECHO_CMD} 'extended=false' >> ${WRKSRC}/config.toml
|
|
|
|
@${ECHO_CMD} 'python="${PYTHON_CMD}"' >> ${WRKSRC}/config.toml
|
|
|
|
@${ECHO_CMD} 'docs=false' >> ${WRKSRC}/config.toml
|
|
|
|
@${ECHO_CMD} 'verbose=2' >> ${WRKSRC}/config.toml
|
|
|
|
@${ECHO_CMD} 'cargo-native-static=true' >> ${WRKSRC}/config.toml
|
|
|
|
@${ECHO_CMD} 'cargo="${LOCALBASE}/bin/cargo"' >> ${WRKSRC}/config.toml
|
|
|
|
@${ECHO_CMD} 'rustc="${LOCALBASE}/bin/rustc"' >> ${WRKSRC}/config.toml
|
|
|
|
.if ${_RUST_HOST} != ${_RUST_TARGET}
|
|
|
|
@${ECHO_CMD} 'host=["${_RUST_HOST}","${_RUST_TARGET}"]' >> ${WRKSRC}/config.toml
|
|
|
|
@${ECHO_CMD} 'target=["${_RUST_TARGET}"]' >> ${WRKSRC}/config.toml
|
|
|
|
.endif
|
|
|
|
@${ECHO_CMD} '[rust]' >> ${WRKSRC}/config.toml
|
|
|
|
@${ECHO_CMD} 'channel="stable"' >> ${WRKSRC}/config.toml
|
|
|
|
@${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml
|
2020-03-12 20:39:24 +01:00
|
|
|
@${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml
|
2020-02-25 19:18:26 +01:00
|
|
|
@${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml
|
|
|
|
@${ECHO_CMD} 'link-shared=false' >> ${WRKSRC}/config.toml
|
|
|
|
.if ${FLAVOR} == powerpc64_elfv1
|
|
|
|
@${ECHO_CMD} 'static-libstdcpp=true' >> ${WRKSRC}/config.toml
|
|
|
|
.endif
|
|
|
|
.if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE)
|
|
|
|
@${ECHO_CMD} 'ccache="${CCACHE_BIN}"' >> ${WRKSRC}/config.toml
|
|
|
|
.else
|
|
|
|
@${ECHO_CMD} 'ccache=false' >> ${WRKSRC}/config.toml
|
|
|
|
.endif
|
lang/rust-bootstrap: Unbreak build
error: linking with `/wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/aarch64-unknown-freebsd-cc` failed: exit code: 1
|
= note: "/wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/aarch64-unknown-freebsd-cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-Wl,--eh-frame-hdr" "-L" "/wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1/lib/rustlib/aarch64-unknown-freebsd/lib" "/wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1-rustc/aarch64-unknown-freebsd/release/deps/rustc_binary-aee2141e03185e53.rustc_binary.b5znfnzc-cgu.0.rcgu.o" "/wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1-rustc/aarch64-unknown-freebsd/release/deps/rustc_binary-aee2141e03185e53.rustc_binary.b5znfnzc-cgu.1.rcgu.o" "-o" "/wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1-rustc/aarch64-unknown-freebsd/release/deps/rustc_binary-aee2141e03185e53" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1-rustc/aarch64-unknown-freebsd/release/deps" "-L" "/wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1-rustc/release/deps" "-L" "/wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1-rustc/aarch64-unknown-freebsd/release/build/psm-b70dc38335c8633c/out" "-L" "/wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1-rustc/aarch64-unknown-freebsd/release/build/rustc_llvm-2e64396678b51f1b/out" "-L" "/wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/aarch64-unknown-freebsd/llvm/build/lib" "-L" "/wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1/lib/rustlib/aarch64-unknown-freebsd/lib" "-L" "/wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1-rustc/aarch64-unknown-freebsd/release/deps" "-lrustc_driver-92f05a38b6344bea" "-Wl,--start-group" "-L" "/wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1/lib/rustlib/aarch64-unknown-freebsd/lib" "-lstd-1f5c5da87793947f" "-Wl,--end-group" "-Wl,-Bstatic" "/wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1/lib/rustlib/aarch64-unknown-freebsd/lib/libcompiler_builtins-8365ea7481741727.rlib" "-Wl,-Bdynamic" "-lc++" "-lutil" "-lutil" "-lexecinfo" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil" "-Wl,-rpath,$ORIGIN/../lib"
= note: ld: error: /wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1-rustc/aarch64-unknown-freebsd/release/deps/librustc_driver-92f05a38b6344bea.so: undefined reference to compress2 [--no-allow-shlib-undefined]
ld: error: /wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1-rustc/aarch64-unknown-freebsd/release/deps/librustc_driver-92f05a38b6344bea.so: undefined reference to compressBound [--no-allow-shlib-undefined]
ld: error: /wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1-rustc/aarch64-unknown-freebsd/release/deps/librustc_driver-92f05a38b6344bea.so: undefined reference to crc32 [--no-allow-shlib-undefined]
ld: error: /wrkdirs/usr/ports/lang/rust-bootstrap/work-aarch64/rustc-1.46.0-src/build/x86_64-unknown-freebsd/stage1-rustc/aarch64-unknown-freebsd/release/deps/librustc_driver-92f05a38b6344bea.so: undefined reference to uncompress [--no-allow-shlib-undefined]
cc: error: linker command failed with exit code 1 (use -v to see invocation)
2020-09-02 20:15:58 +02:00
|
|
|
# https://github.com/rust-lang/rust/pull/72696#issuecomment-641517185
|
|
|
|
@${ECHO_CMD} 'ldflags="-lz"' >> ${WRKSRC}/config.toml
|
2020-02-25 19:18:26 +01:00
|
|
|
# we need to make sure to always build llvm with X86 support to get a
|
|
|
|
# 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
|
|
|
|
.for _key _util in ar ${AR} ranlib ${RANLIB}
|
|
|
|
@bin="$$(which ${_util})"; \
|
|
|
|
${ECHO_CMD} "${_key}=\"$$bin\"" >> ${WRKSRC}/config.toml
|
|
|
|
.endfor
|
|
|
|
.if ${_RUST_HOST} != ${_RUST_TARGET}
|
|
|
|
@${ECHO_CMD} '[target.${_RUST_HOST}]' >> ${WRKSRC}/config.toml
|
|
|
|
@${ECHO_CMD} 'cc="${CC}"' >> ${WRKSRC}/config.toml
|
|
|
|
@${ECHO_CMD} 'cxx="${CXX}"' >> ${WRKSRC}/config.toml
|
|
|
|
@${ECHO_CMD} 'linker="${CC}"' >> ${WRKSRC}/config.toml
|
|
|
|
.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++
|
2021-05-14 13:25:17 +02:00
|
|
|
.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++
|
2020-02-25 19:18:26 +01:00
|
|
|
.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} && \
|
|
|
|
${SETENV} ${MAKE_ENV} ${PYTHON_CMD} x.py dist --jobs=${MAKE_JOBS_NUMBER} \
|
2020-10-14 09:52:54 +02:00
|
|
|
cargo src/librustc library/std
|
2020-02-25 19:18:26 +01:00
|
|
|
|
|
|
|
do-install:
|
2020-06-19 20:53:57 +02:00
|
|
|
@${MKDIR} ${STAGEDIR}${PREFIX}/rust-bootstrap/${FLAVOR}
|
2020-11-22 18:20:27 +01:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/build/dist/*-${_RUST_ARCH_${FLAVOR}:U${FLAVOR}}-unknown-${OPSYS:tl}${EXTRACT_SUFX} \
|
2020-06-19 20:53:57 +02:00
|
|
|
${STAGEDIR}${PREFIX}/rust-bootstrap/${FLAVOR}
|
2020-02-25 19:18:26 +01:00
|
|
|
.if ${FLAVOR:Mpowerpc64_*}
|
2020-06-19 20:53:57 +02:00
|
|
|
@cd ${STAGEDIR}${PREFIX}/rust-bootstrap/${FLAVOR} && for f in *${EXTRACT_SUFX}; do \
|
2020-02-25 19:18:26 +01:00
|
|
|
${MV} $$f $${f%%${EXTRACT_SUFX}}-${FLAVOR:S/_/ /:[2]}${EXTRACT_SUFX}; \
|
|
|
|
done
|
|
|
|
.endif
|
|
|
|
@cd ${STAGEDIR}${PREFIX} && \
|
|
|
|
${FIND} rust-bootstrap -type f >> ${TMPPLIST}
|
|
|
|
|
|
|
|
.include <bsd.port.post.mk>
|