[PATCH] D99381: [compiler-rt][hwasan] Add Fuchsia-specific sanitizer platform limits
Leonard Chan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 25 14:36:22 PDT 2021
leonardchan created this revision.
leonardchan added reviewers: phosek, mcgrathr, pcc, eugenis.
leonardchan added a project: Sanitizers.
Herald added a subscriber: dberris.
leonardchan requested review of this revision.
Herald added a subscriber: Sanitizers.
Fuchsia has it's own platform limits that are separate from posix.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D99381
Files:
compiler-rt/lib/hwasan/hwasan_interceptors.cpp
compiler-rt/lib/hwasan/hwasan_interface_internal.h
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_fuchsia.h
Index: compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_fuchsia.h
===================================================================
--- /dev/null
+++ compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_fuchsia.h
@@ -0,0 +1,25 @@
+//===-- sanitizer_platform_limits_fuchsia.h -------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is a part of Sanitizer common code.
+//
+// Sizes and layouts of platform-specific Fuchsia data structures.
+//===----------------------------------------------------------------------===//
+
+#ifndef SANITIZER_PLATFORM_LIMITS_FUCHSIA_H
+#define SANITIZER_PLATFORM_LIMITS_FUCHSIA_H
+
+#if SANITIZER_FUCHSIA
+
+namespace __sanitizer {
+struct __sanitizer_struct_mallinfo {};
+} // namespace __sanitizer
+
+#endif // SANITIZER_FUCHSIA
+
+#endif
Index: compiler-rt/lib/hwasan/hwasan_interface_internal.h
===================================================================
--- compiler-rt/lib/hwasan/hwasan_interface_internal.h
+++ compiler-rt/lib/hwasan/hwasan_interface_internal.h
@@ -15,7 +15,12 @@
#define HWASAN_INTERFACE_INTERNAL_H
#include "sanitizer_common/sanitizer_internal_defs.h"
+#if SANITIZER_FUCHSIA
+#include "sanitizer_common/sanitizer_platform_limits_fuchsia.h"
+#endif
+#if SANITIZER_POSIX
#include "sanitizer_common/sanitizer_platform_limits_posix.h"
+#endif
#include <link.h>
extern "C" {
Index: compiler-rt/lib/hwasan/hwasan_interceptors.cpp
===================================================================
--- compiler-rt/lib/hwasan/hwasan_interceptors.cpp
+++ compiler-rt/lib/hwasan/hwasan_interceptors.cpp
@@ -21,7 +21,12 @@
#include "hwasan_thread.h"
#include "hwasan_poisoning.h"
#include "hwasan_report.h"
+#if SANITIZER_FUCHSIA
+#include "sanitizer_common/sanitizer_platform_limits_fuchsia.h"
+#endif
+#if SANITIZER_POSIX
#include "sanitizer_common/sanitizer_platform_limits_posix.h"
+#endif
#include "sanitizer_common/sanitizer_allocator.h"
#include "sanitizer_common/sanitizer_allocator_interface.h"
#include "sanitizer_common/sanitizer_allocator_internal.h"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99381.333426.patch
Type: text/x-patch
Size: 2349 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210325/3a9e5fc4/attachment.bin>
More information about the cfe-commits
mailing list