rust ndk-sysroot
This commit is contained in:
parent
9ce89eef41
commit
746eb90bfc
@ -2,7 +2,6 @@ TERMUX_PKG_HOMEPAGE=https://developer.android.com/tools/sdk/ndk/index.html
|
||||
TERMUX_PKG_DESCRIPTION="System header and library files from the Android NDK needed for compiling C programs"
|
||||
TERMUX_PKG_LICENSE="NCSA"
|
||||
TERMUX_PKG_VERSION=$TERMUX_NDK_VERSION
|
||||
TERMUX_PKG_REVISION=8
|
||||
TERMUX_PKG_SKIP_SRC_EXTRACT=true
|
||||
# This package has taken over <pty.h> from the previous libutil-dev
|
||||
# and iconv.h from libandroid-support-dev:
|
||||
@ -18,8 +17,8 @@ termux_step_extract_into_massagedir() {
|
||||
$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include
|
||||
|
||||
patch -d $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include/c++/v1 -p1 < $TERMUX_PKG_BUILDER_DIR/math-header.diff
|
||||
|
||||
patch -d $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/ -p1 < $TERMUX_PKG_BUILDER_DIR/gcc_fixes.diff
|
||||
# disable for now
|
||||
# patch -d $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/ -p1 < $TERMUX_PKG_BUILDER_DIR/gcc_fixes.diff
|
||||
|
||||
cp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/*.o \
|
||||
$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib
|
||||
|
15
packages/rust/PassWrapper.cpp.patch
Normal file
15
packages/rust/PassWrapper.cpp.patch
Normal file
@ -0,0 +1,15 @@
|
||||
--- ./src/rustllvm/PassWrapper.cpp.orig 2020-05-08 10:36:00.588540136 +0000
|
||||
+++ ./src/rustllvm/PassWrapper.cpp 2020-05-08 10:36:07.988661914 +0000
|
||||
@@ -67,7 +67,11 @@
|
||||
}
|
||||
|
||||
extern "C" void LLVMTimeTraceProfilerInitialize() {
|
||||
-#if LLVM_VERSION_GE(9, 0)
|
||||
+#if LLVM_VERSION_GE(10, 0)
|
||||
+ timeTraceProfilerInitialize(
|
||||
+ /* TimeTraceGranularity */ 0,
|
||||
+ /* ProcName */ "rustc");
|
||||
+#elif LLVM_VERSION_GE(9, 0)
|
||||
timeTraceProfilerInitialize();
|
||||
#endif
|
||||
}
|
17
packages/rust/RustWrapper.cpp.patch
Normal file
17
packages/rust/RustWrapper.cpp.patch
Normal file
@ -0,0 +1,17 @@
|
||||
--- ./src/rustllvm/RustWrapper.cpp.orig 2020-05-08 10:35:50.338371466 +0000
|
||||
+++ ./src/rustllvm/RustWrapper.cpp 2020-05-08 10:36:14.268765241 +0000
|
||||
@@ -1328,8 +1328,13 @@
|
||||
LLVMValueRef Dst, unsigned DstAlign,
|
||||
LLVMValueRef Val,
|
||||
LLVMValueRef Size, bool IsVolatile) {
|
||||
+#if LLVM_VERSION_GE(10, 0)
|
||||
return wrap(unwrap(B)->CreateMemSet(
|
||||
- unwrap(Dst), unwrap(Val), unwrap(Size), DstAlign, IsVolatile));
|
||||
+ unwrap(Dst), unwrap(Val), unwrap(Size), MaybeAlign(DstAlign), IsVolatile));
|
||||
+#else
|
||||
+ return wrap(unwrap(B)->CreateMemSet( return wrap(unwrap(B)->CreateMemSet(
|
||||
+ unwrap(Dst), unwrap(Val), unwrap(Size), DstAlign, IsVolatile)); unwrap(Dst), unwrap(Val), unwrap(Size), DstAlign, IsVolatile));
|
||||
+#endif
|
||||
}
|
||||
|
||||
extern "C" LLVMValueRef
|
@ -3,7 +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.43.1
|
||||
TERMUX_PKG_REVISION=4
|
||||
TERMUX_PKG_REVISION=5
|
||||
TERMUX_PKG_SRCURL=https://static.rust-lang.org/dist/rustc-$TERMUX_PKG_VERSION-src.tar.xz
|
||||
TERMUX_PKG_SHA256=eb0a103c67c4565403d9e6f84a1c708982a5e9e5b3c0d831e4d6f6451795d106
|
||||
TERMUX_PKG_DEPENDS="libc++, clang, openssl, lld, zlib, libllvm"
|
||||
@ -44,7 +44,7 @@ termux_step_configure() {
|
||||
export CFLAGS_x86_64_unknown_linux_gnu="-O2"
|
||||
unset CC CXX CPP LD CFLAGS CXXFLAGS CPPFLAGS LDFLAGS PKG_CONFIG AR RANLIB
|
||||
# we can't use -L$PREFIX/lib since it breaks things but we need to link against libLLVM-9.so
|
||||
ln -sf $PREFIX/lib/libLLVM-9.0.1.so $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/
|
||||
ln -sf $PREFIX/lib/libLLVM-10.0.0.so $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/
|
||||
|
||||
# rust checks libs in PREFIX/lib because both host and target are x86_64. It then can't find libc.so and libdl.so because rust program doesn't
|
||||
# know where those are. Putting them temporarly in $PREFIX/lib prevents that failure
|
||||
@ -60,9 +60,8 @@ termux_step_make() {
|
||||
return 0;
|
||||
}
|
||||
termux_step_make_install() {
|
||||
$TERMUX_PKG_SRCDIR/x.py dist librustc --host $CARGO_TARGET_NAME --target $CARGO_TARGET_NAME --target wasm32-unknown-unknown
|
||||
$TERMUX_PKG_SRCDIR/x.py dist rustc-dev --host $CARGO_TARGET_NAME --target $CARGO_TARGET_NAME --target wasm32-unknown-unknown
|
||||
$TERMUX_PKG_SRCDIR/x.py install --stage 2 --host $CARGO_TARGET_NAME --target $CARGO_TARGET_NAME --target wasm32-unknown-unknown
|
||||
$TERMUX_PKG_SRCDIR/x.py install --stage 2 --host $CARGO_TARGET_NAME --target $CARGO_TARGET_NAME --target wasm32-unknown-unknown || bash
|
||||
$TERMUX_PKG_SRCDIR/x.py dist rustc-dev --host $CARGO_TARGET_NAME --target $CARGO_TARGET_NAME --target wasm32-unknown-unknown || bash
|
||||
tar xvf build/dist/rustc-dev-$TERMUX_PKG_VERSION-$CARGO_TARGET_NAME.tar.gz
|
||||
./rustc-dev-$TERMUX_PKG_VERSION-$CARGO_TARGET_NAME/install.sh --prefix=$TERMUX_PREFIX
|
||||
|
||||
@ -82,7 +81,7 @@ termux_step_make_install() {
|
||||
rust-installer-version \
|
||||
manifest-* \
|
||||
x86_64-unknown-linux-gnu
|
||||
rm $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/libLLVM-9.0.1.so
|
||||
rm $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/libLLVM-10.0.0.so
|
||||
|
||||
}
|
||||
termux_step_post_massage() {
|
||||
|
@ -29,7 +29,7 @@ channel = "stable"
|
||||
rpath = false
|
||||
|
||||
[target.x86_64-unknown-linux-gnu]
|
||||
llvm-config = "/usr/bin/llvm-config-9"
|
||||
llvm-config = "/usr/bin/llvm-config-10"
|
||||
|
||||
[target.@triple@]
|
||||
android-ndk = "@TERMUX_STANDALONE_TOOLCHAIN@"
|
||||
|
Loading…
Reference in New Issue
Block a user