Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches: [ main ]

env:
SOLANA_VERSION: 1.7.12
SOLANA_VERSION: 1.10.29
DOCKER_HUB: docker.io
DOCKER_USER: ${{ secrets.DOCKER_IO_USER }}
IS_RELEASE: ${{
Expand Down
1 change: 0 additions & 1 deletion program/src/oracle/upd_aggregate.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "model/price_model.c" /* FIXME: HACK TO DEAL WITH DOCKER LINKAGE ISSUES */
#include "pd.h"

#include <limits.h>

#ifdef __cplusplus
extern "C" {
Expand Down
4 changes: 3 additions & 1 deletion program/src/oracle/util/compat_stdint.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
types and that can conflicts with stdint.h)
Defaults to 0 or 1 depending on if __bpf__ is set. */


#ifndef PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE
#ifndef __bpf__
#if !defined(__bpf__) && !defined(SOL_TEST)
#define PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE 0
#else
#define PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE 1
#endif
#endif


#if PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE==0
#include <stdint.h>
#elif PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE==1
Expand Down
2 changes: 1 addition & 1 deletion scripts/patch-solana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Patch BPF makefile and solana_sdk.h:
# - Build with `-Wall -Wextra -Wconversion`.
# - Link with `-z defs` and mark `sol_invoke_signed_c` as weak.
# - Link with `-z defs`.
# - Add TEST_FLAGS for criterion CLI.
#

Expand Down
25 changes: 6 additions & 19 deletions scripts/solana.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/sdk/bpf/c/bpf.mk b/sdk/bpf/c/bpf.mk
index 4b3039db1..018e8deb4 100644
index 541629ad49..8c2ec94041 100644
--- a/sdk/bpf/c/bpf.mk
+++ b/sdk/bpf/c/bpf.mk
@@ -14,6 +14,12 @@ TEST_PREFIX ?= test_
Expand All @@ -13,9 +13,9 @@ index 4b3039db1..018e8deb4 100644
+endif
+
LLVM_DIR = $(LOCAL_PATH)../dependencies/bpf-tools/llvm
LLVM_SYSTEM_INC_DIRS := $(LLVM_DIR)/lib/clang/12.0.1/include
LLVM_SYSTEM_INC_DIRS := $(LLVM_DIR)/lib/clang/13.0.0/include
COMPILER_RT_DIR = $(LOCAL_PATH)../dependencies/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib
@@ -31,6 +37,9 @@ SYSTEM_INC_DIRS := \
@@ -33,6 +39,9 @@ SYSTEM_INC_DIRS := \
$(LLVM_SYSTEM_INC_DIRS) \

C_FLAGS := \
Expand All @@ -25,32 +25,19 @@ index 4b3039db1..018e8deb4 100644
-Werror \
-O2 \
-fno-builtin \
@@ -59,6 +68,7 @@ BPF_CXX_FLAGS := \
@@ -68,6 +77,7 @@ BPF_CXX_FLAGS := \
-march=bpfel+solana

BPF_LLD_FLAGS := \
+ -z defs \
-z notext \
-shared \
--Bdynamic \
@@ -195,7 +205,7 @@ endef
define TEST_EXEC_RULE
@@ -245,6 +255,7 @@ define TEST_EXEC_RULE
$1: $2
LD_LIBRARY_PATH=$(TESTFRAMEWORK_RPATH) \
- $2$(\n)
$2$(\n)
+ $2 $(TEST_FLAGS)$(\n)
endef

.PHONY: $(INSTALL_SH)
diff --git a/sdk/bpf/c/inc/solana_sdk.h b/sdk/bpf/c/inc/solana_sdk.h
index b5cad9833..b3b496123 100644
--- a/sdk/bpf/c/inc/solana_sdk.h
+++ b/sdk/bpf/c/inc/solana_sdk.h
@@ -565,6 +565,7 @@ uint64_t sol_try_find_program_address(
/**
* Internal cross-program invocation function
*/
+__attribute__(( weak ))
uint64_t sol_invoke_signed_c(
const SolInstruction *instruction,
const SolAccountInfo *account_infos,