mirror of
https://abf.rosa.ru/djam/llvm13.git
synced 2025-02-23 16:32:45 +00:00
122 lines
5.4 KiB
Diff
122 lines
5.4 KiB
Diff
diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h
|
|
index d9909bc..0790ef2 100644
|
|
--- a/clang/include/clang/Driver/Distro.h
|
|
+++ b/clang/include/clang/Driver/Distro.h
|
|
@@ -42,8 +42,10 @@ public:
|
|
RHEL5,
|
|
RHEL6,
|
|
RHEL7,
|
|
+ ROSA,
|
|
Fedora,
|
|
Gentoo,
|
|
+ OpenMandriva,
|
|
OpenSUSE,
|
|
UbuntuHardy,
|
|
UbuntuIntrepid,
|
|
@@ -117,6 +119,10 @@ public:
|
|
return DistroVal == Fedora || (DistroVal >= RHEL5 && DistroVal <= RHEL7);
|
|
}
|
|
|
|
+ bool IsROSA() {
|
|
+ return DistroVal == ROSA;
|
|
+ }
|
|
+
|
|
bool IsOpenSUSE() const { return DistroVal == OpenSUSE; }
|
|
|
|
bool IsDebian() const {
|
|
@@ -131,6 +137,9 @@ public:
|
|
|
|
bool IsGentoo() const { return DistroVal == Gentoo; }
|
|
|
|
+ bool IsMandriva() const {
|
|
+ return DistroVal == OpenMandriva;
|
|
+ }
|
|
/// @}
|
|
};
|
|
|
|
diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp
|
|
index cdb5a17..f697c8c 100644
|
|
--- a/clang/lib/Driver/Distro.cpp
|
|
+++ b/clang/lib/Driver/Distro.cpp
|
|
@@ -44,6 +44,7 @@ static Distro::DistroType DetectOsRelease(llvm::vfs::FileSystem &VFS) {
|
|
.Case("sles", Distro::OpenSUSE)
|
|
.Case("opensuse", Distro::OpenSUSE)
|
|
.Case("exherbo", Distro::Exherbo)
|
|
+ .Case("rosa", Distro::ROSA)
|
|
.Default(Distro::UnknownDistro);
|
|
return Version;
|
|
}
|
|
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
|
|
index c28fe78..8a72332 100644
|
|
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
|
|
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
|
|
@@ -2078,7 +2078,9 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
|
|
static const char *const AArch64LibDirs[] = {"/lib64", "/lib"};
|
|
static const char *const AArch64Triples[] = {
|
|
"aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux",
|
|
- "aarch64-suse-linux", "aarch64-linux-android"};
|
|
+ "aarch64-suse-linux", "aarch64-linux-android", "aarch64-mandriva-linux-gnu",
|
|
+ "aarch64-openmandriva-linux-gnu", "aarch64-openmandriva-linux-musl",
|
|
+ "aarch64-rosa-linux-gnu", "aarch64-rosa-linux-musl"};
|
|
static const char *const AArch64beLibDirs[] = {"/lib"};
|
|
static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu",
|
|
"aarch64_be-linux-gnu"};
|
|
@@ -2088,6 +2090,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
|
|
"arm-linux-androideabi"};
|
|
static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
|
|
"armv7hl-redhat-linux-gnueabi",
|
|
+ "armv7hl-rosa-linux-gnueabi",
|
|
+ "armv7hl-openmandriva-linux-gnueabihf",
|
|
"armv6hl-suse-linux-gnueabi",
|
|
"armv7hl-suse-linux-gnueabi"};
|
|
static const char *const ARMebLibDirs[] = {"/lib"};
|
|
@@ -2106,7 +2110,9 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
|
|
"x86_64-redhat-linux", "x86_64-suse-linux",
|
|
"x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
|
|
"x86_64-slackware-linux", "x86_64-unknown-linux",
|
|
- "x86_64-amazon-linux", "x86_64-linux-android"};
|
|
+ "x86_64-amazon-linux", "x86_64-linux-android",
|
|
+ "x86_64-rosa-linux-gnu", "x86_64-openmandriva-linux-gnu"
|
|
+ };
|
|
static const char *const X32Triples[] = {"x86_64-linux-gnux32",
|
|
"x86_64-pc-linux-gnux32"};
|
|
static const char *const X32LibDirs[] = {"/libx32", "/lib"};
|
|
@@ -2117,6 +2123,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
|
|
"i686-redhat-linux", "i386-redhat-linux",
|
|
"i586-suse-linux", "i686-montavista-linux",
|
|
"i686-linux-android", "i686-gnu",
|
|
+ "i586-rosa-linux-gnu", "i686-rosa-linux-gnu",
|
|
+ "i586-unknown-linux-gnu", "i586-openmandriva-linux-gnu"
|
|
};
|
|
|
|
static const char *const M68kLibDirs[] = {"/lib"};
|
|
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
|
|
index a80b8ad..b69ffda 100644
|
|
--- a/clang/lib/Driver/ToolChains/Linux.cpp
|
|
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
|
|
@@ -194,7 +194,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
|
|
}
|
|
|
|
if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux() ||
|
|
- Triple.isAndroid()) {
|
|
+ Distro.IsROSA() || Distro.IsMandriva() || Triple.isAndroid()) {
|
|
ExtraOpts.push_back("-z");
|
|
ExtraOpts.push_back("relro");
|
|
}
|
|
@@ -233,6 +233,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
|
|
// Hexagon linker/loader does not support .gnu.hash
|
|
if (!IsMips && !IsHexagon) {
|
|
if (Distro.IsRedhat() || Distro.IsOpenSUSE() || Distro.IsAlpineLinux() ||
|
|
+ Distro.IsROSA() || Distro.IsMandriva() ||
|
|
(Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick) ||
|
|
(IsAndroid && !Triple.isAndroidVersionLT(23)))
|
|
ExtraOpts.push_back("--hash-style=gnu");
|
|
@@ -248,7 +249,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
|
|
ExtraOpts.push_back("--build-id");
|
|
#endif
|
|
|
|
- if (IsAndroid || Distro.IsOpenSUSE())
|
|
+ if (IsAndroid || Distro.IsOpenSUSE() || Distro.IsMandriva() || Distro.IsROSA())
|
|
ExtraOpts.push_back("--enable-new-dtags");
|
|
|
|
// The selection of paths to try here is designed to match the patterns which
|