From e98a7504f2d9d2be76de83008ad21d6fe294bbcd Mon Sep 17 00:00:00 2001 From: Dmitri Makarov Date: Thu, 24 Jun 2021 16:34:45 -0700 Subject: [PATCH] Bump bpf-tools version to 1.12 --- programs/bpf/c/src/float/float.c | 6 ++++++ sdk/bpf/scripts/install.sh | 2 +- sdk/cargo-build-bpf/src/main.rs | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/programs/bpf/c/src/float/float.c b/programs/bpf/c/src/float/float.c index a270cfe31..58d11b0f4 100644 --- a/programs/bpf/c/src/float/float.c +++ b/programs/bpf/c/src/float/float.c @@ -5,6 +5,8 @@ */ #include +extern double log2(double arg); + extern uint64_t entrypoint(const uint8_t *input) { SolAccountInfo ka[1]; SolParameters params = (SolParameters) { .ka = ka }; @@ -23,5 +25,9 @@ extern uint64_t entrypoint(const uint8_t *input) { value /= -2.0; sol_assert(value < 0.0); + /* test that standard math functions are available */ + value = *data + 1.0; + sol_assert(log2(value) == 1.0); + return SUCCESS; } diff --git a/sdk/bpf/scripts/install.sh b/sdk/bpf/scripts/install.sh index 4e97ad08a..6e88c1c46 100755 --- a/sdk/bpf/scripts/install.sh +++ b/sdk/bpf/scripts/install.sh @@ -92,7 +92,7 @@ if [[ ! -e criterion-$version.md || ! -e criterion ]]; then fi # Install Rust-BPF -version=v1.11 +version=v1.12 if [[ ! -e bpf-tools-$version.md || ! -e bpf-tools ]]; then ( set -e diff --git a/sdk/cargo-build-bpf/src/main.rs b/sdk/cargo-build-bpf/src/main.rs index 207eb9e78..ac9e7f754 100644 --- a/sdk/cargo-build-bpf/src/main.rs +++ b/sdk/cargo-build-bpf/src/main.rs @@ -414,7 +414,7 @@ fn build_bpf_package(config: &Config, target_directory: &Path, package: &cargo_m install_if_missing( config, "bpf-tools", - "v1.11", + "v1.12", "https://github.com/solana-labs/bpf-tools/releases/download", &PathBuf::from(bpf_tools_filename), )