Skip to content

Bump emsdk version #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
40d5c5e
Bump emsdk version
Mause Apr 1, 2021
11fa8c2
Merge branch 'main' into bump-emsdk-version
Mause Apr 2, 2021
da72c28
Merge branch 'main' into bump-emsdk-version
Mause Apr 7, 2021
b8d92b2
Add DEFAULT_LIBRARY_FUNCS_TO_INCLUDE
Mause Apr 7, 2021
c374de4
Merge branch 'main' into bump-emsdk-version
Mause Apr 7, 2021
0a0c866
Put js in em_asm section
Mause Apr 7, 2021
42dcc57
Deref bytes
Mause Apr 7, 2021
70e614a
Use constant arrays
Mause Apr 7, 2021
6bd1dc1
Remove dots
Mause Apr 7, 2021
c11b109
Merge branch 'main' into bump-emsdk-version
Mause Apr 7, 2021
ac2e2e3
Merge branch 'main' into bump-emsdk-version
Mause Apr 7, 2021
be77391
Fix path again
Mause Apr 7, 2021
194e64a
full-contents
Mause Apr 7, 2021
fefcd15
Try SNIPPET.as_ptr()
Mause Apr 7, 2021
546678e
verbose
Mause Apr 7, 2021
1e780a8
vv
Mause Apr 7, 2021
ba4284a
Export __start_em_asm ?
Mause Apr 7, 2021
b996a54
Try in other export list
Mause Apr 7, 2021
01540e0
No braces?
Mause Apr 7, 2021
80c20b5
"-Z", "print-link-args"
Mause Apr 7, 2021
1f9fff5
Move to RUSTFLAGS
Mause Apr 7, 2021
b2334f0
Name?
Mause Apr 7, 2021
23c56d4
Export name?
Mause Apr 7, 2021
0ea3f5f
Remove RUSTFLAGS
Mause Apr 7, 2021
68a8567
Try comma syntax
Mause Apr 8, 2021
33b8dda
Only pull data
Mause Apr 8, 2021
b6d4761
Without dot?
Mause Apr 8, 2021
fea88c2
More flags
Mause Apr 9, 2021
b0bc4ff
Update Makefile.toml
Mause Apr 9, 2021
2d2cf35
Store emscripten logs
Mause Apr 9, 2021
bc9fc33
Merge branch 'main' into bump-emsdk-version
Mause Apr 9, 2021
4557467
Merge branch 'bump-emsdk-version' into bump-logging
Mause Apr 9, 2021
dcaeca5
Try different name
Mause Apr 9, 2021
830adb2
Merge branch 'main' into bump-emsdk-version
Mause Apr 9, 2021
b6ffcdf
Merge branch 'bump-emsdk-version' into bump-logging
Mause Apr 9, 2021
4fbb3e6
Try another name
Mause Apr 9, 2021
5cc017b
Try the default
Mause Apr 9, 2021
5c6f3c9
Add emmaken -v
Mause Apr 9, 2021
37929a5
Merge pull request #106 from Mause/bump-logging
Mause Apr 11, 2021
b3bcc24
Merge branch 'main' into bump-emsdk-version
Mause Apr 12, 2021
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
9 changes: 7 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: emscripten/emsdk:2.0.15
image: emscripten/emsdk:2.0.16

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -67,7 +67,12 @@ jobs:
with:
name: target
path: target/
- run: wasm-objdump -x -j em_asm target/deploy/bin.wasm
- uses: actions/upload-artifact@v2
if: failure()
with:
name: emscripten_logs
path: /tmp/emscripten_temp
- run: wasm-objdump --details --headers --reloc --debug --section=data --full-contents target/wasm32-unknown-emscripten/debug/deps/bin-*.wasm
if: always()
continue-on-error: true
- uses: actions-rs/clippy-check@v1
Expand Down
5 changes: 3 additions & 2 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[env]
EMMAKEN_CFLAGS = "-s ERROR_ON_UNDEFINED_SYMBOLS=0 -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=33554432 -sEXTRA_EXPORTED_RUNTIME_METHODS=[ccall,cwrap,callback] -s ASSERTIONS=1 -s SAFE_HEAP=1"
EMMAKEN_CFLAGS = "-v -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=33554432 -s DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=$readAsmConstArgs -sEXTRA_EXPORTED_RUNTIME_METHODS=ccall,cwrap,callback,__start_em_asm,__stop_em_asm -s ASSERTIONS=1 -s SAFE_HEAP=1"
EMCC_DEBUG = "1"

[tasks.build]
clear = true
dependencies = ['prebuild']
command = "cargo"
args = ["build", "--tests", "--target", "wasm32-unknown-emscripten"]
args = ["build", "--tests", "--target", "wasm32-unknown-emscripten", "-vv"]

[tasks.deploy]
dependencies = ["ci-flow"]
Expand Down
10 changes: 6 additions & 4 deletions src/jse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ macro_rules! jse {

let array = &AlignToSixteen([$($i,)*]);
let sig = CString::new("i".repeat(LEN)).expect("sig");
const SNIPPET: &'static [u8] = $js_expr;
#[link_section = ".data,em_asm"]
static SNIPPET: [u8; $js_expr.len()] = *$js_expr;

assert_eq!(SNIPPET[..].last().expect("empty snippet?"), &0);

unsafe {
emscripten_asm_const_int(
SNIPPET as *const _ as *const u8,
SNIPPET.as_ptr() as *const _ as *const u8,
sig.as_ptr() as *const _ as *const u8,
array as *const _ as *const u8,
) as i32
Expand All @@ -31,11 +32,12 @@ macro_rules! jse {
};
($js_expr:expr) => {
{
const SNIPPET: &'static [u8] = $js_expr;
#[link_section = ".data,em_asm"]
static SNIPPET: [u8; $js_expr.len()] = *$js_expr;

unsafe {
emscripten_asm_const_int(
SNIPPET as *const _ as *const u8,
SNIPPET.as_ptr() as *const _ as *const u8,
crate::jse::empty_sig.as_ptr() as *const _ as *const u8,
std::ptr::null() as *const _ as *const u8,
) as i32
Expand Down