emscripten-core / emscripten-core/emscripten
Provide STRIP for autotools
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
Autotools use `STRIP` variable (https://github.com/autotools-mirror/automake/blob/80714ea0aba62f025780f432abfbab2e66f6f801/m4/strip.m4#L25) which allows to correctly strip binaries when cross-compiling instead of attempting to run regular `strip` on incompatible binaries.
I thought I could relatively easily add this here https://github.com/emscripten-core/emscripten/blob/7d7dbdef08c6a418d5256b89edc2b7be030b0b80/tools/building.py#L70, pointing to `llvm-strip` or `emstrip`, but the problem is that it will be invoked by autotools on executables themselves, which in our case will usually happen to be a JS file.
I wonder if it would make sense to modify `emstrip` (https://github.com/emscripten-core/emscripten/blob/0c21eb984593d4bf606f0e7fa6c396059ccf4860/emstrip.py#L7) to automatically find `.wasm` file if the provided one looks like `.js`, so that it correctly handles both standalone Wasm and JS+Wasm cases? Then we would be able to provide such `emstrip` wrapper as `STRIP` executable.
cc @sbc100
Contributor guide
Assessment
This issue has not been assessed yet.