[compiler-rt] r319455 - Fix the MIPS baremetal build
Alexander Richardson via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 30 10:37:05 PST 2017
Author: arichardson
Date: Thu Nov 30 10:37:04 2017
New Revision: 319455
URL: http://llvm.org/viewvc/llvm-project?rev=319455&view=rev
Log:
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
Modified:
compiler-rt/trunk/lib/builtins/clear_cache.c
Modified: compiler-rt/trunk/lib/builtins/clear_cache.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/clear_cache.c?rev=319455&r1=319454&r2=319455&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/clear_cache.c (original)
+++ compiler-rt/trunk/lib/builtins/clear_cache.c Thu Nov 30 10:37:04 2017
@@ -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 *en
#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__)
More information about the llvm-commits
mailing list