Skip to content

Commit

Permalink
polkawasm: remove _start export. remove wasm-libc allocation functions
Browse files Browse the repository at this point in the history
  • Loading branch information
radkomih committed Dec 1, 2023
1 parent 5289c67 commit dac6696
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/runtime/arch_tinygowasm_malloc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build tinygo.wasm && !custommalloc
//go:build tinygo.wasm && !custommalloc && !polkawasm

package runtime

Expand Down
18 changes: 7 additions & 11 deletions src/runtime/runtime_polkawasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@

package runtime

import (
"unsafe"
)

//export _start
func _start() {
// These need to be initialized early so that the heap can be initialized.
heapStart = uintptr(unsafe.Pointer(&heapStartSymbol))
heapEnd = uintptr(wasm_memory_size(0) * wasmPageSize)
run()
}
// //export _start
// func _start() {
// // These need to be initialized early so that the heap can be initialized.
// heapStart = uintptr(unsafe.Pointer(&heapStartSymbol))
// heapEnd = uintptr(wasm_memory_size(0) * wasmPageSize)
// run()
// }

// Abort executes the wasm 'unreachable' instruction.
func abort() {
Expand Down
5 changes: 3 additions & 2 deletions targets/polkawasm.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
"--allow-undefined",
"--export=__heap_base",
"--export=__data_end",
"--export-table"
"--export-table",
"--no-entry"
],
"extra-files": [
"src/runtime/asm_tinygowasm.S"
],
"emulator": "wasmtime {}",
"emulator": "wasmtime --mapdir=/tmp::{tmpDir} {}",
"wasm-abi": "generic"
}

0 comments on commit dac6696

Please sign in to comment.