-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[clang] Updates for support for Ubuntu, Debian and RHEL #162796
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
+15
−29
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
@llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-driver Author: Brad Smith (brad0) ChangesRemove support for long unsupported Ubuntu, Debian and RHEL. Add support for RHEL 8, 9 and 10 and recognize Rocky and Alma Linux Full diff: https://github.com/llvm/llvm-project/pull/162796.diff 2 Files Affected:
diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h
index 008de0dc94b03..9544ab53f7fd9 100644
--- a/clang/include/clang/Driver/Distro.h
+++ b/clang/include/clang/Driver/Distro.h
@@ -30,9 +30,6 @@ class Distro {
// the first and last known member in the family, e.g. IsRedHat().
AlpineLinux,
ArchLinux,
- DebianLenny,
- DebianSqueeze,
- DebianWheezy,
DebianJessie,
DebianStretch,
DebianBuster,
@@ -42,16 +39,13 @@ class Distro {
DebianForky,
DebianDuke,
Exherbo,
- RHEL5,
- RHEL6,
RHEL7,
+ RHEL8,
+ RHEL9,
+ RHEL10,
Fedora,
Gentoo,
OpenSUSE,
- UbuntuMaverick,
- UbuntuNatty,
- UbuntuOneiric,
- UbuntuPrecise,
UbuntuQuantal,
UbuntuRaring,
UbuntuSaucy,
@@ -120,17 +114,17 @@ class Distro {
/// @{
bool IsRedhat() const {
- return DistroVal == Fedora || (DistroVal >= RHEL5 && DistroVal <= RHEL7);
+ return DistroVal == Fedora || DistroVal >= RHEL7 && DistroVal <= RHEL10);
}
bool IsOpenSUSE() const { return DistroVal == OpenSUSE; }
bool IsDebian() const {
- return DistroVal >= DebianLenny && DistroVal <= DebianDuke;
+ return DistroVal >= DebianJessie && DistroVal <= DebianDuke;
}
bool IsUbuntu() const {
- return DistroVal >= UbuntuMaverick && DistroVal <= UbuntuQuesting;
+ return DistroVal >= UbuntuQuantal && DistroVal <= UbuntuQuesting;
}
bool IsAlpineLinux() const { return DistroVal == AlpineLinux; }
diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp
index 8a5a9fc3026a3..b6210888b223b 100644
--- a/clang/lib/Driver/Distro.cpp
+++ b/clang/lib/Driver/Distro.cpp
@@ -61,10 +61,6 @@ static Distro::DistroType DetectLsbRelease(llvm::vfs::FileSystem &VFS) {
if (Version == Distro::UnknownDistro &&
Line.starts_with("DISTRIB_CODENAME="))
Version = llvm::StringSwitch<Distro::DistroType>(Line.substr(17))
- .Case("maverick", Distro::UbuntuMaverick)
- .Case("natty", Distro::UbuntuNatty)
- .Case("oneiric", Distro::UbuntuOneiric)
- .Case("precise", Distro::UbuntuPrecise)
.Case("quantal", Distro::UbuntuQuantal)
.Case("raring", Distro::UbuntuRaring)
.Case("saucy", Distro::UbuntuSaucy)
@@ -118,14 +114,17 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
StringRef Data = File.get()->getBuffer();
if (Data.starts_with("Fedora release"))
return Distro::Fedora;
- if (Data.starts_with("Red Hat Enterprise Linux") ||
- Data.starts_with("CentOS") || Data.starts_with("Scientific Linux")) {
+ if (Data.starts_with("Red Hat Enterprise Linux") || Data.starts_with("CentOS") ||
+ Data.starts_with("Alma Linux") || Data.starts_with("Rocky Linux") ||
+ Data.starts_with("Scientific Linux")) {
+ if (Data.contains("release 10"))
+ return Distro::RHEL10;
+ if (Data.contains("release 9"))
+ return Distro::RHEL9;
+ if (Data.contains("release 8"))
+ return Distro::RHEL8;
if (Data.contains("release 7"))
return Distro::RHEL7;
- else if (Data.contains("release 6"))
- return Distro::RHEL6;
- else if (Data.contains("release 5"))
- return Distro::RHEL5;
}
return Distro::UnknownDistro;
}
@@ -138,12 +137,6 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
int MajorVersion;
if (!Data.split('.').first.getAsInteger(10, MajorVersion)) {
switch (MajorVersion) {
- case 5:
- return Distro::DebianLenny;
- case 6:
- return Distro::DebianSqueeze;
- case 7:
- return Distro::DebianWheezy;
case 8:
return Distro::DebianJessie;
case 9:
@@ -165,8 +158,6 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
}
}
return llvm::StringSwitch<Distro::DistroType>(Data.split("\n").first)
- .Case("squeeze/sid", Distro::DebianSqueeze)
- .Case("wheezy/sid", Distro::DebianWheezy)
.Case("jessie/sid", Distro::DebianJessie)
.Case("stretch/sid", Distro::DebianStretch)
.Case("buster/sid", Distro::DebianBuster)
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
0f81e05 to
55902bf
Compare
2d20cb2 to
a4ec444
Compare
Remove support for long unsupported Ubuntu, Debian and RHEL. Add support for RHEL 8, 9 and 10 and recognize Rocky and AlmaLinux as RHEL.
a4ec444 to
11032a3
Compare
MaskRay
approved these changes
Oct 20, 2025
Lukacma
pushed a commit
to Lukacma/llvm-project
that referenced
this pull request
Oct 29, 2025
Remove support for long unsupported Ubuntu, Debian and RHEL. Add support for RHEL 8, 9 and 10 and recognize Rocky and AlmaLinux as RHEL.
aokblast
pushed a commit
to aokblast/llvm-project
that referenced
this pull request
Oct 30, 2025
Remove support for long unsupported Ubuntu, Debian and RHEL. Add support for RHEL 8, 9 and 10 and recognize Rocky and AlmaLinux as RHEL.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
clang:driver
'clang' and 'clang++' user-facing binaries. Not 'clang-cl'
clang
Clang issues not falling into any other category
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remove support for long unsupported Ubuntu, Debian and RHEL.
Add support for RHEL 8, 9 and 10 and recognize Rocky and AlmaLinux
as RHEL.