Changeset View
Changeset View
Standalone View
Standalone View
lang/rust/Makefile
Context not available. | |||||
# ?= to allow users to still overwrite it in make.conf. | # ?= to allow users to still overwrite it in make.conf. | ||||
TMPDIR?= ${WRKDIR} | TMPDIR?= ${WRKDIR} | ||||
OPTIONS_DEFINE= DOCS GDB SOURCES WASM | OPTIONS_DEFINE= DOCS GDB PORT_LLVM SOURCES WASM | ||||
OPTIONS_DEFAULT= SOURCES WASM | OPTIONS_DEFAULT= SOURCES WASM | ||||
OPTIONS_EXCLUDE_armv6= DOCS | OPTIONS_EXCLUDE_armv6= DOCS | ||||
GDB_DESC= Install ports gdb (necessary for debugging rust programs) | GDB_DESC= Install ports gdb (necessary for debugging rust programs) | ||||
PORT_LLVM_DESC= Build against devel/llvm${LLVM_VER} (experimental) | |||||
SOURCES_DESC= Install source files | SOURCES_DESC= Install source files | ||||
WASM_DESC= Build the WebAssembly target (wasm32-unknown-unknown) | WASM_DESC= Build the WebAssembly target (wasm32-unknown-unknown) | ||||
DOCS_VARS= _RUST_BUILD_DOCS=true | DOCS_VARS= _RUST_BUILD_DOCS=true | ||||
DOCS_VARS_OFF= _RUST_BUILD_DOCS=false | DOCS_VARS_OFF= _RUST_BUILD_DOCS=false | ||||
GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb | GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb | ||||
LLVM_VER= 13 # chase bundled LLVM | |||||
PORT_LLVM_BUILD_DEPENDS=llvm-config${LLVM_VER}:devel/llvm${LLVM_VER} | |||||
PORT_LLVM_LIB_DEPENDS= libLLVM-${LLVM_VER}.so:devel/llvm${LLVM_VER} | |||||
PORT_LLVM_VARS= MAKE_ENV+=RUSTFLAGS="-Lnative=${LOCALBASE}/lib" | |||||
tobik: PORT_LLVM_MAKE_ENV | |||||
SOURCES_VARS= _RUST_TOOLS+=src | SOURCES_VARS= _RUST_TOOLS+=src | ||||
WASM_VARS= _RUST_BUILD_WASM=true \ | WASM_VARS= _RUST_BUILD_WASM=true \ | ||||
_RUST_TARGETS+=wasm32-unknown-unknown | _RUST_TARGETS+=wasm32-unknown-unknown | ||||
Not Done Inline ActionsThese are small patches. IMHO it's clearer if you just copy them to files/ tobik: These are small patches. IMHO it's clearer if you just copy them to `files/` | |||||
Done Inline ActionsNot only do these need to be applied before anything in ${PATCHDIR}, but these are incorporated in more recent nightlies and the just-released 1.73.0. vishwin: Not only do these need to be applied before anything in `${PATCHDIR}`, but these are… | |||||
Context not available. | |||||
.endif | .endif | ||||
.endif | .endif | ||||
post-patch-PORT_LLVM-on: | |||||
# ld error: can't create dynamic relocation R_X86_64_32 against | |||||
# local symbol in readonly segment; recompile object files with | |||||
# -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output | |||||
# (-no-pie is not needed when both base and ports were built as PIE) | |||||
${REINPLACE_CMD} 's|"-pie"|"-no-pie"|' \ | |||||
${WRKSRC}/compiler/rustc_codegen_ssa/src/back/linker.rs | |||||
# WASM target hardcodes bundled lld | |||||
${REINPLACE_CMD} 's|"rust-lld"|"wasm-ld${LLVM_VER}"|' \ | |||||
${WRKSRC}/compiler/rustc_target/src/spec/wasm_base.rs | |||||
do-configure: | do-configure: | ||||
tobikUnsubmitted Done Inline Actionsmissing blank line tobik: missing blank line | |||||
# Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 | # Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 | ||||
@${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ | @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ | ||||
Done Inline ActionsCan you match the existing style (dedent comment and silence ${REINPLACE_CMD})? tobik: Can you match the existing style (dedent comment and silence ${REINPLACE_CMD})? | |||||
Context not available. | |||||
@${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml | ||||
.if !${PORT_OPTIONS:MPORT_LLVM} | |||||
@${ECHO_CMD} 'lld=${_RUST_BUILD_WASM}' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'lld=${_RUST_BUILD_WASM}' >> ${WRKSRC}/config.toml | ||||
.endif | |||||
@${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml | @${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml | ||||
.if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE) | .if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE) | ||||
@${ECHO_CMD} 'ccache="${CCACHE_BIN}"' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'ccache="${CCACHE_BIN}"' >> ${WRKSRC}/config.toml | ||||
Done Inline ActionsI don't think _RUST_BUILD_WASM is needed anymore. Why not make the conditional clearer with something like this .if ${PORT_OPTIONS:MWASM} && !${PORT_OPTIONS:MPORT_LLVM} @${ECHO_CMD} 'lld=true' >> ${WRKSRC}/config.toml .else @${ECHO_CMD} 'lld=false' >> ${WRKSRC}/config.toml .endif tobik: I don't think _RUST_BUILD_WASM is needed anymore. Why not make the conditional clearer with… | |||||
Context not available. | |||||
.else | .else | ||||
@${ECHO_CMD} 'linker="${CC}"' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'linker="${CC}"' >> ${WRKSRC}/config.toml | ||||
.endif | .endif | ||||
.if ${PORT_OPTIONS:MPORT_LLVM} | |||||
@${ECHO_CMD} 'llvm-config="${LOCALBASE}/bin/llvm-config${LLVM_VER}"' >> ${WRKSRC}/config.toml | |||||
.endif | |||||
.endfor | .endfor | ||||
@${ECHO_CMD} '[dist]' >> ${WRKSRC}/config.toml | @${ECHO_CMD} '[dist]' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml | ||||
Context not available. |
PORT_LLVM_MAKE_ENV