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

gh-130956: emit AArch64 trampolines only for long jumps #131041

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

diegorusso
Copy link
Contributor

@diegorusso diegorusso commented Mar 10, 2025

Emit the AArch64 trampoline only if the address is more than 27 bits range.
Enable the PLT for Linux AArch64: without it no trampolines are emitted at all and symbols are referenced via the GOT.

Emit the AArch64 trampoline only if the address is more
than 27 bits range.
Enable the PLT for Linux AArch64: without it no trampolines
are emitted at all and symbols are referenced via the GOT.
@@ -507,6 +507,7 @@ def get_target(host: str) -> _COFF | _ELF | _MachO:
# On aarch64 Linux, intrinsics were being emitted and this flag
# was required to disable them.
"-mno-outline-atomics",
"-fplt",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is needed otherwise trampolines are not generated at all and everything is referenced via the GOT. if you prefer, we can have this as separate PR.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, this seems like this slows Linux down. Let's drop it.

@diegorusso diegorusso force-pushed the aarch64-trampolines branch from ff2e45d to efdef5f Compare March 10, 2025 12:10
Copy link
Member

@brandtbucher brandtbucher left a comment

Choose a reason for hiding this comment

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

Yep, looks good!

Looks like it's ~0.4% slower on Linux, and ~0.8% faster on macOS (with 20-25% faster startup!). Maybe, given the results, we should roll back the new -fplt option for Linux? Otherwise, I think this makes sense to land.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants