-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
release/20.x: [CSKY] Default to unsigned char #126436
Conversation
@zixuan-wu What do you think about merging this PR to the release branch? |
@llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: None (llvmbot) ChangesBackport d204724 Requested by: @arichardson Full diff: https://github.com/llvm/llvm-project/pull/126436.diff 2 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 589de953be5be1b..49c6d2b271b3812 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -1358,6 +1358,7 @@ static bool isSignedCharDefault(const llvm::Triple &Triple) {
return true;
return false;
+ case llvm::Triple::csky:
case llvm::Triple::hexagon:
case llvm::Triple::msp430:
case llvm::Triple::ppcle:
diff --git a/clang/test/Driver/csky-toolchain.c b/clang/test/Driver/csky-toolchain.c
index 66485464652ac87..638ce64ec98cde3 100644
--- a/clang/test/Driver/csky-toolchain.c
+++ b/clang/test/Driver/csky-toolchain.c
@@ -3,6 +3,7 @@
// RUN: %clang -### %s --target=csky 2>&1 | FileCheck -check-prefix=CC1 %s
// CC1: "-cc1" "-triple" "csky"
+// CC1: "-fno-signed-char"
// In the below tests, --rtlib=platform is used so that the driver ignores
// the configure-time CLANG_DEFAULT_RTLIB option when choosing the runtime lib
|
I feel it would make sense to backport this to the release so that Rust built against LLVM20 has a consistent c_char signedness (rust-lang/rust#132975) |
ping @zixuan-wu |
@AaronBallman In case we don't here from @zixuan-wu in time, as the Lead Mantainer for clang what do you think about backporting this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM though this definitely needs a release note so that anyone relying on the old behavior has some amount of notice (and a suggestion as to how to get the old behavior back).
@arichardson Would you be able to create a follow-up PR with the a release note entry? |
Sure, will do this. |
This matches the ABI document found at https://github.com/c-sky/csky-doc/blob/master/C-SKY_V2_CPU_Applications_Binary_Interface_Standards_Manual.pdf Partially addresses llvm#115957 Reviewed By: zixuan-wu Pull Request: llvm#115961 (cherry picked from commit d204724)
@arichardson (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. |
Prior to Clang 20, the CSKY target used an incorrect ABI with |
Backport d204724
Requested by: @arichardson