-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc] Use <assert.h>
in overlay mode for LIBC_ASSERT
#99875
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
Conversation
@llvm/pr-subscribers-libc Author: Joseph Huber (jhuber6) ChangesSummary: Full diff: https://github.com/llvm/llvm-project/pull/99875.diff 1 Files Affected:
diff --git a/libc/src/__support/libc_assert.h b/libc/src/__support/libc_assert.h
index e3235199780c2..72a59f9c0e578 100644
--- a/libc/src/__support/libc_assert.h
+++ b/libc/src/__support/libc_assert.h
@@ -10,7 +10,7 @@
#define LLVM_LIBC_SRC___SUPPORT_LIBC_ASSERT_H
#include "src/__support/macros/config.h"
-#ifdef LIBC_COPT_USE_C_ASSERT
+#if defined(LIBC_COPT_USE_C_ASSERT) || !defined(LIBC_FULL_BUILD)
// The build is configured to just use the public <assert.h> API
// for libc's internal assertions.
@@ -69,6 +69,8 @@ LIBC_INLINE void report_assertion_failure(const char *assertion,
#define __LIBC_MACRO_TO_STR_INDIR(y) __LIBC_MACRO_TO_STR(y)
#define __LIBC_LINE_STR__ __LIBC_MACRO_TO_STR_INDIR(__LINE__)
+#ifdef
+
#define LIBC_ASSERT(COND) \
do { \
if (!(COND)) { \
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look like you will need to update some missing include headers with this change:
In file included from /usr/local/google/home/lntue/experiment/llvm-project/libc/src/__support/threads/linux/mutex.h:17:
/usr/local/google/home/lntue/experiment/llvm-project/libc/src/__support/threads/linux/raw_mutex.h:108:9: error: use of undeclared identifier 'LIBC_LIKELY'
if (LIBC_LIKELY(try_lock()))
No clue why that's not present after this change. |
Summary: This uses `internal::exit` which is not built in overlay mode, leading to linker errors. Fix this to just use `assert.h`.
Should be fixed, something was picking it up accidentally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That fixes it. Thanks!
Summary: This uses `internal::exit` which is not built in overlay mode, leading to linker errors. Fix this to just use `assert.h`. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251138
Summary:
This uses
internal::exit
which is not built in overlay mode, leadingto linker errors. Fix this to just use
assert.h
.