Skip to content

Update libraries to LLVM 17.0.2 #20405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a485120
Update libraries to LLVM 17.0.2
aheejin Oct 5, 2023
483e4a5
Add new files
aheejin Oct 6, 2023
c80a439
Merge branch 'main' into llvm_lib_17
aheejin Nov 1, 2023
b70d6b6
Set PSTL mode to serial
aheejin Nov 2, 2023
6b338da
Exclude unnecessary files
aheejin Nov 2, 2023
bfba04f
Disable asm redefinition of sanitizer symbols
aheejin Nov 2, 2023
39fe9aa
lsan fixes
aheejin Nov 3, 2023
4d1f125
_LIBCPP_NO_EXCEPTIONS -> _LIBCPP_HAS_NO_EXCEPTIONS
aheejin Nov 3, 2023
13481e2
Merge branch 'main' into llvm_lib_17
aheejin Nov 3, 2023
d3e2c95
Add declaration for emscripten_builtin_pthread_exit
aheejin Nov 3, 2023
3314475
Merge branch 'main' into llvm_lib_17
aheejin Nov 3, 2023
fd6057d
Merge llvm 17.0.4 release
aheejin Nov 3, 2023
4599d2e
Don't run internal_mprotect in Emscripten
aheejin Nov 3, 2023
32a15cd
Fix emscripten_builtin_pthread_exit's return type
aheejin Nov 3, 2023
20d800d
Fix pthread_exit's interceptor's return type
aheejin Nov 3, 2023
e517a1d
Merge branch 'main' into llvm_lib_17
aheejin Nov 4, 2023
df1306f
Merge branch 'main' into llvm_lib_17
aheejin Nov 7, 2023
200fd09
Add pthread_exit aliases
aheejin Nov 8, 2023
53817b1
Call pthread_attr_getdetachstate after pthread_attr_init
aheejin Nov 8, 2023
a960e6b
Merge branch 'main' into llvm_lib_17
aheejin Nov 8, 2023
0f35588
Guard existing emscripten-specific change with SANITIZER_EMSCRIPTEN
aheejin Nov 8, 2023
5efdf8c
Merge branch 'main' into llvm_lib_17
aheejin Nov 10, 2023
30bf86b
Don't call `__libcpp_verbose_abort`
aheejin Nov 10, 2023
6ba314a
Rebaseline other.test_minimal_runtime_code_size_hello_embind_val
aheejin Nov 10, 2023
56dd7a2
Rebaseline other.test_metadce_files_wasmfs
aheejin Nov 11, 2023
d253912
Rebaseline other.test_metadce_cxx_ctors2
aheejin Nov 11, 2023
e6142e9
Merge branch 'main' into llvm_lib_17
aheejin Nov 11, 2023
9b6f657
Merge branch 'main' into llvm_lib_17
aheejin Nov 11, 2023
f2567a8
Rebaseline test_minimal_runtime_code_size_hello_embind_val again
aheejin Nov 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,18 @@ extern "C" {
is not yet freed. */
int __sanitizer_get_ownership(const volatile void *p);

/* If a pointer lies within an allocation, it will return the start address
of the allocation. Otherwise, it returns nullptr. */
const void *__sanitizer_get_allocated_begin(const void *p);

/* Returns the number of bytes reserved for the pointer p.
Requires (get_ownership(p) == true) or (p == 0). */
size_t __sanitizer_get_allocated_size(const volatile void *p);

/* Returns the number of bytes reserved for the pointer p.
Requires __sanitizer_get_allocated_begin(p) == p. */
size_t __sanitizer_get_allocated_size_fast(const volatile void *p);

/* Number of bytes, allocated and not yet freed by the application. */
size_t __sanitizer_get_current_allocated_bytes(void);

Expand Down
21 changes: 9 additions & 12 deletions system/lib/compiler-rt/include/sanitizer/common_interface_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,26 +129,23 @@ int __sanitizer_acquire_crash_state();
/// state <c>mid == end</c>, so that should be the final state when the
/// container is destroyed or when the container reallocates the storage.
///
/// For ASan, <c><i>beg</i></c> should be 8-aligned and <c><i>end</i></c>
/// should be either 8-aligned or it should point to the end of a separate
/// heap-, stack-, or global-allocated buffer. So the following example will
/// not work:
/// For ASan, <c><i>beg</i></c> no longer needs to be 8-aligned,
/// first and last granule may be shared with other objects
/// and therefore the function can be used for any allocator.
///
/// \code
/// int64_t x[2]; // 16 bytes, 8-aligned
/// char *beg = (char *)&x[0];
/// char *end = beg + 12; // Not 8-aligned, not the end of the buffer
/// \endcode
/// The following example shows how to use the function:
///
/// The following, however, will work:
/// \code
/// int32_t x[3]; // 12 bytes, but 8-aligned under ASan.
/// int32_t x[3]; // 12 bytes
/// char *beg = (char*)&x[0];
/// char *end = beg + 12; // Not 8-aligned, but is the end of the buffer
/// char *end = beg + 12;
/// __sanitizer_annotate_contiguous_container(beg, end, beg, end);
/// \endcode
///
/// \note Use this function with caution and do not use for anything other
/// than vector-like classes.
/// \note Unaligned <c><i>beg</i></c> or <c><i>end</i></c> may miss bugs in
/// these granules.
///
/// \param beg Beginning of memory region.
/// \param end End of memory region.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- sanitizer/asan_interface.h ------------------------------*- C++ -*-===//
//===-- sanitizer/hwasan_interface.h ----------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
123 changes: 123 additions & 0 deletions system/lib/compiler-rt/include/sanitizer/tsan_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,129 @@ int __tsan_on_finalize(int failed);
// Release TSan internal memory in a best-effort manner.
void __tsan_flush_memory();

// User-provided default TSAN options.
const char* __tsan_default_options(void);

// User-provided default TSAN suppressions.
const char* __tsan_default_suppressions(void);

/// Returns a report's description.
///
/// Returns a report's description (issue type), number of duplicate issues
/// found, counts of array data (stack traces, memory operations, locations,
/// mutexes, threads, unique thread IDs) and a stack trace of a <c>sleep()</c>
/// call (if one was involved in the issue).
///
/// \param report Opaque pointer to the current report.
/// \param[out] description Report type description.
/// \param[out] count Count of duplicate issues.
/// \param[out] stack_count Count of stack traces.
/// \param[out] mop_count Count of memory operations.
/// \param[out] loc_count Count of locations.
/// \param[out] mutex_count Count of mutexes.
/// \param[out] thread_count Count of threads.
/// \param[out] unique_tid_count Count of unique thread IDs.
/// \param sleep_trace A buffer to store the stack trace of a <c>sleep()</c>
/// call.
/// \param trace_size Size in bytes of the trace buffer.
/// \returns Returns 1 if successful, 0 if not.
int __tsan_get_report_data(void *report, const char **description, int *count,
int *stack_count, int *mop_count, int *loc_count,
int *mutex_count, int *thread_count,
int *unique_tid_count, void **sleep_trace,
unsigned long trace_size);

/// Returns information about stack traces included in the report.
///
/// \param report Opaque pointer to the current report.
/// \param idx Index to the report's stacks.
/// \param trace A buffer to store the stack trace.
/// \param trace_size Size in bytes of the trace buffer.
/// \returns Returns 1 if successful, 0 if not.
int __tsan_get_report_stack(void *report, unsigned long idx, void **trace,
unsigned long trace_size);

/// Returns information about memory operations included in the report.
///
/// \param report Opaque pointer to the current report.
/// \param idx Index to the report's memory operations.
/// \param[out] tid Thread ID of the memory operation.
/// \param[out] addr Address of the memory operation.
/// \param[out] size Size of the memory operation.
/// \param[out] write Write flag of the memory operation.
/// \param[out] atomic Atomicity flag of the memory operation.
/// \param trace A buffer to store the stack trace.
/// \param trace_size Size in bytes of the trace buffer.
/// \returns Returns 1 if successful, 0 if not.
int __tsan_get_report_mop(void *report, unsigned long idx, int *tid,
void **addr, int *size, int *write, int *atomic,
void **trace, unsigned long trace_size);

/// Returns information about locations included in the report.
///
/// \param report Opaque pointer to the current report.
/// \param idx Index to the report's locations.
/// \param[out] type Type of the location.
/// \param[out] addr Address of the location.
/// \param[out] start Start of the location.
/// \param[out] size Size of the location.
/// \param[out] tid Thread ID of the location.
/// \param[out] fd File descriptor of the location.
/// \param[out] suppressable Suppressable flag.
/// \param trace A buffer to store the stack trace.
/// \param trace_size Size in bytes of the trace buffer.
/// \returns Returns 1 if successful, 0 if not.
int __tsan_get_report_loc(void *report, unsigned long idx, const char **type,
void **addr, void **start, unsigned long *size,
int *tid, int *fd, int *suppressable, void **trace,
unsigned long trace_size);

/// Returns information about mutexes included in the report.
///
/// \param report Opaque pointer to the current report.
/// \param idx Index to the report's mutexes.
/// \param[out] mutex_id Id of the mutex.
/// \param[out] addr Address of the mutex.
/// \param[out] destroyed Destroyed mutex flag.
/// \param trace A buffer to store the stack trace.
/// \param trace_size Size in bytes of the trace buffer.
/// \returns Returns 1 if successful, 0 if not.
int __tsan_get_report_mutex(void *report, unsigned long idx, uint64_t *mutex_id,
void **addr, int *destroyed, void **trace,
unsigned long trace_size);

/// Returns information about threads included in the report.
///
/// \param report Opaque pointer to the current report.
/// \param idx Index to the report's threads.
/// \param[out] tid Thread ID of the thread.
/// \param[out] os_id Operating system's ID of the thread.
/// \param[out] running Running flag of the thread.
/// \param[out] name Name of the thread.
/// \param[out] parent_tid ID of the parent thread.
/// \param trace A buffer to store the stack trace.
/// \param trace_size Size in bytes of the trace buffer.
/// \returns Returns 1 if successful, 0 if not.
int __tsan_get_report_thread(void *report, unsigned long idx, int *tid,
uint64_t *os_id, int *running, const char **name,
int *parent_tid, void **trace,
unsigned long trace_size);

/// Returns information about unique thread IDs included in the report.
///
/// \param report Opaque pointer to the current report.
/// \param idx Index to the report's unique thread IDs.
/// \param[out] tid Unique thread ID of the report.
/// \returns Returns 1 if successful, 0 if not.
int __tsan_get_report_unique_tid(void *report, unsigned long idx, int *tid);

/// Returns the current report.
///
/// If TSan is currently reporting a detected issue on the current thread,
/// returns an opaque pointer to the current report. Otherwise returns NULL.
/// \returns An opaque pointer to the current report. Otherwise returns NULL.
void *__tsan_get_current_report();

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down
Loading