solana-sdk now builds for wasm32-unknown-unknown

This commit is contained in:
Michael Vines 2021-10-12 18:20:55 -07:00
parent da45be366a
commit 13462d63a2
6 changed files with 17 additions and 7 deletions

View File

@ -29,9 +29,10 @@ RUN set -x \
&& rustup component add rustfmt \
&& rustup component add clippy \
&& cargo install cargo-audit \
&& cargo install svgbob_cli \
&& cargo install mdbook \
&& cargo install mdbook-linkcheck \
&& cargo install svgbob_cli \
&& cargo install wasm-pack \
&& rustc --version \
&& cargo --version \
&& curl -OL https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP \

View File

@ -19,13 +19,16 @@ lazy_static = { version = "1.4.0", features = ["spin", "spin_no_std"] }
libc = { version = "0.2.62", features = ["extra_traits"] }
rand_chacha = { version = "0.2.2" }
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"] }
ed25519-dalek = { version = "=1.0.1", features = ["serde"] }
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"] }
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]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -26,8 +26,8 @@ unsafe impl std::alloc::GlobalAlloc for BumpAllocator {
0x42 as *mut u8
} else {
const POS_PTR: *mut usize = HEAP_START_ADDRESS as *mut usize;
const TOP_ADDRESS: usize = HEAP_START_ADDRESS + HEAP_LENGTH;
const BOTTOM_ADDRESS: usize = HEAP_START_ADDRESS + size_of::<*mut u8>();
const TOP_ADDRESS: usize = HEAP_START_ADDRESS as usize + HEAP_LENGTH;
const BOTTOM_ADDRESS: usize = HEAP_START_ADDRESS as usize + size_of::<*mut u8>();
let mut pos = *POS_PTR;
if pos == 0 {

View File

@ -90,3 +90,6 @@ rustc_version = "0.4"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[lib]
crate-type = ["cdylib", "rlib"]

View File

@ -55,3 +55,6 @@ rustc_version = "0.4"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[lib]
crate-type = ["cdylib", "rlib"]

View File

@ -28,7 +28,7 @@ pub type ProcessInstruction =
pub const SUCCESS: u64 = 0;
/// 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.
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"))]
#[global_allocator]
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,
};
};