Re-org SDK dir (#4690)

This commit is contained in:
Jack May 2019-06-17 11:04:38 -07:00 committed by GitHub
parent 5bf87de136
commit 2a7a9fdf03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 40 additions and 40 deletions

View File

@ -26,7 +26,7 @@ test -d target/release/bpf && find target/release/bpf -name '*.d' -delete
# Clear the BPF sysroot files, they are not automatically rebuilt # Clear the BPF sysroot files, they are not automatically rebuilt
rm -rf target/xargo # Issue #3105 rm -rf target/xargo # Issue #3105
# Run tbe appropriate test based on entrypoint # Run the appropriate test based on entrypoint
testName=$(basename "$0" .sh) testName=$(basename "$0" .sh)
case $testName in case $testName in
test-stable) test-stable)

View File

@ -1,2 +1,2 @@
BPF_SDK := ../../../sdk/bpf BPF_SDK := ../../../sdk/bpf/c
include $(BPF_SDK)/bpf.mk include $(BPF_SDK)/bpf.mk

View File

@ -12,7 +12,7 @@ homepage = "https://solana.com/"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
solana-sdk-bpf-utils = { path = "../../../../sdk/bpf/rust-utils", version = "0.16.0" } solana-sdk-bpf-utils = { path = "../../../../sdk/bpf/rust/rust-utils", version = "0.16.0" }
[workspace] [workspace]
members = [] members = []

View File

@ -1,6 +1,6 @@
[dependencies.compiler_builtins] [dependencies.compiler_builtins]
path = "../../../../sdk/bpf/rust-bpf-sysroot/src/compiler-builtins" path = "../../../../sdk/bpf/dependencies/rust-bpf-sysroot/src/compiler-builtins"
features = ["c", "mem"] features = ["c", "mem"]
[target.bpfel-unknown-unknown.dependencies] [target.bpfel-unknown-unknown.dependencies]
alloc = { path = "../../../../sdk/bpf/rust-bpf-sysroot/src/liballoc" } alloc = { path = "../../../../sdk/bpf/dependencies/rust-bpf-sysroot/src/liballoc" }

View File

@ -3,10 +3,10 @@
if [ "$#" -ne 1 ]; then if [ "$#" -ne 1 ]; then
# Build all projects # Build all projects
for project in */ ; do for project in */ ; do
./../../../sdk/bpf/rust-utils/build.sh "$PWD/$project" ./../../../sdk/bpf/rust/build.sh "$PWD/$project"
done done
else else
# Build requested project # Build requested project
./../../../sdk/bpf/rust-utils/build.sh "$PWD/$1" ./../../../sdk/bpf/rust/build.sh "$PWD/$1"
fi fi

View File

@ -3,10 +3,10 @@
if [ "$#" -ne 1 ]; then if [ "$#" -ne 1 ]; then
# Clean all projects # Clean all projects
for project in */ ; do for project in */ ; do
./../../../sdk/bpf/rust-utils/clean.sh "$PWD/$project" ./../../../sdk/bpf/rust/clean.sh "$PWD/$project"
done done
else else
# Clean requested project # Clean requested project
./../../../sdk/bpf/rust-utils/clean.sh "$PWD/$1" ./../../../sdk/bpf/rust/clean.sh "$PWD/$1"
fi fi

View File

@ -13,7 +13,7 @@ edition = "2018"
[dependencies] [dependencies]
byteorder = { version = "1", default-features = false } byteorder = { version = "1", default-features = false }
solana-sdk-bpf-utils = { path = "../../../../sdk/bpf/rust-utils", version = "0.16.0" } solana-sdk-bpf-utils = { path = "../../../../sdk/bpf/rust/rust-utils", version = "0.16.0" }
[workspace] [workspace]
members = [] members = []

View File

@ -1,6 +1,6 @@
[dependencies.compiler_builtins] [dependencies.compiler_builtins]
path = "../../../../sdk/bpf/rust-bpf-sysroot/src/compiler-builtins" path = "../../../../sdk/bpf/dependencies/rust-bpf-sysroot/src/compiler-builtins"
features = ["c", "mem"] features = ["c", "mem"]
[target.bpfel-unknown-unknown.dependencies] [target.bpfel-unknown-unknown.dependencies]
alloc = { path = "../../../../sdk/bpf/rust-bpf-sysroot/src/liballoc" } alloc = { path = "../../../../sdk/bpf/dependencies/rust-bpf-sysroot/src/liballoc" }

View File

@ -12,7 +12,7 @@ homepage = "https://solana.com/"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
solana-sdk-bpf-utils = { path = "../../../../sdk/bpf/rust-utils", version = "0.16.0" } solana-sdk-bpf-utils = { path = "../../../../sdk/bpf/rust/rust-utils", version = "0.16.0" }
[workspace] [workspace]
members = [] members = []

View File

@ -1,6 +1,6 @@
[dependencies.compiler_builtins] [dependencies.compiler_builtins]
path = "../../../../sdk/bpf/rust-bpf-sysroot/src/compiler-builtins" path = "../../../../sdk/bpf/dependencies/rust-bpf-sysroot/src/compiler-builtins"
features = ["c", "mem"] features = ["c", "mem"]
[target.bpfel-unknown-unknown.dependencies] [target.bpfel-unknown-unknown.dependencies]
alloc = { path = "../../../../sdk/bpf/rust-bpf-sysroot/src/liballoc" } alloc = { path = "../../../../sdk/bpf/dependencies/rust-bpf-sysroot/src/liballoc" }

View File

@ -12,7 +12,7 @@ homepage = "https://solana.com/"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
solana-sdk-bpf-utils = { path = "../../../../sdk/bpf/rust-utils", version = "0.16.0" } solana-sdk-bpf-utils = { path = "../../../../sdk/bpf/rust/rust-utils", version = "0.16.0" }
solana-bpf-rust-many-args-dep = { path = "../many_args_dep", version = "0.16.0" } solana-bpf-rust-many-args-dep = { path = "../many_args_dep", version = "0.16.0" }
[workspace] [workspace]

View File

@ -1,6 +1,6 @@
[dependencies.compiler_builtins] [dependencies.compiler_builtins]
path = "../../../../sdk/bpf/rust-bpf-sysroot/src/compiler-builtins" path = "../../../../sdk/bpf/dependencies/rust-bpf-sysroot/src/compiler-builtins"
features = ["c", "mem"] features = ["c", "mem"]
[target.bpfel-unknown-unknown.dependencies] [target.bpfel-unknown-unknown.dependencies]
alloc = { path = "../../../../sdk/bpf/rust-bpf-sysroot/src/liballoc" } alloc = { path = "../../../../sdk/bpf/dependencies/rust-bpf-sysroot/src/liballoc" }

View File

@ -12,7 +12,7 @@ homepage = "https://solana.com/"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
solana-sdk-bpf-utils = { path = "../../../../sdk/bpf/rust-utils", version = "0.16.0" } solana-sdk-bpf-utils = { path = "../../../../sdk/bpf/rust/rust-utils", version = "0.16.0" }
[workspace] [workspace]
members = [] members = []

View File

@ -12,7 +12,7 @@ homepage = "https://solana.com/"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
solana-sdk-bpf-utils = { path = "../../../../sdk/bpf/rust-utils", version = "0.16.0" } solana-sdk-bpf-utils = { path = "../../../../sdk/bpf/rust/rust-utils", version = "0.16.0" }
[workspace] [workspace]
members = [] members = []

View File

@ -1,6 +1,6 @@
[dependencies.compiler_builtins] [dependencies.compiler_builtins]
path = "../../../../sdk/bpf/rust-bpf-sysroot/src/compiler-builtins" path = "../../../../sdk/bpf/dependencies/rust-bpf-sysroot/src/compiler-builtins"
features = ["c", "mem"] features = ["c", "mem"]
[target.bpfel-unknown-unknown.dependencies] [target.bpfel-unknown-unknown.dependencies]
alloc = { path = "../../../../sdk/bpf/rust-bpf-sysroot/src/liballoc" } alloc = { path = "../../../../sdk/bpf/dependencies/rust-bpf-sysroot/src/liballoc" }

View File

@ -12,7 +12,7 @@ homepage = "https://solana.com/"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
solana-sdk-bpf-utils = { path = "../../../../sdk/bpf/rust-utils", version = "0.16.0" } solana-sdk-bpf-utils = { path = "../../../../sdk/bpf/rust/rust-utils", version = "0.16.0" }
[workspace] [workspace]
members = [] members = []

View File

@ -1,6 +1,6 @@
[dependencies.compiler_builtins] [dependencies.compiler_builtins]
path = "../../../../sdk/bpf/rust-bpf-sysroot/src/compiler-builtins" path = "../../../../sdk/bpf/dependencies/rust-bpf-sysroot/src/compiler-builtins"
features = ["c", "mem"] features = ["c", "mem"]
[target.bpfel-unknown-unknown.dependencies] [target.bpfel-unknown-unknown.dependencies]
alloc = { path = "../../../../sdk/bpf/rust-bpf-sysroot/src/liballoc" } alloc = { path = "../../../../sdk/bpf/dependencies/rust-bpf-sysroot/src/liballoc" }

6
sdk/bpf/.gitignore vendored
View File

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

View File

@ -1,5 +1,5 @@
LOCAL_PATH := $(dir $(lastword $(MAKEFILE_LIST))) LOCAL_PATH := $(dir $(lastword $(MAKEFILE_LIST)))
INSTALL_SH := $(abspath $(LOCAL_PATH)/scripts/install.sh) INSTALL_SH := $(abspath $(LOCAL_PATH)/../scripts/install.sh)
all: all:
.PHONY: help all clean .PHONY: help all clean
@ -16,10 +16,10 @@ OS := $(shell uname)
ifeq ($(DOCKER),1) ifeq ($(DOCKER),1)
$(warning DOCKER=1 is experimential and may not work as advertised) $(warning DOCKER=1 is experimential and may not work as advertised)
LLVM_DIR = $(LOCAL_PATH)llvm-docker/ LLVM_DIR = $(LOCAL_PATH)../dependencies/llvm-docker/
LLVM_SYSTEM_INC_DIRS := /usr/local/lib/clang/8.0.0/include LLVM_SYSTEM_INC_DIRS := /usr/local/lib/clang/8.0.0/include
else else
LLVM_DIR = $(LOCAL_PATH)llvm-native/ LLVM_DIR = $(LOCAL_PATH)../dependencies/llvm-native/
LLVM_SYSTEM_INC_DIRS := $(LLVM_DIR)/lib/clang/8.0.0/include LLVM_SYSTEM_INC_DIRS := $(LLVM_DIR)/lib/clang/8.0.0/include
endif endif
@ -72,11 +72,11 @@ OBJ_DUMP_FLAGS := \
-source \ -source \
-disassemble \ -disassemble \
TESTFRAMEWORK_RPATH := $(abspath $(LOCAL_PATH)criterion/lib) TESTFRAMEWORK_RPATH := $(abspath $(LOCAL_PATH)../dependencies/criterion/lib)
TESTFRAMEWORK_FLAGS := \ TESTFRAMEWORK_FLAGS := \
-DSOL_TEST \ -DSOL_TEST \
-isystem $(LOCAL_PATH)criterion/include \ -isystem $(LOCAL_PATH)../dependencies/criterion/include \
-L $(LOCAL_PATH)criterion/lib \ -L $(LOCAL_PATH)../dependencies/criterion/lib \
-rpath $(TESTFRAMEWORK_RPATH) \ -rpath $(TESTFRAMEWORK_RPATH) \
-lcriterion \ -lcriterion \

View File

@ -23,8 +23,8 @@ set -e
"$bpf_sdk"/scripts/install.sh "$bpf_sdk"/scripts/install.sh
# Use the SDK's version of llvm to build the compiler-builtins for BPF # Use the SDK's version of llvm to build the compiler-builtins for BPF
export CC="$bpf_sdk/llvm-native/bin/clang" export CC="$bpf_sdk/dependencies/llvm-native/bin/clang"
export AR="$bpf_sdk/llvm-native/bin/llvm-ar" export AR="$bpf_sdk/dependencies/llvm-native/bin/llvm-ar"
# Use the SDK's version of Rust to build for BPF # Use the SDK's version of Rust to build for BPF
export RUSTUP_TOOLCHAIN=bpf export RUSTUP_TOOLCHAIN=bpf
export RUSTFLAGS=" export RUSTFLAGS="
@ -32,12 +32,12 @@ export RUSTFLAGS="
-C lto=no \ -C lto=no \
-C opt-level=2 \ -C opt-level=2 \
-C link-arg=-z -C link-arg=notext \ -C link-arg=-z -C link-arg=notext \
-C link-arg=-T$bpf_sdk/rust-utils/bpf.ld \ -C link-arg=-T$bpf_sdk/rust/bpf.ld \
-C link-arg=--Bdynamic \ -C link-arg=--Bdynamic \
-C link-arg=-shared \ -C link-arg=-shared \
-C link-arg=--entry=entrypoint \ -C link-arg=--entry=entrypoint \
-C linker=$bpf_sdk/llvm-native/bin/ld.lld" -C linker=$bpf_sdk/dependencies/llvm-native/bin/ld.lld"
export XARGO_RUST_SRC="$bpf_sdk/rust-bpf-sysroot/src" export XARGO_RUST_SRC="$bpf_sdk/dependencies/rust-bpf-sysroot/src"
xargo build --target bpfel-unknown-unknown --release -v xargo build --target bpfel-unknown-unknown --release -v
{ { set +x; } 2>/dev/null; echo Success; } { { set +x; } 2>/dev/null; echo Success; }

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
cd "$(dirname "$0")"/.. cd "$(dirname "$0")"/../dependencies
if [[ "$(uname)" = Darwin ]]; then if [[ "$(uname)" = Darwin ]]; then
machine=osx machine=osx