patch-r243830-arm-disable-clear-cache.diff revision 269012
1This patch ensures __clear_cache is not called on arm.  In earlier versions of
2clang, this special builtin was emitted as a function call, leading to link
3errors.
4
5Introduced here: http://svnweb.freebsd.org/changeset/base/243830
6
7Index: lib/Support/Unix/Memory.inc
8===================================================================
9--- lib/Support/Unix/Memory.inc
10+++ lib/Support/Unix/Memory.inc
11@@ -332,7 +332,7 @@ void Memory::InvalidateInstructionCache(const void
12   for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize)
13     asm volatile("icbi 0, %0" : : "r"(Line));
14   asm volatile("isync");
15-#  elif (defined(__arm__) || defined(__aarch64__)) && defined(__GNUC__)
16+#  elif (defined(__arm__) || defined(__aarch64__)) && defined(__GNUC__) && !defined(__FreeBSD__)
17   // FIXME: Can we safely always call this for __GNUC__ everywhere?
18   const char *Start = static_cast<const char *>(Addr);
19   const char *End = Start + Len;
20