diff --git a/flake.nix b/flake.nix index cd9226a..d05cca1 100644 --- a/flake.nix +++ b/flake.nix @@ -288,8 +288,14 @@ rec { domain = "gitea.local.chriphost.de"; owner = "christoph"; repo = "wamr"; - rev = "fd69a4e76ec0d384bd79f514772b7dfa240fc0d7"; - hash = "sha256-rlCx4isI0k6rC9E0hWIA9LeinqiACug7zxj9z/e4SBQ="; + + # After placing mmap region in .text segment: + rev = "1521011029b0531c02eb0142c239b7f85a3165b5"; + hash = "sha256-/uLSank+Aacfj+SBliYTaD320cCA1lBRtSRALXErJGE="; + + # Before placing mmap region in .text segment: + # rev = "fd69a4e76ec0d384bd79f514772b7dfa240fc0d7"; + # hash = "sha256-rlCx4isI0k6rC9E0hWIA9LeinqiACug7zxj9z/e4SBQ="; }; nativeBuildInputs = with pkgs; [cmake]; diff --git a/targets/linker.ld b/targets/linker.ld index 0dd893c..abe99b8 100644 --- a/targets/linker.ld +++ b/targets/linker.ld @@ -18,7 +18,6 @@ SECTIONS { /* Code and readonly data */ .text : { /* fill gaps with int3 opcode to detect invalid jumps */ - /* TODO: Crashes */ FILL(0xcc) /* multiboot header */ @@ -51,7 +50,9 @@ SECTIONS { } /* Data and Stacks */ - . = 0x200000; + /* NOTE: When including the WAMR mmap region inside .text, it has to be large */ + /* . = 0x200000; */ + . = ALIGN(4096); .data : { KEEP (*(".startup_stack")) KEEP (*(".kernel_stack")) diff --git a/wasm.just b/wasm.just index 4535996..c0a5166 100644 --- a/wasm.just +++ b/wasm.just @@ -53,6 +53,8 @@ WAMRCFLAGS := "\ --target=i386 \ --cpu=generic \ --opt-level=0 \ +--enable-indirect-mode \ +--disable-llvm-intrinsics \ " XXD := "xxd"