mirror of
https://abf.rosa.ru/djam/llvm17.git
synced 2025-02-22 21:42:53 +00:00
137 lines
6.1 KiB
Diff
137 lines
6.1 KiB
Diff
.../include/clang/Driver/Distro.h | 9 +++++++++
|
|
.../lib/Driver/Distro.cpp | 9 +++++++++
|
|
.../lib/Driver/ToolChains/Gnu.cpp | 13 ++++++++++---
|
|
.../lib/Driver/ToolChains/Linux.cpp | 5 +++--
|
|
4 files changed, 31 insertions(+), 5 deletions(-)
|
|
|
|
diff --git clang-12.0.1.src/include/clang/Driver/Distro.h clang-12.0.1.src-diff/include/clang/Driver/Distro.h
|
|
index 0e98d00..07d2097 100644
|
|
--- clang-12.0.1.src/include/clang/Driver/Distro.h
|
|
+++ clang-12.0.1.src-diff/include/clang/Driver/Distro.h
|
|
@@ -41,8 +41,10 @@ public:
|
|
RHEL5,
|
|
RHEL6,
|
|
RHEL7,
|
|
+ ROSA,
|
|
Fedora,
|
|
Gentoo,
|
|
+ OpenMandriva,
|
|
OpenSUSE,
|
|
UbuntuHardy,
|
|
UbuntuIntrepid,
|
|
@@ -115,6 +117,10 @@ public:
|
|
return DistroVal == Fedora || (DistroVal >= RHEL5 && DistroVal <= RHEL7);
|
|
}
|
|
|
|
+ bool IsROSA() {
|
|
+ return DistroVal == ROSA;
|
|
+ }
|
|
+
|
|
bool IsOpenSUSE() const { return DistroVal == OpenSUSE; }
|
|
|
|
bool IsDebian() const {
|
|
@@ -129,6 +135,9 @@ public:
|
|
|
|
bool IsGentoo() const { return DistroVal == Gentoo; }
|
|
|
|
+ bool IsMandriva() const {
|
|
+ return DistroVal == OpenMandriva;
|
|
+ }
|
|
/// @}
|
|
};
|
|
|
|
diff --git clang-12.0.1.src/lib/Driver/Distro.cpp clang-12.0.1.src-diff/lib/Driver/Distro.cpp
|
|
index ee4fe84..1385c31 100644
|
|
--- clang-12.0.1.src/lib/Driver/Distro.cpp
|
|
+++ clang-12.0.1.src-diff/lib/Driver/Distro.cpp
|
|
@@ -126,6 +126,15 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
|
|
return Distro::UnknownDistro;
|
|
}
|
|
|
|
+File = VFS.getBufferForFile("/etc/rosa-release");
|
|
+if (File) {
|
|
+ StringRef Data = File.get()->getBuffer();
|
|
+ return Distro::ROSA;
|
|
+
|
|
+ return Distro::UnknownDistro;
|
|
+ }
|
|
+
|
|
+
|
|
// ...for Debian
|
|
File = VFS.getBufferForFile("/etc/debian_version");
|
|
if (File) {
|
|
diff --git clang-12.0.1.src/lib/Driver/ToolChains/Gnu.cpp clang-12.0.1.src-diff/lib/Driver/ToolChains/Gnu.cpp
|
|
index 1d8a3cd..1abd2aa 100644
|
|
--- clang-12.0.1.src/lib/Driver/ToolChains/Gnu.cpp
|
|
+++ clang-12.0.1.src-diff/lib/Driver/ToolChains/Gnu.cpp
|
|
@@ -2075,7 +2075,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"};
|
|
@@ -2085,6 +2087,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"};
|
|
@@ -2103,7 +2107,8 @@ 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 X32LibDirs[] = {"/libx32"};
|
|
static const char *const X86LibDirs[] = {"/lib32", "/lib"};
|
|
static const char *const X86Triples[] = {
|
|
@@ -2112,7 +2117,9 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
|
|
"i586-redhat-linux", "i386-redhat-linux", "i586-suse-linux",
|
|
"i486-slackware-linux", "i686-montavista-linux", "i586-linux-gnu",
|
|
"i686-linux-android", "i386-gnu", "i486-gnu",
|
|
- "i586-gnu", "i686-gnu"};
|
|
+ "i586-gnu", "i686-gnu", "i586-unknown-linux-gnu",
|
|
+ "i586-rosa-linux-gnu", "i686-rosa-linux-gnu", "i586-openmandriva-linux-gnu",
|
|
+ "i686-openmandriva-linux-gnu"};
|
|
|
|
static const char *const MIPSLibDirs[] = {"/lib"};
|
|
static const char *const MIPSTriples[] = {
|
|
diff --git clang-12.0.1.src/lib/Driver/ToolChains/Linux.cpp clang-12.0.1.src-diff/lib/Driver/ToolChains/Linux.cpp
|
|
index 9663a73..e2ca948 100644
|
|
--- clang-12.0.1.src/lib/Driver/ToolChains/Linux.cpp
|
|
+++ clang-12.0.1.src-diff/lib/Driver/ToolChains/Linux.cpp
|
|
@@ -231,7 +231,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");
|
|
}
|
|
@@ -271,6 +271,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");
|
|
@@ -286,7 +287,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
|