Skip to content
Closed
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@ cmd/geth/geth
cmd/rlpdump/rlpdump
cmd/workload/workload
cmd/keeper/keeper

geth
cmd/keeper/keeper-zisk
keeper-zisk.elf
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
path = tests/evm-benchmarks
url = https://github.com/ipsilon/evm-benchmarks
shallow = true
[submodule "evmone"]
path = evmone
url = https://github.com/ethereum/evmone
50 changes: 50 additions & 0 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,34 @@ var (
Name: "example",
Tags: "example",
},
{
Name: "example-evmone",
Tags: "example,evmone",
},
{
Name: "ziren-evmone",
GOOS: "linux",
GOARCH: "mipsle",
CC: "mipsel-linux-gnu-gcc",
Tags: "ziren,evmone",
Env: map[string]string{"GOMIPS": "softfloat", "CGO_ENABLED": "1"},
},
{
// WASM targets cannot use CGO, so evmone falls back to Go interpreter.
// The evmone tag is included for uniformity with other evmone targets.
Name: "wasm-js-evmone",
GOOS: "js",
GOARCH: "wasm",
Tags: "example,evmone",
},
{
// WASM targets cannot use CGO, so evmone falls back to Go interpreter.
// The evmone tag is included for uniformity with other evmone targets.
Name: "wasm-wasi-evmone",
GOOS: "wasip1",
GOARCH: "wasm",
Tags: "example,evmone",
},
}

// A debian package is created for all executables listed here.
Expand Down Expand Up @@ -288,6 +316,28 @@ func doInstallKeeper(cmdline []string) {
tc.Root = build.DownloadGo(csdb)
}

// Pre-build evmone static libraries for targets that need them.
builtEvmone := make(map[string]bool)
for _, target := range keeperTargets {
if !strings.Contains(target.Tags, "evmone") {
continue
}
// Skip targets where CGO is disabled or unavailable.
if target.GOARCH == "wasm" || target.Env["CGO_ENABLED"] == "0" {
continue
}
evmoneTarget := "native"
if target.GOARCH != "" {
evmoneTarget = target.GOARCH
}
if builtEvmone[evmoneTarget] {
continue
}
log.Printf("Building evmone library for %s", evmoneTarget)
build.MustRun(exec.Command("./evmone/build.sh", evmoneTarget))
builtEvmone[evmoneTarget] = true
}

for _, target := range keeperTargets {
log.Printf("Building keeper-%s", target.Name)

Expand Down
45 changes: 45 additions & 0 deletions cmd/keeper/zisk.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
OUTPUT_FORMAT("elf64-littleriscv")
OUTPUT_ARCH("riscv")
ENTRY(_rt0_riscv64_tamago)

MEMORY {
rom (xa) : ORIGIN = 0x80000000, LENGTH = 0x08000000
ram (wxa) : ORIGIN = 0xa0000000, LENGTH = 0x20000000
}

PHDRS {
text PT_LOAD FLAGS(5);
rodata PT_LOAD FLAGS(4);
data PT_LOAD FLAGS(6);
bss PT_LOAD FLAGS(6);
}

SECTIONS
{
.text : { *(.text.init) *(.text .text.*) } >rom AT>rom :text

. = ALIGN(8);
PROVIDE(_global_pointer = .);
.rodata : { *(.rodata .rodata.*) } >rom AT>rom :rodata

.data : { *(.data .data.* .sdata .sdata.*) } >ram AT>ram :data

. = ALIGN(8);
.bss : {
PROVIDE(_bss_start = .);
*(.bss .bss.* .sbss .sbss.*);
PROVIDE(_bss_end = .);
} >ram AT>ram :bss

. = ALIGN(8);
.noptrbss : { *(.noptrbss) } >ram AT>ram :bss

. = ALIGN(8);
PROVIDE(_init_stack_top = . + 0x800000);

PROVIDE(_kernel_heap_bottom = _init_stack_top);
PROVIDE(_kernel_heap_top = ORIGIN(ram) + LENGTH(ram));
PROVIDE(_kernel_heap_size = _kernel_heap_top - _kernel_heap_bottom);

_end = .;
}
Loading