diff --git a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp --- a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp +++ b/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" diff --git a/compiler-rt/lib/hwasan/hwasan_interface_internal.h b/compiler-rt/lib/hwasan/hwasan_interface_internal.h --- a/compiler-rt/lib/hwasan/hwasan_interface_internal.h +++ b/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 extern "C" { diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_fuchsia.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_fuchsia.h new file mode 100644 --- /dev/null +++ b/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