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

Switch llvm-backend from PIC+Default (small) to Static+Large. #790

Merged
merged 2 commits into from
Sep 16, 2019

Conversation

nlewycky
Copy link
Contributor

@nlewycky nlewycky commented Sep 13, 2019

Description

Should fix flaky test failure:

spectest-a277b7d051ac0dde: /home/nick/llvm-8.0.1.src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:304: void llvm::RuntimeDyldELF::resolveX86_64Relocation(const llvm::SectionEntry&, uint64_t, uint64_t, uint32_t, int64_t, uint64_t): Assertion `isInt<32>(RealOffset)' failed.

(with assertions-enabled LLVM). The relocation in question is a R_X86_64_PC32 with small offset against .rodata.

The switch from Default (small, JITDefault is a different default that we weren't using which is medium) to Large should fix the bug. Once we're using large code model, I think we can switch from PIC to static as either an optimization or a no-op.

Review

  • Create a short description of the the change in the CHANGELOG.md file

@nlewycky nlewycky requested a review from losfair as a code owner September 13, 2019 23:57
@nlewycky
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Sep 14, 2019
@bors
Copy link
Contributor

bors bot commented Sep 14, 2019

try

Build failed

  • wasmerio.wasmer

@nlewycky
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Sep 14, 2019
@bors
Copy link
Contributor

bors bot commented Sep 14, 2019

try

Build succeeded

  • wasmerio.wasmer

@nlewycky
Copy link
Contributor Author

bors r+

bors bot added a commit that referenced this pull request Sep 15, 2019
790: Switch llvm-backend from PIC+Default (small) to Static+Large. r=nlewycky a=nlewycky

# Description

Should fix flaky test failure:
```
spectest-a277b7d051ac0dde: /home/nick/llvm-8.0.1.src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:304: void llvm::RuntimeDyldELF::resolveX86_64Relocation(const llvm::SectionEntry&, uint64_t, uint64_t, uint32_t, int64_t, uint64_t): Assertion `isInt<32>(RealOffset)' failed.
```
(with assertions-enabled LLVM). The relocation in question is a `R_X86_64_PC32` with small offset against `.rodata`.

The switch from Default (small, JITDefault is a different default that we weren't using which is medium) to Large should fix the bug. Once we're using large code model, I think we can switch from PIC to static as either an optimization or a no-op.

# Review

- [x] Create a short description of the the change in the CHANGELOG.md file


Co-authored-by: Nick Lewycky <[email protected]>
@bors
Copy link
Contributor

bors bot commented Sep 15, 2019

Build failed

  • wasmerio.wasmer

@nlewycky nlewycky force-pushed the feature/llvm-large-code-model branch from 82b0e57 to 53db1d4 Compare September 16, 2019 17:49
@nlewycky
Copy link
Contributor Author

On Slack, @losfair suggested that maybe the functions in intrinsics.rs are assumed by LLVM to be in the same code region and it uses PC-relative addressing for them. An alternative would be to add pointers to the VM functions to the context, then perform indirection through them.

@nlewycky
Copy link
Contributor Author

bors r+

bors bot added a commit that referenced this pull request Sep 16, 2019
790: Switch llvm-backend from PIC+Default (small) to Static+Large. r=nlewycky a=nlewycky

# Description

Should fix flaky test failure:
```
spectest-a277b7d051ac0dde: /home/nick/llvm-8.0.1.src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:304: void llvm::RuntimeDyldELF::resolveX86_64Relocation(const llvm::SectionEntry&, uint64_t, uint64_t, uint32_t, int64_t, uint64_t): Assertion `isInt<32>(RealOffset)' failed.
```
(with assertions-enabled LLVM). The relocation in question is a `R_X86_64_PC32` with small offset against `.rodata`.

The switch from Default (small, JITDefault is a different default that we weren't using which is medium) to Large should fix the bug. Once we're using large code model, I think we can switch from PIC to static as either an optimization or a no-op.

# Review

- [x] Create a short description of the the change in the CHANGELOG.md file


Co-authored-by: Nick Lewycky <[email protected]>
@bors
Copy link
Contributor

bors bot commented Sep 16, 2019

Build succeeded

  • wasmerio.wasmer

@bors bors bot merged commit 53db1d4 into master Sep 16, 2019
@bors bors bot deleted the feature/llvm-large-code-model branch September 16, 2019 18:26
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