rust.guncellendi

This commit is contained in:
milisbir 2017-09-05 10:40:15 +03:00
parent 45f935e831
commit 5a15f63cfe
3 changed files with 47 additions and 11 deletions

View File

@ -0,0 +1,32 @@
From 5dbc650a60ddb230f59e5a18ffd298b033566945 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= <johannes@kyriasis.com>
Date: Thu, 20 Jul 2017 23:07:01 +0200
Subject: [PATCH] librustc_llvm/build: Force link against libffi
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
`llvm-config --libs` doesn't output libffi in many cases. Fixing it
turned out to take quite a bit of effort, so force libffi linking in
here for now.
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
---
src/librustc_llvm/build.rs | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
index 3f0f536960..7dc0c40c9d 100644
--- a/src/librustc_llvm/build.rs
+++ b/src/librustc_llvm/build.rs
@@ -220,6 +220,7 @@ fn main() {
};
println!("cargo:rustc-link-lib={}={}", kind, name);
}
+ println!("cargo:rustc-link-lib=dylib=ffi");
// LLVM ldflags
//
--
2.13.3

View File

@ -0,0 +1,5 @@
[install]
prefix = "/usr"
[rust]
channel = "stable"

View File

@ -6,20 +6,19 @@
name=rust
version=1.20.0
release=1
source=(http://static.rust-lang.org/dist/rustc-$version-src.tar.gz)
source=(http://static.rust-lang.org/dist/rustc-$version-src.tar.gz
0001-librustc_llvm-build-Force-link-against-libffi.patch
bootstrap-config.toml)
build() {
cd rustc-$version-src
cd ${name}c-$version-src
./configure --prefix=/usr \
--release-channel=stable \
--disable-docs \
--enable-ccache
make CFLAGS=" -fPIC -w"
make DESTDIR=$PKG install
patch -p1 -i $SRC/0001-librustc_llvm-build-Force-link-against-libffi.patch
cp $SRC/bootstrap-config.toml config.toml
cd "$PKG/usr/lib"
rm rustlib/{components,manifest-rustc,rust-installer-version}
ln -sf rustlib/x86_64-unknown-linux-gnu/lib/*.so .
/usr/bin/python ./x.py build --verbose
DESTDIR=$PKG /usr/bin/python ./x.py install
rm -r $PKG/usr/lib/rustlib/{components,manifest-rustc,rust-installer-version}
rm -r $PKG/usr/share/doc
}