svn commit: r528599 - in head/lang/rust: . files/powerpc64-elfv2
Piotr Kubaj
pkubaj at FreeBSD.org
Tue Mar 17 19:25:21 UTC 2020
Author: pkubaj
Date: Tue Mar 17 19:25:19 2020
New Revision: 528599
URL: https://svnweb.freebsd.org/changeset/ports/528599
Log:
lang/rust: fix build on powerpc64 elfv2
After upgrade to LLVM 10, core in stage 1 fails to compile (no clear reason, rustc crashes):
pid 26828 (rustc), jid 0, uid 0: exited on signal 11 (core dumped)
Compilation with GCC works fine, so switch to GCC for the time being.
PR: 244813
Approved by: mikael
Added:
head/lang/rust/files/powerpc64-elfv2/patch-src_bootstrap_native.rs (contents, props changed)
head/lang/rust/files/powerpc64-elfv2/patch-src_librustc__llvm_build.rs (contents, props changed)
Modified:
head/lang/rust/Makefile
Modified: head/lang/rust/Makefile
==============================================================================
--- head/lang/rust/Makefile Tue Mar 17 19:23:14 2020 (r528598)
+++ head/lang/rust/Makefile Tue Mar 17 19:25:19 2020 (r528599)
@@ -92,7 +92,7 @@ EXTRA_PATCHES+= ${PATCHDIR}/libgit2
EXTRA_PATCHES+= ${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX}
.endif
-.if ${ARCH} == powerpc64 && ${PPC_ABI} == ELFv1
+.if ${ARCH} == powerpc64
# The bootstrap is hardcoded to use gcc9
# but we can build with a newer or older compiler as provided by USE_GCC=yes
BUILD_DEPENDS+= gcc9:lang/gcc9
Added: head/lang/rust/files/powerpc64-elfv2/patch-src_bootstrap_native.rs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/lang/rust/files/powerpc64-elfv2/patch-src_bootstrap_native.rs Tue Mar 17 19:25:19 2020 (r528599)
@@ -0,0 +1,13 @@
+--- src/bootstrap/native.rs.orig 2019-11-04 15:45:21 UTC
++++ src/bootstrap/native.rs
+@@ -241,6 +241,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 {
Added: head/lang/rust/files/powerpc64-elfv2/patch-src_librustc__llvm_build.rs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/lang/rust/files/powerpc64-elfv2/patch-src_librustc__llvm_build.rs Tue Mar 17 19:25:19 2020 (r528599)
@@ -0,0 +1,18 @@
+--- src/librustc_llvm/build.rs.orig 2019-12-16 15:38:05 UTC
++++ src/librustc_llvm/build.rs
+@@ -273,7 +273,14 @@ fn main() {
+ };
+
+ // C++ runtime library
+- if !target.contains("msvc") {
++ if target == "powerpc64-unknown-freebsd" {
++ if is_crossed {
++ println!("cargo:rustc-link-search=native=%WRKDIR%/usr/local/lib/%CC%");
++ } else {
++ 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);
More information about the svn-ports-head
mailing list