[libc-commits] [libc] [libc] Use `<assert.h>` in overlay mode for LIBC_ASSERT (PR #99875)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Mon Jul 22 06:52:00 PDT 2024


https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/99875

>From e36e131fa8f5efdbd90ab6497be0728b0cdbab1f Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Mon, 22 Jul 2024 08:49:43 -0500
Subject: [PATCH] [libc] Use `<assert.h>` in overlay mode for LIBC_ASSERT

Summary:
This uses `internal::exit` which is not built in overlay mode, leading
to linker errors. Fix this to just use `assert.h`.
---
 libc/src/__support/libc_assert.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/src/__support/libc_assert.h b/libc/src/__support/libc_assert.h
index e3235199780c2..e21a58a0c8aad 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.



More information about the libc-commits mailing list