Skip to content

Conversation

@lntue
Copy link
Contributor

@lntue lntue commented Jun 3, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Jun 3, 2025

@llvm/pr-subscribers-libc

Author: None (lntue)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/142647.diff

1 Files Affected:

  • (modified) libc/hdr/stdlib_overlay.h (+10)
diff --git a/libc/hdr/stdlib_overlay.h b/libc/hdr/stdlib_overlay.h
index f095cafe5e0bc..53c32ec0ae332 100644
--- a/libc/hdr/stdlib_overlay.h
+++ b/libc/hdr/stdlib_overlay.h
@@ -19,6 +19,11 @@
 // functions, causing external alias errors.  They are guarded by
 // `__USE_FORTIFY_LEVEL`, which will be temporarily disabled.
 
+#ifdef _FORTIFY_SOURCE
+#define LIBC_OLD_FORTIFY_SOURCE _FORTIFY_SOURCE
+#undef _FORTIFY_SOURCE
+#endif
+
 #ifdef __USE_FORTIFY_LEVEL
 #define LIBC_OLD_USE_FORTIFY_LEVEL __USE_FORTIFY_LEVEL
 #undef __USE_FORTIFY_LEVEL
@@ -27,6 +32,11 @@
 
 #include <stdlib.h>
 
+#ifdef LIBC_OLD_FORTIFY_SOURCE
+#define _FORTIFY_SOURCE LIBC_OLD_FORTIFY_SOURCE
+#undef LIBC_OLD_FORTIFY_SOURCE
+#endif
+
 #ifdef LIBC_OLD_USE_FORTIFY_LEVEL
 #undef __USE_FORTIFY_LEVEL
 #define __USE_FORTIFY_LEVEL LIBC_OLD_USE_FORTIFY_LEVEL

@lntue lntue merged commit b994299 into llvm:main Jun 3, 2025
16 of 17 checks passed
@lntue lntue deleted the stdlib branch June 3, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants