Skip to content

[stable/20250601] Various JIT failure workarounds #11005

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
merged 3 commits into from
Jul 15, 2025

Conversation

AnthonyLatsis
Copy link

@AnthonyLatsis AnthonyLatsis commented Jul 15, 2025

Cherry-picks from stable/20240723 to fix Swift tests on Linux:

rdar://133510063

lhames and others added 3 commits July 15, 2025 14:05
LLVM currently emits dubious symbol sizes for aliases. E.g. assembling
the following with LLVM top-of-tree...

```
$ cat foo.s
        <snip>
        .data
        .globl  base
base:
        .dword  42
        .size   base, 8

.set alias, base+4
```

results in both base and alias having symbol size 8, even alias starts at
base + 4. This also means that alias extends past the end of the .data
section in this example.

We should probably teach LLVM not to do this in the future, but as a short-term
fix this patch teaches JITLink to simply truncate symbols that would extend
past the end of their containing block.

rdar://114207607
(cherry picked from commit 6267697)

Conflicts:
	llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
(cherry picked from commit 2f53a4c)
This change fixed the size of the symbol but the check that emited the
error was still using the old size. Updated to use the correct size,
which will make the code in the if unreachable, but it's probably better
to leave it to avoid merge conflicts.

rdar://133510063
(cherry picked from commit d629b38)
Swift is currently generating multiple .rodata sections with a combination of
SHF_ALLOC and (SHF_ALLOC | SHF_WRITABLE) flags and this was tripping an assert
in the ELFLinkGraphBuilder. As a temporary workaround this patch just uses the
union of the requested permissions.

rdar://114207428
(cherry picked from commit ead32e1)

Conflicts:
	llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
(cherry picked from commit a655fbe)
@AnthonyLatsis
Copy link
Author

@swift-ci please test

@AnthonyLatsis
Copy link
Author

Oh, this doesn’t run Swift tests, or not unless LLDB tests pass.

@AnthonyLatsis AnthonyLatsis merged commit ad50149 into stable/20250601 Jul 15, 2025
0 of 3 checks passed
@AnthonyLatsis AnthonyLatsis deleted the jepa-stable branch July 15, 2025 16:58
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.

4 participants