Browse Source

rust: Avoid linking against libstdc++

All C++ code should link against libc++_shared to avoid mixing C++
standard library issues.

This fixes librustc_codegen_llvm-llvm.so to do that.
android-5
Fredrik Fornwall 6 years ago
parent
commit
c4887811c4
  1. 1
      packages/rust/build.sh
  2. 12
      packages/rust/src-librustc_llvm-build.rs.patch

1
packages/rust/build.sh

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Systems programming language focused on safety, speed an
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="Kevin Cotugno @kcotugno"
TERMUX_PKG_VERSION=1.34.1
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=e0efb1e6aba0d4900de57bd2db64e32e7c5b440a95a675d5303839c9a2c3328f
TERMUX_PKG_SRCURL=https://static.rust-lang.org/dist/rustc-$TERMUX_PKG_VERSION-src.tar.xz
TERMUX_PKG_DEPENDS="clang, openssl, lld, zlib"

12
packages/rust/src-librustc_llvm-build.rs.patch

@ -0,0 +1,12 @@
diff -u -r ../rustc-1.34.1-src/src/librustc_llvm/build.rs ./src/librustc_llvm/build.rs
--- ../rustc-1.34.1-src/src/librustc_llvm/build.rs 2019-04-24 21:07:08.000000000 +0000
+++ ./src/librustc_llvm/build.rs 2019-05-05 20:56:34.090330174 +0000
@@ -244,6 +244,8 @@
"c++"
} else if target.contains("darwin") {
"c++"
+ } else if target.contains("android") {
+ "c++_shared"
} else if target.contains("netbsd") && llvm_static_stdcpp.is_some() {
// NetBSD uses a separate library when relocation is required
"stdc++_pic"
Loading…
Cancel
Save