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

[Bug]: __attribute__((preserve_all)) crashes on aarch64 #1988

Closed
licy183 opened this issue Jan 8, 2024 · 1 comment
Closed

[Bug]: __attribute__((preserve_all)) crashes on aarch64 #1988

licy183 opened this issue Jan 8, 2024 · 1 comment
Labels

Comments

@licy183
Copy link

licy183 commented Jan 8, 2024

Description

Compiling the following source and clang will crash with Unsupported calling convention..

Source:

// test.c
__attribute__((preserve_all)) float bar(float a);

float run(float foo) {
    return bar(foo);
}

Repro:

r26/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android34-clang -c test.c -O2

Crash log:

fatal error: error in backend: Unsupported calling convention.
clang-17: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Android (10552028, +pgo, +bolt, +lto, -mlgo, based on r487747d) clang version 17.0.2 (https://android.googlesource.com/toolchain/llvm-project d9f89f4d16663d5012e5c09495f3b30ece3d2362)
Target: aarch64-unknown-linux-android24
Thread model: posix
InstalledDir: /home/builder/lib/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin
clang-17: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-17: note: diagnostic msg: /tmp/main-538331.c
clang-17: note: diagnostic msg: /tmp/main-538331.sh
clang-17: note: diagnostic msg:

********************

Upstream bug

llvm/llvm-project#58145

Commit to cherry-pick

llvm/llvm-project@d75e70d

Affected versions

r26

Canary version

No response

Host OS

Linux

Host OS version

Ubuntu 22.04

Affected ABIs

arm64-v8a

@licy183 licy183 added the bug label Jan 8, 2024
@pirama-arumuga-nainar
Copy link
Collaborator

Thanks for finding the llvm-project bug and fix. However,

  • this is not a regression from r25
  • the "fix" is to add support for the preserve_all calling convention to aarch64.

Considering this, we shouldn't backport the fix to r26. Please wait for r27.

@DanAlbert DanAlbert moved this to Needs prebuilt update in NDK r27 Jan 16, 2024
@DanAlbert DanAlbert moved this from Needs prebuilt update to Triaged in NDK r27 Jan 16, 2024
@DanAlbert DanAlbert moved this from Triaged to Needs prebuilt update in NDK r27 Jan 16, 2024
@github-project-automation github-project-automation bot moved this from Needs prebuilt update to Merged in NDK r27 Mar 12, 2024
@github-project-automation github-project-automation bot moved this to Prebuilts submitted in LLVM Aug 29, 2024
foxsen pushed a commit to android-la64/platform-ndk that referenced this issue Oct 10, 2024
Bug: android/ndk#1728
Bug: android/ndk#1853
Bug: android/ndk#1928
Bug: android/ndk#1947
Bug: android/ndk#1953
Bug: android/ndk#1963
Bug: android/ndk#1973
Bug: android/ndk#1988
Test: ./checkbuild.py && ./run_tests.py
Change-Id: Ib319c4f80c107e57ede6b6130d81d6d1cd87e22d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Prebuilts submitted
Status: Merged
Development

No branches or pull requests

3 participants