Skip to content

Commit 8f6f87d

Browse files
committed
Update compiler-rt to llvm-12
1 parent 2f74862 commit 8f6f87d

File tree

270 files changed

+6958
-4260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

270 files changed

+6958
-4260
lines changed

system/lib/compiler-rt/include/sanitizer/asan_interface.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ const char *__asan_get_report_description(void);
188188
/// \param addr Address to locate.
189189
/// \param name Buffer to store the variable's name.
190190
/// \param name_size Size in bytes of the variable's name buffer.
191-
/// \param region_address [out] Address of the region.
192-
/// \param region_size [out] Size of the region in bytes.
191+
/// \param[out] region_address Address of the region.
192+
/// \param[out] region_size Size of the region in bytes.
193193
///
194194
/// \returns Returns the category of the given pointer as a constant string.
195195
const char *__asan_locate_address(void *addr, char *name, size_t name_size,
@@ -204,7 +204,7 @@ const char *__asan_locate_address(void *addr, char *name, size_t name_size,
204204
/// \param addr A heap address.
205205
/// \param trace A buffer to store the stack trace.
206206
/// \param size Size in bytes of the trace buffer.
207-
/// \param thread_id [out] The thread ID of the address.
207+
/// \param[out] thread_id The thread ID of the address.
208208
///
209209
/// \returns Returns the number of stored frames or 0 on error.
210210
size_t __asan_get_alloc_stack(void *addr, void **trace, size_t size,
@@ -219,7 +219,7 @@ size_t __asan_get_alloc_stack(void *addr, void **trace, size_t size,
219219
/// \param addr A heap address.
220220
/// \param trace A buffer to store the stack trace.
221221
/// \param size Size in bytes of the trace buffer.
222-
/// \param thread_id [out] The thread ID of the address.
222+
/// \param[out] thread_id The thread ID of the address.
223223
///
224224
/// \returns Returns the number of stored frames or 0 on error.
225225
size_t __asan_get_free_stack(void *addr, void **trace, size_t size,
@@ -228,8 +228,8 @@ size_t __asan_get_free_stack(void *addr, void **trace, size_t size,
228228
/// Gets the current shadow memory mapping (useful for calling from the
229229
/// debugger).
230230
///
231-
/// \param shadow_scale [out] Shadow scale value.
232-
/// \param shadow_offset [out] Offset value.
231+
/// \param[out] shadow_scale Shadow scale value.
232+
/// \param[out] shadow_offset Offset value.
233233
void __asan_get_shadow_mapping(size_t *shadow_scale, size_t *shadow_offset);
234234

235235
/// This is an internal function that is called to report an error. However,
@@ -302,8 +302,8 @@ void *__asan_get_current_fake_stack(void);
302302
///
303303
/// \param fake_stack An opaque handler to a fake stack.
304304
/// \param addr Address to test.
305-
/// \param beg [out] Beginning of fake frame.
306-
/// \param end [out] End of fake frame.
305+
/// \param[out] beg Beginning of fake frame.
306+
/// \param[out] end End of fake frame.
307307
/// \returns Stack address or NULL.
308308
void *__asan_addr_is_in_fake_stack(void *fake_stack, void *addr, void **beg,
309309
void **end);

system/lib/compiler-rt/include/sanitizer/common_interface_defs.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ void __sanitizer_set_report_path(const char *path);
4343
// Tell the tools to write their reports to the provided file descriptor
4444
// (casted to void *).
4545
void __sanitizer_set_report_fd(void *fd);
46+
// Get the current full report file path, if a path was specified by
47+
// an earlier call to __sanitizer_set_report_path. Returns null otherwise.
48+
const char *__sanitizer_get_report_path();
4649

4750
// Notify the tools that the sandbox is going to be turned on. The reserved
4851
// parameter will be used in the future to hold a structure with functions
@@ -320,7 +323,7 @@ void __sanitizer_print_memory_profile(size_t top_percent,
320323
/// signal callback runs during the switch, it will not benefit from stack
321324
/// use-after-return detection.
322325
///
323-
/// \param fake_stack_save [out] Fake stack save location.
326+
/// \param[out] fake_stack_save Fake stack save location.
324327
/// \param bottom Bottom address of stack.
325328
/// \param size Size of stack in bytes.
326329
void __sanitizer_start_switch_fiber(void **fake_stack_save,
@@ -335,8 +338,8 @@ void __sanitizer_start_switch_fiber(void **fake_stack_save,
335338
/// <c>__sanitizer_start_switch_fiber()</c>.
336339
///
337340
/// \param fake_stack_save Fake stack save location.
338-
/// \param bottom_old [out] Bottom address of old stack.
339-
/// \param size_old [out] Size of old stack in bytes.
341+
/// \param[out] bottom_old Bottom address of old stack.
342+
/// \param[out] size_old Size of old stack in bytes.
340343
void __sanitizer_finish_switch_fiber(void *fake_stack_save,
341344
const void **bottom_old,
342345
size_t *size_old);

system/lib/compiler-rt/include/sanitizer/dfsan_interface.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ dfsan_label dfsan_has_label_with_desc(dfsan_label label, const char *desc);
8080
size_t dfsan_get_label_count(void);
8181

8282
/// Flushes the DFSan shadow, i.e. forgets about all labels currently associated
83-
/// with the application memory. Will work only if there are no other
84-
/// threads executing DFSan-instrumented code concurrently.
85-
/// Use this call to start over the taint tracking within the same procces.
83+
/// with the application memory. Use this call to start over the taint tracking
84+
/// within the same process.
85+
///
86+
/// Note: If another thread is working with tainted data during the flush, that
87+
/// taint could still be written to shadow after the flush.
8688
void dfsan_flush(void);
8789

8890
/// Sets a callback to be invoked on calls to write(). The callback is invoked

system/lib/compiler-rt/include/sanitizer/hwasan_interface.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ extern "C" {
7373
* accessed through the pointer in x, or -1 if the whole range is good. */
7474
intptr_t __hwasan_test_shadow(const volatile void *x, size_t size);
7575

76+
/* Sets the callback function to be called during HWASan error reporting. */
77+
void __hwasan_set_error_report_callback(void (*callback)(const char *));
78+
7679
int __sanitizer_posix_memalign(void **memptr, size_t alignment, size_t size);
7780
void * __sanitizer_memalign(size_t alignment, size_t size);
7881
void * __sanitizer_aligned_alloc(size_t alignment, size_t size);

system/lib/compiler-rt/include/sanitizer/linux_syscall_hooks.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,6 +1845,10 @@
18451845
#define __sanitizer_syscall_post_rt_sigaction(res, signum, act, oldact, sz) \
18461846
__sanitizer_syscall_post_impl_rt_sigaction(res, (long)signum, (long)act, \
18471847
(long)oldact, (long)sz)
1848+
#define __sanitizer_syscall_pre_sigaltstack(ss, oss) \
1849+
__sanitizer_syscall_pre_impl_sigaltstack((long)ss, (long)oss)
1850+
#define __sanitizer_syscall_post_sigaltstack(res, ss, oss) \
1851+
__sanitizer_syscall_post_impl_sigaltstack(res, (long)ss, (long)oss)
18481852

18491853
// And now a few syscalls we don't handle yet.
18501854
#define __sanitizer_syscall_pre_afs_syscall(...)
@@ -1912,7 +1916,6 @@
19121916
#define __sanitizer_syscall_pre_setreuid32(...)
19131917
#define __sanitizer_syscall_pre_set_thread_area(...)
19141918
#define __sanitizer_syscall_pre_setuid32(...)
1915-
#define __sanitizer_syscall_pre_sigaltstack(...)
19161919
#define __sanitizer_syscall_pre_sigreturn(...)
19171920
#define __sanitizer_syscall_pre_sigsuspend(...)
19181921
#define __sanitizer_syscall_pre_stty(...)
@@ -1992,7 +1995,6 @@
19921995
#define __sanitizer_syscall_post_setreuid32(res, ...)
19931996
#define __sanitizer_syscall_post_set_thread_area(res, ...)
19941997
#define __sanitizer_syscall_post_setuid32(res, ...)
1995-
#define __sanitizer_syscall_post_sigaltstack(res, ...)
19961998
#define __sanitizer_syscall_post_sigreturn(res, ...)
19971999
#define __sanitizer_syscall_post_sigsuspend(res, ...)
19982000
#define __sanitizer_syscall_post_stty(res, ...)
@@ -3075,6 +3077,8 @@ void __sanitizer_syscall_pre_impl_rt_sigaction(long signum, long act,
30753077
long oldact, long sz);
30763078
void __sanitizer_syscall_post_impl_rt_sigaction(long res, long signum, long act,
30773079
long oldact, long sz);
3080+
void __sanitizer_syscall_pre_impl_sigaltstack(long ss, long oss);
3081+
void __sanitizer_syscall_post_impl_sigaltstack(long res, long ss, long oss);
30783082
#ifdef __cplusplus
30793083
} // extern "C"
30803084
#endif
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
//===-- sanitizer/memprof_interface.h --------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This file is a part of MemProfiler (MemProf).
10+
//
11+
// Public interface header.
12+
//===----------------------------------------------------------------------===//
13+
#ifndef SANITIZER_MEMPROF_INTERFACE_H
14+
#define SANITIZER_MEMPROF_INTERFACE_H
15+
16+
#include <sanitizer/common_interface_defs.h>
17+
18+
#ifdef __cplusplus
19+
extern "C" {
20+
#endif
21+
/// Records access to a memory region (<c>[addr, addr+size)</c>).
22+
///
23+
/// This memory must be previously allocated by your program.
24+
///
25+
/// \param addr Start of memory region.
26+
/// \param size Size of memory region.
27+
void __memprof_record_access_range(void const volatile *addr, size_t size);
28+
29+
/// Records access to a memory address <c><i>addr</i></c>.
30+
///
31+
/// This memory must be previously allocated by your program.
32+
///
33+
/// \param addr Accessed memory address
34+
void __memprof_record_access(void const volatile *addr);
35+
36+
/// User-provided callback on MemProf errors.
37+
///
38+
/// You can provide a function that would be called immediately when MemProf
39+
/// detects an error. This is useful in cases when MemProf detects an error but
40+
/// your program crashes before the MemProf report is printed.
41+
void __memprof_on_error(void);
42+
43+
/// Prints accumulated statistics to <c>stderr</c> (useful for calling from the
44+
/// debugger).
45+
void __memprof_print_accumulated_stats(void);
46+
47+
/// User-provided default option settings.
48+
///
49+
/// You can provide your own implementation of this function to return a string
50+
/// containing MemProf runtime options (for example,
51+
/// <c>verbosity=1:print_stats=1</c>).
52+
///
53+
/// \returns Default options string.
54+
const char *__memprof_default_options(void);
55+
56+
/// Prints the memory profile to the current profile file.
57+
///
58+
/// \returns 0 on success.
59+
int __memprof_profile_dump(void);
60+
61+
#ifdef __cplusplus
62+
} // extern "C"
63+
#endif
64+
65+
#endif // SANITIZER_MEMPROF_INTERFACE_H

system/lib/compiler-rt/include/sanitizer/msan_interface.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ extern "C" {
114114
call to __msan_scoped_disable_interceptor_checks. */
115115
void __msan_scoped_enable_interceptor_checks(void);
116116

117+
void __msan_start_switch_fiber(const void *bottom, size_t size);
118+
void __msan_finish_switch_fiber(const void **bottom_old, size_t *size_old);
119+
117120
#ifdef __cplusplus
118121
} // extern "C"
119122
#endif

0 commit comments

Comments
 (0)