[compiler-rt] a73ca29 - [compiler-rt] Add weak defs for .*contiguous_container.* functions (#120376)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 19 20:19:09 PST 2024
Author: Dmitry Chestnykh
Date: 2024-12-20T07:19:05+03:00
New Revision: a73ca291547cf4f5822a3029dd56315354557517
URL: https://github.com/llvm/llvm-project/commit/a73ca291547cf4f5822a3029dd56315354557517
DIFF: https://github.com/llvm/llvm-project/commit/a73ca291547cf4f5822a3029dd56315354557517.diff
LOG: [compiler-rt] Add weak defs for .*contiguous_container.* functions (#120376)
Fix #120278
Added:
compiler-rt/lib/sanitizer_common/sanitizer_contiguous_container.cpp
Modified:
compiler-rt/lib/sanitizer_common/CMakeLists.txt
compiler-rt/lib/sanitizer_common/sanitizer_common_interface.inc
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/CMakeLists.txt b/compiler-rt/lib/sanitizer_common/CMakeLists.txt
index 09391e4f5f3704..9eb47e21863cb9 100644
--- a/compiler-rt/lib/sanitizer_common/CMakeLists.txt
+++ b/compiler-rt/lib/sanitizer_common/CMakeLists.txt
@@ -4,6 +4,7 @@
set(SANITIZER_SOURCES_NOTERMINATION
sanitizer_allocator.cpp
sanitizer_common.cpp
+ sanitizer_contiguous_container.cpp
sanitizer_deadlock_detector1.cpp
sanitizer_deadlock_detector2.cpp
sanitizer_errno.cpp
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interface.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interface.inc
index 4ea75cdd67cb93..900a99329d56c7 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interface.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interface.inc
@@ -8,18 +8,18 @@
// Sanitizer Common interface list.
//===----------------------------------------------------------------------===//
INTERFACE_FUNCTION(__sanitizer_acquire_crash_state)
-INTERFACE_FUNCTION(__sanitizer_annotate_contiguous_container)
-INTERFACE_FUNCTION(__sanitizer_annotate_double_ended_contiguous_container)
-INTERFACE_FUNCTION(__sanitizer_copy_contiguous_container_annotations)
-INTERFACE_FUNCTION(__sanitizer_contiguous_container_find_bad_address)
-INTERFACE_FUNCTION(
+INTERFACE_WEAK_FUNCTION(__sanitizer_annotate_contiguous_container)
+INTERFACE_WEAK_FUNCTION(__sanitizer_annotate_double_ended_contiguous_container)
+INTERFACE_WEAK_FUNCTION(__sanitizer_copy_contiguous_container_annotations)
+INTERFACE_WEAK_FUNCTION(__sanitizer_contiguous_container_find_bad_address)
+INTERFACE_WEAK_FUNCTION(
__sanitizer_double_ended_contiguous_container_find_bad_address)
INTERFACE_FUNCTION(__sanitizer_set_death_callback)
INTERFACE_FUNCTION(__sanitizer_set_report_path)
INTERFACE_FUNCTION(__sanitizer_set_report_fd)
INTERFACE_FUNCTION(__sanitizer_get_report_path)
-INTERFACE_FUNCTION(__sanitizer_verify_contiguous_container)
-INTERFACE_FUNCTION(__sanitizer_verify_double_ended_contiguous_container)
+INTERFACE_WEAK_FUNCTION(__sanitizer_verify_contiguous_container)
+INTERFACE_WEAK_FUNCTION(__sanitizer_verify_double_ended_contiguous_container)
INTERFACE_WEAK_FUNCTION(__sanitizer_on_print)
INTERFACE_WEAK_FUNCTION(__sanitizer_report_error_summary)
INTERFACE_WEAK_FUNCTION(__sanitizer_sandbox_on_notify)
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_contiguous_container.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_contiguous_container.cpp
new file mode 100644
index 00000000000000..4c093c1d4e9189
--- /dev/null
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_contiguous_container.cpp
@@ -0,0 +1,53 @@
+//===-- sanitizer_contiguous_container.cpp
+//-----------------------------------------------===//
+//
+// 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 provides weak defs of __sanitizer*contiguous_container* functions
+// whose strong implementations can be defined in particular runtime libs
+// of sanitizers
+//
+//===---------------------------------------------------------------------===//
+
+#include "sanitizer_internal_defs.h"
+
+SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_annotate_contiguous_container,
+ const void *, const void *, const void *,
+ const void *) {}
+
+SANITIZER_INTERFACE_WEAK_DEF(
+ void, __sanitizer_annotate_double_ended_contiguous_container, const void *,
+ const void *, const void *, const void *, const void *, const void *) {}
+
+SANITIZER_INTERFACE_WEAK_DEF(void,
+ __sanitizer_copy_contiguous_container_annotations,
+ const void *, const void *, const void *,
+ const void *) {}
+
+SANITIZER_INTERFACE_WEAK_DEF(int, __sanitizer_verify_contiguous_container,
+ const void *, const void *, const void *) {
+ return 0;
+}
+
+SANITIZER_INTERFACE_WEAK_DEF(
+ int, __sanitizer_verify_double_ended_contiguous_container, const void *,
+ const void *, const void *, const void *) {
+ return 0;
+}
+
+SANITIZER_INTERFACE_WEAK_DEF(const void *,
+ __sanitizer_contiguous_container_find_bad_address,
+ const void *, const void *, const void *) {
+ return nullptr;
+}
+
+SANITIZER_INTERFACE_WEAK_DEF(
+ const void *,
+ __sanitizer_double_ended_contiguous_container_find_bad_address,
+ const void *, const void *, const void *, const void *) {
+ return nullptr;
+}
More information about the llvm-commits
mailing list