Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Feb 4, 2020

When enabled, wasm-ld will report more detailed information about the
undefined symbols such as which object file/funcion required the
symbols.

This works by generating the list of all possible JS-defined symbols
and passing that list of wasm-ld so it can determine which symbols
are permitted to be undefined.

The cost of this feature is that we run the js compiler twice, once
before wasm-ld and once after the link once wasm-emscripten-finalize
has been run. On my machine this takes around 700 so I'm not enabling
this by default yet.

@sbc100 sbc100 requested a review from kripken February 4, 2020 03:31
@sbc100 sbc100 force-pushed the linker_error_on_missing_symbol branch 2 times, most recently from eac7ad2 to 0995dee Compare February 5, 2020 01:12
emscripten_asm_const_double: function() {},
emscripten_asm_const_int_sync_on_main_thread: function() {},
emscripten_asm_const_double_sync_on_main_thread: function() {},
emscripten_asm_const_async_on_main_thread: function() {},
Copy link
Member

Choose a reason for hiding this comment

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

why is this needed, and why just these functions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Without this change the list of functions in forwarded_json['Functions']['libraryFunctions'] won't include these since (I suppose) it sees them as data rather than functions?

We need the list of include these functions otherwise this new flag won't work with any EM_ASM-using code.

The comment above here says misc definitions to avoid unnecessary unresolved symbols from fastcomp. Which I guess means that fastcomp undefined symbol checker also depends on these, but that is does't care if they are functions of non-functions. I will update the command and apply this change to all those other ones too.

@sbc100 sbc100 force-pushed the linker_error_on_missing_symbol branch from 0995dee to 8dcb54d Compare February 5, 2020 19:23
@sbc100
Copy link
Collaborator Author

sbc100 commented Feb 5, 2020

Should be good to go now.

When enabled, wasm-ld will report more detailed information about the
undefined symbols such as which object file/funcion required the
symbols.

This works by generating the list of all possible JS-defined symbols
and passing that list of wasm-ld so it can determine which symbols
are permitted to be undefined.

The cost of this feature is that we run the js compiler twice, once
before wasm-ld and once after the link once wasm-emscripten-finalize
has been run.  On my machine this takes around 700 so I'm not enabling
this by default yet.
@sbc100 sbc100 force-pushed the linker_error_on_missing_symbol branch from 236c5a8 to 77acb02 Compare February 6, 2020 17:31
@sbc100 sbc100 merged commit 4335e77 into master Feb 6, 2020
@sbc100 sbc100 deleted the linker_error_on_missing_symbol branch February 6, 2020 17:31
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.

3 participants