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]: clang silently ignores garbage target versions #1728

Closed
DanAlbert opened this issue Jun 21, 2022 · 9 comments
Closed

[Bug]: clang silently ignores garbage target versions #1728

DanAlbert opened this issue Jun 21, 2022 · 9 comments
Assignees
Labels

Comments

@DanAlbert
Copy link
Member

Description

Invalid android versions are silently ignored by clang.

$ ~/Library/Android/sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -target aarch64-linux-android31 -dM -E - < /dev/null | grep __ANDROID_MIN_SDK_VERSION__
#define __ANDROID_API__ __ANDROID_MIN_SDK_VERSION__
#define __ANDROID_MIN_SDK_VERSION__ 31
$ ~/Library/Android/sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -target aarch64-linux-androidS -dM -E - < /dev/null | grep __ANDROID_MIN_SDK_VERSION__
# Not set.

In the second case, android/api-level.h (which will be included transitively by any file that includes any libc header) will set __ANDROID_API__ to __ANDROID_API_FUTURE__ (AKA 10000), but won't set __ANDROID_MIN_SDK_VERSION__ at all.

Upstream bug

No response

Commit to cherry-pick

No response

Affected versions

r24, r25, Canary

Canary version

No response

Host OS

Linux, Mac, Windows

Host OS version

all

Affected ABIs

armeabi-v7a, arm64-v8a, x86, x86_64

@DanAlbert DanAlbert added the bug label Jun 21, 2022
@DanAlbert DanAlbert moved this to Triaged in NDK r26 Jun 21, 2022
@rprichard
Copy link
Collaborator

Also see internal issue, http://b/236753843 (Platform build system passes codename for clang -target, which expects an integer).

@DanAlbert DanAlbert removed this from NDK r26 Apr 20, 2023
@appujee appujee self-assigned this May 24, 2023
@appujee
Copy link
Collaborator

appujee commented May 24, 2023

good task for intern so i'm claiming it.

@enh-google
Copy link
Collaborator

see also internal issue http://b/315788463 where this is still silently breaking things internally 1.5 years later...

@appujee
Copy link
Collaborator

appujee commented Dec 26, 2023

Even options like ./bin/clang a.cpp -c -target i686-linux-andfasdf compile silently.

@ZijunZhaoCCK
Copy link
Collaborator

Even options like ./bin/clang a.cpp -c -target i686-linux-andfasdf compile silently.

Now I just detect the version after android. How about making it a followup?

@appujee
Copy link
Collaborator

appujee commented Jan 5, 2024

yeah sure.

@pirama-arumuga-nainar
Copy link
Collaborator

@ZijunZhaoCCK fixed the "invalid version" parts in llvm/llvm-project#75373. We will pull this into the next release. There is follow-up to detect invalid "environments" (i686-linux-andfasdf).

@DanAlbert
Copy link
Member Author

@pirama-arumuga-nainar since it was merged last week, you mean the next-next release, right? r28? Or is that going to be cherry-picked into the r27 toolchain?

@pirama-arumuga-nainar
Copy link
Collaborator

We can cherry-pick to the r27 toolchain.

@DanAlbert DanAlbert moved this 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
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

6 participants