Skip to content
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

Support emscripten #100

Merged
merged 2 commits into from
Sep 18, 2024
Merged

Conversation

ChanTsune
Copy link
Contributor

This is to support wasm32-unknown-emscripten target.
this change will fix this error:

$ cargo test --target wasm32-unknown-emscripten
   Compiling errno v0.3.9 (/rust-errno)
error: linking with `emcc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/self-contained:/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/self-contained:/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/self-contained:/root/.cargo/bin:/emsdk:/emsdk/upstream/emscripten:/emsdk/node/18.20.3_64bit/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "emcc" "-s" "EXPORTED_FUNCTIONS=[\"_main\"]" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.00rw5sd3xmnnvm15ypiflgk2c.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.0v61oyiagnoueyloxcvej7dye.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.0zycd12m5srlxxdleyb0nune2.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.14o5cyjtgmpuezrgezosor3vv.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.1dogfzijnbjjuyib5whml3uvm.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.2eryt316vtpmx2xn01ufgqzfs.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.2uxy698t79dqe7l9w4jkahmil.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.2z5b4t1o5ovuz5xdtdrpny61m.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.3jco4hx4l88n7wqdwzihywtbk.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.3kgss5pcadbxxfi8gy4xq2l12.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.3sibj9kim1qqsvkq53huksg8l.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.4vmwitsv1l6qenvwfxg3hlqdb.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.58nrwgrvj789ugdvo4jkfweng.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.5fcslngmxx6jaabxtdshr4eap.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.5n4y7as5tted3yoxxsewsm8io.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.5r9i4zlbqnvp0r8zrg64hf1dk.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.5raa32r0u1skvk8u0w4hdveg7.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.62xg9o99xqejd561j0pk1g8yn.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.658hrkmrz4jo7ty9pxv1gvxtw.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.7f5ym88i36a3bh49oiz2gyn09.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.7uihhtrsw5ef0lht6ujpqnde5.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.7x0ejmx4pn3on3w08dj61x21u.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.89g00zoy41dtn33m9y9et9klo.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.8h6z701srktmxh9nvrrwtghl1.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.8o6o08fu7q9mbfc7ooz9mc74o.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.8srm7ll5b9edrttqt4juet6ao.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.97fc4zvwdnm92mo6hq1uztwmq.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.9bmu689n5mbn0tm5fto1gp2du.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.9cyosaxdl41it7f30lmrzmy65.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.9sgxww99w7tbkwbuisf52f6i1.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.af1o2gqy92up1tdzdz9vteidl.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.ait1lhihc1hae2zvxlcjnrkpf.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.axs6rqwhhrks4u4dvg6qgmyfg.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.aywb93progtl4oyk40js0avvm.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.bcwf3mh4gngjzzle8555nzzzu.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.bza8vr3jbt4ts0gsqupuyhu1p.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.ccec0uqglvvnh8zd4dw5j245y.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.ce87ls0jsv5gsciqicg06io3x.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.deokg352ttjr9e25hzssyhkjl.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.dfph0lq8o3mkb9onpzxtgpkbn.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.dlty0pey41w0rrj80jrb7pzyk.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.dpiv2omo5gpa19n1wq9od4afe.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.ebxuw6ipm3vmfb8nq18nrsu5q.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.eds5bn42fsmzle6127hphdpb6.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.einuwqg1romlwkfi5npd9ny62.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.ejzapz21ixmuiu6zuwtye0ae8.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.ekxd0682bh79nh94dhzk3qk7b.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.el84tugafcvefem0zufgu4yjm.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.ez5v18r6xnbj1y2pb4zmzg7fj.rcgu.o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.dxpswimmjhf2g6jrajqqlylm1.rcgu.o" "-L" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps" "-L" "/rust-errno/target/debug/deps" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libtest-0c7e4746a93536a4.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libgetopts-7881935542e32860.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libunicode_width-b99fad4cf716fed8.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_std_workspace_std-d18b84b006d65974.rlib" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/liblibc-e777b03f104b3408.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-45c1ce338badeea9.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libpanic_unwind-7775e7298ba8f7f6.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_demangle-162bf66697da067a.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libstd_detect-3d64a88ee27b1793.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libhashbrown-420e7c6c789d3047.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_std_workspace_alloc-c3f11910ad77de23.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libminiz_oxide-b4fdac2b2a2867d5.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libadler-93df5dbf098fa821.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libunwind-d0f604167f07f7d0.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libcfg_if-7e1ff0e564a14183.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/liblibc-2910f3a42b8469d7.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/liballoc-56aa85dece338fb3.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/librustc_std_workspace_core-df01810ccc8e7302.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libcore-1034fb12b8d635db.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/libcompiler_builtins-017d5067733b149d.rlib" "-l" "c" "-B/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-B/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-B/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "--target=wasm32-unknown-emscripten" "-s" "DISABLE_EXCEPTION_CATCHING=0" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-emscripten/lib/self-contained" "-o" "/rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.js" "-O0" "-g" "-sABORTING_MALLOC=0"
  = note: cache:INFO: generating system asset: symbol_lists/92e7527f94aee3d627c78b0393ea2744446d38c3.json... (this will be cached in "/emsdk/upstream/emscripten/cache/symbol_lists/92e7527f94aee3d627c78b0393ea2744446d38c3.json" for subsequent builds)
          cache:INFO:  - ok
          wasm-ld: error: /rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.ait1lhihc1hae2zvxlcjnrkpf.rcgu.o: undefined symbol: errno_location
          wasm-ld: error: /rust-errno/target/wasm32-unknown-emscripten/debug/deps/errno-4c257602add93423.ait1lhihc1hae2zvxlcjnrkpf.rcgu.o: undefined symbol: errno_location
          emcc: error: '/emsdk/upstream/bin/wasm-ld @/tmp/emscripten_fcfjx41n.rsp.utf-8' failed (returned 1)

@sunfishcode sunfishcode merged commit e0107c0 into lambda-fairy:main Sep 18, 2024
12 checks passed
@sunfishcode
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants