emscripten-core / emscripten-core/emscripten

emsize improve compatibility on existing makefiles.

Open
#18,704 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Please include the following in your bug report:

**Version of emscripten/emsdk:**
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.5 ()
Ubuntu clang version 13.0.1-2ubuntu2.1
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /usr/bin

I added wasm support to an existing c project wich uses its own makefile hirarchy.
I stumbled up on the problem that emsize has some flaws:
It can only process .js files.
It can't give parameters to the underlying llvm-size.

Here i published a little Project to illustrate the "Bug": https://github.com/maxbit89/wasm-example-project

When you check out there are two scripts.
First thing to do is to run buildMyLib.sh
The last line of this script runs emsize on the archive file. This isn't possible in the current implementation.
Next thing is buildMyApp.sh
This builds a normal c applicaiton wich uses the library.

Here the problem is that the output name of the application doesn't end with .js
This also can't be Processed with the current implementation of emsize.

I refactored the emsize.py script my self and opened a pull request here: https://github.com/emscripten-core/emscripten/pull/18703
I wouldn't consider this as the best solution but i think it is an improvment to Users dealing with existing makefile builds.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.