Skip to content
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

Adjust ASM_CONST indexes when building with -s RELOCATABLE #9747

Merged
merged 1 commit into from
Oct 31, 2019

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Oct 31, 2019

For reloctable code (i.e. MAIN_MODULE) ASM_CONST offsets are relative to
the GLOBAL_BASE.

@sbc100
Copy link
Collaborator Author

sbc100 commented Oct 31, 2019

I should have landed this before: WebAssembly/binaryen#2408

This is now blocking binaryen from rolling in emscripten-releases. Once we land this PR binaryen should be able to roll again.

emscripten.py Outdated
if shared.Settings.RELOCATABLE:
# TODO(sbc): remove this conidtion after
# https://github.com/WebAssembly/binaryen/pull/2408 lands
preamble += '\n if (core > %s) code -= %s;\n' % (shared.Settings.GLOBAL_BASE, shared.Settings.GLOBAL_BASE)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: in general can use '{0} foo {0}'.format(bar) to deduplicate str format args

Not really needed for this temp thing so lgtm as-is

For reloctable code (i.e. MAIN_MODULE) ASM_CONST offsets are relative to
the GLOBAL_BASE.
@sbc100 sbc100 force-pushed the adjustment_for_asmconst branch from b8cdbc1 to 4dc4c64 Compare October 31, 2019 18:37
@sbc100 sbc100 merged commit ea20ce8 into incoming Oct 31, 2019
@sbc100 sbc100 deleted the adjustment_for_asmconst branch October 31, 2019 19:28
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
…ten-core#9747)

For reloctable code (i.e. MAIN_MODULE) ASM_CONST offsets are relative to
the GLOBAL_BASE.
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.

2 participants