summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexander Richardson <arichardson.kde@gmail.com>2017-11-30 18:37:04 +0000
committerAlexander Richardson <arichardson.kde@gmail.com>2017-11-30 18:37:04 +0000
commit650232b9e9880c170e01a2a61b77871a30a245c5 (patch)
tree1419cd1fc33d83d651b0560ed00ce78ac2b1b4e8 /lib
parentbb976694aaafadec6a55a8646da4d7fcc5c74dbe (diff)
Fix the MIPS baremetal build
Summary: Currently sys/cachectl.h is used unconditionally on MIPS although it is only available on Linux and will fail the build when targeting baremetal Reviewers: petarj Reviewed By: petarj Subscribers: sdardis, krytarowski Differential Revision: https://reviews.llvm.org/D40659 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319455 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/builtins/clear_cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/builtins/clear_cache.c b/lib/builtins/clear_cache.c
index 640cb7572..4a01cb46d 100644
--- a/lib/builtins/clear_cache.c
+++ b/lib/builtins/clear_cache.c
@@ -33,7 +33,7 @@ uintptr_t GetCurrentProcess(void);
#include <machine/sysarch.h>
#endif
-#if defined(__mips__)
+#if defined(__linux__) && defined(__mips__)
#include <sys/cachectl.h>
#include <sys/syscall.h>
#include <unistd.h>
@@ -128,7 +128,7 @@ void __clear_cache(void *start, void *end) {
#else
compilerrt_abort();
#endif
-#elif defined(__mips__)
+#elif defined(__linux__) && defined(__mips__)
const uintptr_t start_int = (uintptr_t) start;
const uintptr_t end_int = (uintptr_t) end;
#if defined(__ANDROID__) && defined(__LP64__)