Skip to content

[Driver][Sparc] Default to -mcpu=v9 for 32-bit Linux/sparc64 #109278

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

Merged
merged 3 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ code bases.

- The ``le32`` and ``le64`` targets have been removed.

- ``clang -m32`` defaults to ``-mcpu=v9`` on SPARC Linux now. Distros
still supporting SPARC V8 CPUs need to specify ``-mcpu=v8`` with a
`config file
<https://clang.llvm.org/docs/UsersManual.html#configuration-files>`_.

- The ``clang-rename`` tool has been removed.

C/C++ Language Potentially Breaking Changes
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/Driver/ToolChains/Arch/Sparc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ std::string sparc::getSparcTargetCPU(const Driver &D, const ArgList &Args,
return std::string(CPUName);
}

if (Triple.getArch() == llvm::Triple::sparc && Triple.isOSSolaris())
if (Triple.getArch() == llvm::Triple::sparc &&
(Triple.isOSSolaris() || Triple.isOSLinux()))
return "v9";
return "";
}
Expand Down
3 changes: 2 additions & 1 deletion clang/test/Preprocessor/predefined-arch-macros.c
Original file line number Diff line number Diff line change
Expand Up @@ -4137,7 +4137,8 @@
// CHECK_SPARC: #define __sparc__ 1
// CHECK_SPARC-NOT: #define __sparcv9 1
// CHECK_SPARC-NOT: #define __sparcv9__ 1
// CHECK_SPARC: #define __sparcv8 1
// CHECK_SPARC: #define __sparc_v9__ 1
// CHECK_SPARC-NOT: #define __sparcv8 1
// CHECK_SPARC-NOT: #define __sparcv9 1
// CHECK_SPARC-NOT: #define __sparcv9__ 1

Expand Down
Loading