emscripten-core / emscripten-core/emscripten

Duplicate main and __original_main

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

Description

It looks like if one builds with a main that is of form `int main(){...}`, there will be this kind of stub

```wast
(func $main (; 3 ;) (param $0 i32) (param $1 i32) (result i32)
(call $__original_main)
)
(func $__original_main (; 5 ;) (result i32)
...
```
that will be generated, but not inlined away even in -O3. Is that something that would be possible to optimize away?

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.