From 23e70e6f577ac3c22c486dbe49d99f115e241956 Mon Sep 17 00:00:00 2001 From: Alexander Richardson Date: Thu, 30 Nov 2017 18:37:04 +0000 Subject: [PATCH] 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 llvm-svn: 319455 --- compiler-rt/lib/builtins/clear_cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-rt/lib/builtins/clear_cache.c b/compiler-rt/lib/builtins/clear_cache.c index 640cb75..4a01cb4 100644 --- a/compiler-rt/lib/builtins/clear_cache.c +++ b/compiler-rt/lib/builtins/clear_cache.c @@ -33,7 +33,7 @@ uintptr_t GetCurrentProcess(void); #include #endif -#if defined(__mips__) +#if defined(__linux__) && defined(__mips__) #include #include #include @@ -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__) -- 2.7.4