Skip to content

Avoid to emit inline asm for WebAssembly to build as debuggable #5

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

Merged

Conversation

kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented Sep 30, 2019

When I build swift code as debuggable, I got the following error:

error: couldn't allocate input reg for constraint 'r'

This means we can't use InlineAsm with registers because WASM doesn't have registers.
Swift uses InlineAsm to extend lifetime of variable for debugging. So I changed to avoid to use it.

After this change, we can build swift standard library as debuggable via ./utils/build-script --debug.

References

@MaxDesiatov
Copy link

Thank you @kateinoigakukun!

@MaxDesiatov MaxDesiatov merged this pull request into swiftwasm:swiftwasm Oct 15, 2019
MaxDesiatov pushed a commit that referenced this pull request Oct 22, 2019
When I build swift code as debuggable, I got the following error:

```
error: couldn't allocate input reg for constraint 'r'
```

This means we can't use `InlineAsm` with registers because WASM doesn't have registers.
Swift uses `InlineAsm` to extend lifetime of variable for debugging. So I changed to avoid to use it.

After this change, we can build swift standard library as debuggable via `./utils/build-script --debug`.

## References
- https://gcc.gnu.org/onlinedocs/gcc/Simple-Constraints.html#Simple-Constraints
MaxDesiatov pushed a commit that referenced this pull request Nov 14, 2019
When I build swift code as debuggable, I got the following error:

```
error: couldn't allocate input reg for constraint 'r'
```

This means we can't use `InlineAsm` with registers because WASM doesn't have registers.
Swift uses `InlineAsm` to extend lifetime of variable for debugging. So I changed to avoid to use it.

After this change, we can build swift standard library as debuggable via `./utils/build-script --debug`.

## References
- https://gcc.gnu.org/onlinedocs/gcc/Simple-Constraints.html#Simple-Constraints
@MaxDesiatov MaxDesiatov added the enhancement New feature or request label Nov 17, 2019
kateinoigakukun added a commit that referenced this pull request Dec 15, 2019
When I build swift code as debuggable, I got the following error:

```
error: couldn't allocate input reg for constraint 'r'
```

This means we can't use `InlineAsm` with registers because WASM doesn't have registers.
Swift uses `InlineAsm` to extend lifetime of variable for debugging. So I changed to avoid to use it.

After this change, we can build swift standard library as debuggable via `./utils/build-script --debug`.

## References
- https://gcc.gnu.org/onlinedocs/gcc/Simple-Constraints.html#Simple-Constraints
@kateinoigakukun kateinoigakukun deleted the katei/avoid_inline_asm branch January 28, 2020 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants