summaryrefslogtreecommitdiff
path: root/lib/Driver/Distro.cpp
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2018-12-23 15:07:19 +0000
committerMichal Gorny <mgorny@gentoo.org>2018-12-23 15:07:19 +0000
commit40c9a5ffc3ed1bdc20243851b7a0d6eeecf28d5a (patch)
treee4fdce2f35f64469fae393f958fd7b6cf52319ac /lib/Driver/Distro.cpp
parenta6eb16ed631365f3bbadd0450ab52746c151794d (diff)
downloadclang-40c9a5ffc3ed1bdc20243851b7a0d6eeecf28d5a.tar.gz
[Distro] Support detecting Gentoo
Add support for distinguishing plain Gentoo distribution, and a unit test for it. This is going to be used to introduce distro-specific customizations in the driver code; most notably, it is going to be used to disable -faddrsig. Differential Revision: https://reviews.llvm.org/D56024 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350027 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Distro.cpp')
-rw-r--r--lib/Driver/Distro.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Driver/Distro.cpp b/lib/Driver/Distro.cpp
index eb537c87e7..396d0bee56 100644
--- a/lib/Driver/Distro.cpp
+++ b/lib/Driver/Distro.cpp
@@ -138,6 +138,9 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
if (VFS.exists("/etc/arch-release"))
return Distro::ArchLinux;
+ if (VFS.exists("/etc/gentoo-release"))
+ return Distro::Gentoo;
+
return Distro::UnknownDistro;
}