[PATCH] D94104: [scudo][standalone] Fix build for Fuchsia

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 5 11:17:24 PST 2021


cryptoad created this revision.
cryptoad added reviewers: pcc, mcgrathr, hctim.
cryptoad requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

Recent changes have introduced code that fails to build on Fuchsia.
This fixes the build by adding non-Linux functions alternatives.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94104

Files:
  compiler-rt/lib/scudo/standalone/memtag.h


Index: compiler-rt/lib/scudo/standalone/memtag.h
===================================================================
--- compiler-rt/lib/scudo/standalone/memtag.h
+++ compiler-rt/lib/scudo/standalone/memtag.h
@@ -52,6 +52,7 @@
 
 #if defined(__aarch64__)
 
+#if SCUDO_LINUX
 inline bool systemSupportsMemoryTagging() {
 #ifndef HWCAP2_MTE
 #define HWCAP2_MTE (1 << 18)
@@ -76,6 +77,10 @@
               prctl(PR_GET_TAGGED_ADDR_CTRL, 0, 0, 0, 0)) &
           PR_MTE_TCF_MASK) != PR_MTE_TCF_NONE;
 }
+#else
+inline bool systemSupportsMemoryTagging() { return false; }
+inline bool systemDetectsMemoryTagFaultsTestOnly() { return false; }
+#endif // SCUDO_LINUX
 
 inline void disableMemoryTagChecksTestOnly() {
   __asm__ __volatile__(".arch_extension mte; msr tco, #1");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94104.314668.patch
Type: text/x-patch
Size: 772 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210105/861db85e/attachment.bin>


More information about the llvm-commits mailing list