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

IRGen: Use indirect relative func-ptr for harvard archs #41995

Conversation

kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented Mar 24, 2022

Harvard architectures like WebAssembly cannot make direct relative function pointer because the referent function and the metadata are in different address spaces and the relative offset between them is not representable.
So we need to force such relative function pointers to always be indirect for those archs.

This change shouldn't affect other than WebAssembly, and Runtime changes will come in another PR

See also: https://forums.swift.org/t/wasm-support/16087/39

Harvard architectures like WebAssembly cannot make direct relative
function pointer because the referent function and the metadata are in
different address spaces, and the relative offset between them is not
representable. So we need to force such relative function pointers to
always be indirect for those archs.
@kateinoigakukun
Copy link
Member Author

@swift-ci Please test

@kateinoigakukun
Copy link
Member Author

preset=buildbot_incremental_linux_crosscompile_wasm
@swift-ci please test with preset Linux Platform

@kateinoigakukun kateinoigakukun marked this pull request as ready for review March 24, 2022 07:03
@MaxDesiatov
Copy link
Member

@swift-ci please test macOS platform

@kateinoigakukun
Copy link
Member Author

From our forum discussion, we are going to use absolute pointer unconditionally #42094

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.

None yet

2 participants