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

Some changes to revive WebAssembly support #2543

Closed
wants to merge 1 commit into from

Conversation

rujialiu
Copy link

  • Put an X in this bracket to confirm you have read the
    External Contribution Guidelines.

  • Please put the link to your RFC or bug issue here.
    PRs missing this link will be marked as missing RFC.

  • If that issue does not already have approval from a developer,
    please be sure to open this PR in "Draft" mode.

  • Please make sure the PR has excellent documentation and tests.
    If we label it missing documentation or missing tests then it needs fixing!

  • You can manage the awaiting-review, awaiting-author, and WIP labels
    yourself, by writing a comment containing one of these labels on its own line.

@github-actions
Copy link
Contributor

Thanks for your contribution! Please make sure to follow our Commit Convention.

@rujialiu rujialiu marked this pull request as draft September 14, 2023 10:32
@rujialiu
Copy link
Author

Here is the commands used to build:

cd /src/lean4/build/release
rm -rf *
emcmake cmake ../.. -DUSE_GMP=OFF -DSTAGE0_CMAKE_AR=/emsdk_portable/upstream/emscripten/emar -DSTAGE0_CMAKE_TOOLCHAIN_FILE=/emsdk_portable/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DDSTAGE0_CMAKE_CROSSCOMPILING_EMULATOR="/emsdk_portable/node/12.9.1_64bit/bin/node"
VERBOSE=1 emmake make -j4 stage0
"/src/lean4/build/release/stage0/leanc.sh" /src/lean4/build/release/stage0/shell/CMakeFiles/shell.dir/lean.cpp.o -Wl,--whole-archive -lInit -lLean -lleancpp -lleanrt -rdynamic -o /src/lean4/build/release/stage0/bin/lean -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s ASSERTIONS=1 -s WASM=1 -fexceptions -lnodefs.js -s MAIN_MODULE=1 -s LINKABLE=1 -s EXPORT_ALL=1 -s LLD_REPORT_UNDEFINED=1
cp -a /src/lean4/build/release/stage0 /home
cd /home/stage0/bin
LEAN_PATH=/home/stage0/bin node --stack-size=8192 lean --run Main.lean

Note that I didn't bother changing the final command to build the wasm, so I added a followup command after make. The next command is to copy everything into a directory insode /home because the current code only mounted /home and /tmp. The last command is try to run a Hello World program (or whatever else).

The local paths used in the command was reported by executing emcmake alone first.

Comment on lines +300 to +301
void* self = dlopen(NULL, RTLD_LAZY);
return dlsym(self, sym);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks to me like this is no longer necessary after emscripten-core/emscripten@c4f7a55; what version of empscripten are we targeting?

@rujialiu
Copy link
Author

rujialiu commented Sep 16, 2023 via email

@rujialiu
Copy link
Author

rujialiu commented Oct 4, 2023

superseded by #2599

@rujialiu rujialiu closed this Oct 4, 2023
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.

None yet

2 participants