-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
error on undefined main
symbol by default
#9640
Comments
The cost here is that some users will see |
See #9635 |
sbc100
added a commit
that referenced
this issue
Oct 14, 2019
sbc100
added a commit
that referenced
this issue
Oct 15, 2019
sbc100
added a commit
that referenced
this issue
May 16, 2020
Unlike without STANDALONE_WASM users are expected to either define a main or explicitly opt out. This change and paves to way to moving to llvm's new main mangling method: https://reviews.llvm.org/D70700 Fixes: #9640
sbc100
added a commit
that referenced
this issue
May 18, 2020
Unlike without STANDALONE_WASM users are expected to either define a main or explicitly opt out. This change and paves to way to moving to llvm's new main mangling method: https://reviews.llvm.org/D70700 Fixes: #9640
belraquib
pushed a commit
to belraquib/emscripten
that referenced
this issue
Dec 23, 2020
@sbc100 I'm getting a main export error:
and the following compiling options:
EDIT:---- Adding |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently emscripten tries to make the
main
symbol optional, so that some programs (in particular library that export functions but have no entry point) can be built with nomain
all.While this feature is convenient if make the code in emscripten more complicated since there is no way to know ahead of time (before linking) if a program has an entry point or not. In particualar there are two places in the codebase were we try to detect if
main
is present. The first isHAS_MAIN
in jsifier, and the second isBuilding.link_lld
. In both cases we get false positives becausemain
is often in EXPORTED_FUNCTIONS even when there is no main.My proposed solution is to force such users to pass a certain link flag (e.g.
-mno-entry
or-fno-entry
) which will allow emscripten to know what type of program is being built.The text was updated successfully, but these errors were encountered: