solana-sdk now builds for wasm32-unknown-unknown
This commit is contained in:
parent
da45be366a
commit
13462d63a2
|
@ -29,9 +29,10 @@ RUN set -x \
|
||||||
&& rustup component add rustfmt \
|
&& rustup component add rustfmt \
|
||||||
&& rustup component add clippy \
|
&& rustup component add clippy \
|
||||||
&& cargo install cargo-audit \
|
&& cargo install cargo-audit \
|
||||||
&& cargo install svgbob_cli \
|
|
||||||
&& cargo install mdbook \
|
&& cargo install mdbook \
|
||||||
&& cargo install mdbook-linkcheck \
|
&& cargo install mdbook-linkcheck \
|
||||||
|
&& cargo install svgbob_cli \
|
||||||
|
&& cargo install wasm-pack \
|
||||||
&& rustc --version \
|
&& rustc --version \
|
||||||
&& cargo --version \
|
&& cargo --version \
|
||||||
&& curl -OL https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP \
|
&& curl -OL https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP \
|
||||||
|
|
|
@ -19,13 +19,16 @@ lazy_static = { version = "1.4.0", features = ["spin", "spin_no_std"] }
|
||||||
libc = { version = "0.2.62", features = ["extra_traits"] }
|
libc = { version = "0.2.62", features = ["extra_traits"] }
|
||||||
rand_chacha = { version = "0.2.2" }
|
rand_chacha = { version = "0.2.2" }
|
||||||
regex-syntax = { version = "0.6.12" }
|
regex-syntax = { version = "0.6.12" }
|
||||||
reqwest = { version = "0.11.2", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
|
||||||
ring = { version = "0.16.17" }
|
|
||||||
serde = { version = "1.0.100", features = ["rc"] }
|
serde = { version = "1.0.100", features = ["rc"] }
|
||||||
ed25519-dalek = { version = "=1.0.1", features = ["serde"] }
|
ed25519-dalek = { version = "=1.0.1", features = ["serde"] }
|
||||||
syn_0_15 = { package = "syn", version = "0.15.42", features = ["extra-traits", "fold", "full"] }
|
syn_0_15 = { package = "syn", version = "0.15.42", features = ["extra-traits", "fold", "full"] }
|
||||||
syn_1_0 = { package = "syn", version = "1.0.3", features = ["extra-traits", "fold", "full"] }
|
syn_1_0 = { package = "syn", version = "1.0.3", features = ["extra-traits", "fold", "full"] }
|
||||||
winapi = { version = "0.3.8", features=["basetsd", "consoleapi", "errhandlingapi", "fileapi", "handleapi", "impl-debug", "impl-default", "knownfolders", "libloaderapi", "memoryapi", "minwinbase", "minwindef", "ntdef", "ntsecapi", "ntstatus", "objbase", "processenv", "processthreadsapi", "profileapi", "shlobj", "std", "synchapi", "sysinfoapi", "timezoneapi", "utilapiset", "winbase", "wincon", "windef", "winerror", "winnls", "winnt", "winreg", "winsock2", "winuser", "ws2def", "ws2ipdef", "ws2tcpip", "wtypesbase"] }
|
winapi = { version = "0.3.8", features=["basetsd", "consoleapi", "errhandlingapi", "fileapi", "handleapi", "impl-debug", "impl-default", "knownfolders", "libloaderapi", "memoryapi", "minwinbase", "minwindef", "ntdef", "ntsecapi", "ntstatus", "objbase", "processenv", "processthreadsapi", "profileapi", "shlobj", "std", "synchapi", "sysinfoapi", "timezoneapi", "utilapiset", "winbase", "wincon", "windef", "winerror", "winnls", "winnt", "winreg", "winsock2", "winuser", "ws2def", "ws2ipdef", "ws2tcpip", "wtypesbase"] }
|
||||||
|
|
||||||
|
|
||||||
|
[target.'cfg(not(target_family = "wasm"))'.dependencies]
|
||||||
|
reqwest = { version = "0.11.2", default-features = false, features = ["blocking", "rustls-tls", "json"] }
|
||||||
|
ring = { version = "0.16.17" }
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ["x86_64-unknown-linux-gnu"]
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
|
|
|
@ -26,8 +26,8 @@ unsafe impl std::alloc::GlobalAlloc for BumpAllocator {
|
||||||
0x42 as *mut u8
|
0x42 as *mut u8
|
||||||
} else {
|
} else {
|
||||||
const POS_PTR: *mut usize = HEAP_START_ADDRESS as *mut usize;
|
const POS_PTR: *mut usize = HEAP_START_ADDRESS as *mut usize;
|
||||||
const TOP_ADDRESS: usize = HEAP_START_ADDRESS + HEAP_LENGTH;
|
const TOP_ADDRESS: usize = HEAP_START_ADDRESS as usize + HEAP_LENGTH;
|
||||||
const BOTTOM_ADDRESS: usize = HEAP_START_ADDRESS + size_of::<*mut u8>();
|
const BOTTOM_ADDRESS: usize = HEAP_START_ADDRESS as usize + size_of::<*mut u8>();
|
||||||
|
|
||||||
let mut pos = *POS_PTR;
|
let mut pos = *POS_PTR;
|
||||||
if pos == 0 {
|
if pos == 0 {
|
||||||
|
|
|
@ -90,3 +90,6 @@ rustc_version = "0.4"
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ["x86_64-unknown-linux-gnu"]
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
crate-type = ["cdylib", "rlib"]
|
||||||
|
|
|
@ -55,3 +55,6 @@ rustc_version = "0.4"
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ["x86_64-unknown-linux-gnu"]
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
crate-type = ["cdylib", "rlib"]
|
||||||
|
|
|
@ -28,7 +28,7 @@ pub type ProcessInstruction =
|
||||||
pub const SUCCESS: u64 = 0;
|
pub const SUCCESS: u64 = 0;
|
||||||
|
|
||||||
/// Start address of the memory region used for program heap.
|
/// Start address of the memory region used for program heap.
|
||||||
pub const HEAP_START_ADDRESS: usize = 0x300000000;
|
pub const HEAP_START_ADDRESS: u64 = 0x300000000;
|
||||||
/// Length of the heap memory region used for program heap.
|
/// Length of the heap memory region used for program heap.
|
||||||
pub const HEAP_LENGTH: usize = 32 * 1024;
|
pub const HEAP_LENGTH: usize = 32 * 1024;
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ macro_rules! custom_heap_default {
|
||||||
#[cfg(all(not(feature = "custom-heap"), target_arch = "bpf"))]
|
#[cfg(all(not(feature = "custom-heap"), target_arch = "bpf"))]
|
||||||
#[global_allocator]
|
#[global_allocator]
|
||||||
static A: $crate::entrypoint::BumpAllocator = $crate::entrypoint::BumpAllocator {
|
static A: $crate::entrypoint::BumpAllocator = $crate::entrypoint::BumpAllocator {
|
||||||
start: $crate::entrypoint::HEAP_START_ADDRESS,
|
start: $crate::entrypoint::HEAP_START_ADDRESS as usize,
|
||||||
len: $crate::entrypoint::HEAP_LENGTH,
|
len: $crate::entrypoint::HEAP_LENGTH,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue