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

Correct the LLVM target of aarch64-unknown-uefi #134156

Closed
wants to merge 1 commit into from

Conversation

tgross35
Copy link
Contributor

As noticed in #132975 (comment), the LLVM target string for aarch64 UEFI is not correct. Fix it here.

As noticed in [1], the LLVM target string  for aarch64 UEFI is not
correct. Fix it here.

Link: rust-lang#132975 (comment) [1]
@rustbot
Copy link
Collaborator

rustbot commented Dec 11, 2024

r? @chenyukang

rustbot has assigned @chenyukang.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 11, 2024
@rustbot
Copy link
Collaborator

rustbot commented Dec 11, 2024

These commits modify compiler targets.
(See the Target Tier Policy.)

@arichardson
Copy link
Contributor

I just looked at the LLVM source history for the UEFI triple subcomponent - it was added in https://reviews.llvm.org/D131594 (llvm/llvm-project@30198bd). I just looked where the UEFI triple is used and it appears it's only being used for x86.

It looks like it does not work for aarch64:

echo "int x = 1;" | ~/upstream-llvm-project/cmake-build-debug/bin/clang -x c -c - -o /tmp/foo.o -target aarch64-unknown-uefi && file /tmp/foo.o
error: backend data layout 'e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32' does not match expected target description 'e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32'

But it does work for x86_64, so we could update that target info:

❯ echo "int x = 1;" | ~/upstream-llvm-project/cmake-build-debug/bin/clang -x c -c - -o /tmp/foo.o -target x86_64-unknown-uefi && file /tmp/foo.o
/tmp/foo.o: Intel amd64 COFF object file, not stripped, 4 sections, symbol offset=0xb8, 12 symbols, 1st section name ".text"

@arichardson
Copy link
Contributor

CC: @Prabhuk was the UEFI support in LLVM supposed to only support x86 or is AArch64 support planned eventually?

@tgross35
Copy link
Contributor Author

I just found #132570 which does the same thing, plus a couple others. I'll close this one, @arichardson mind taking a look at that PR?

@tgross35 tgross35 closed this Dec 11, 2024
@tgross35 tgross35 deleted the fix-uefi-llvm-target branch December 11, 2024 01:59
@Prabhuk
Copy link

Prabhuk commented Dec 11, 2024

CC: @Prabhuk was the UEFI support in LLVM supposed to only support x86 or is AArch64 support planned eventually?

Yes. Currently only x86_64 is being worked on. The backend patch for it still needs to land which I am hoping will happen by end of the month. AArch64 is the next target I want to work on followed by 32 bit targets. I think the Driver also needs some fixes to provide an error if unsupported UEFI triple is passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants