Skip to content

Commit

Permalink
samples/spawn-thread: Tweak to expose a bug (#2888)
Browse files Browse the repository at this point in the history
this would expose the deadlock bug, which has been fixed by
#2882
  • Loading branch information
yamt authored Dec 8, 2023
1 parent 2fb3dc3 commit 1dbae40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions samples/spawn-thread/wasm-apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ set (DEFINED_SYMBOLS
set (CMAKE_EXE_LINKER_FLAGS
"-Wl,--shared-memory,--max-memory=131072, \
-Wl,--no-entry,--strip-all,--export=sum, \
-Wl,--export=return_bss, \
-Wl,--export=__heap_base,--export=__data_end \
-Wl,--export=__wasm_call_ctors \
-Wl,--allow-undefined-file=${DEFINED_SYMBOLS}"
Expand Down
13 changes: 12 additions & 1 deletion samples/spawn-thread/wasm-apps/sum.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*/

/*
* have something in bss so that llvm synthesizes
* wasm start function for this module.
*/
char *
return_bss()
{
static char bss[4096];
return bss;
}

int
sum(int start, int length)
{
Expand All @@ -13,4 +24,4 @@ sum(int start, int length)
}

return sum;
}
}

0 comments on commit 1dbae40

Please sign in to comment.