Update Rust program build script paths (#4707)

This commit is contained in:
Jack May 2019-06-17 14:24:00 -07:00 committed by GitHub
parent 5e8fcdbe1d
commit de3f7e9634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

1
sdk/bpf/.gitignore vendored
View File

@ -1,3 +1,4 @@
/dependencies/criterion*
/dependencies/llvm-native*
/dependencies/rust-bpf*
/dependencies/xargo*

View File

@ -9,9 +9,9 @@ if [ ! -f "$1/Cargo.toml" ]; then
exit 1
fi
cd "$(dirname "$0")"
pushd "$(dirname "$0")"
bpf_sdk="$PWD/.."
export XARGO_HOME="$PWD/../../../target/xargo"
popd
cd "$1"
@ -37,6 +37,7 @@ export RUSTFLAGS="
-C link-arg=-shared \
-C link-arg=--entry=entrypoint \
-C linker=$bpf_sdk/dependencies/llvm-native/bin/ld.lld"
export XARGO_HOME="$bpf_sdk/dependencies/xargo"
export XARGO_RUST_SRC="$bpf_sdk/dependencies/rust-bpf-sysroot/src"
xargo build --target bpfel-unknown-unknown --release -v

View File

@ -55,6 +55,7 @@ if [[ ! -f llvm-native-$machine-$version.md ]]; then
set -ex
rm -rf llvm-native*
rm -rf xargo
mkdir -p llvm-native
cd llvm-native
@ -81,6 +82,7 @@ if [[ ! -f rust-bpf-$machine-$version.md ]]; then
set -ex
rm -rf rust-bpf
rm -rf rust-bpf-$machine-*
rm -rf xargo
mkdir -p rust-bpf
pushd rust-bpf
@ -113,6 +115,7 @@ if [[ ! -f rust-bpf-sysroot-$version.md ]]; then
(
set -ex
rm -rf rust-bpf-sysroot*
rm -rf xargo
cmd="git clone --recursive --single-branch --branch $version https://github.com/solana-labs/rust-bpf-sysroot.git"
$cmd