[libc-commits] [libc] [libcdisable use extern inlines and fortify level (PR #113012)

Job Henandez Lara via libc-commits libc-commits at lists.llvm.org
Fri Oct 18 18:08:48 PDT 2024


https://github.com/Jobhdez created https://github.com/llvm/llvm-project/pull/113012

None

>From c06c029727d950d2b3b4c81b27dd87f8a6520601 Mon Sep 17 00:00:00 2001
From: Job Hernandez <jobhdezlara93 at gmail.com>
Date: Fri, 18 Oct 2024 18:07:37 -0700
Subject: [PATCH] disable use extern inlines and fortify level

---
 libc/hdr/stdio_overlay.h | 21 +++++++++++++++++++++
 libc/hdr/wchar_overlay.h | 21 +++++++++++++++++++++
 2 files changed, 42 insertions(+)

diff --git a/libc/hdr/stdio_overlay.h b/libc/hdr/stdio_overlay.h
index cec55abfde7bf6..9b97fce45787ab 100644
--- a/libc/hdr/stdio_overlay.h
+++ b/libc/hdr/stdio_overlay.h
@@ -27,6 +27,17 @@
 #undef _FORTIFY_SOURCE
 #endif
 
+#ifdef __USE_EXTERN_INLINES
+#define LIBC_OLD_EXTERN_INLINES __USE_EXTERN_INLINES
+#undef __USE_EXTERN_INLINES
+#endif
+
+#ifdef __USE_FORTIFY_LEVEL
+#define LIBC_OLD_USE_FORTIFY_LEVEL __USE_FORTIFY_LEVEL
+#undef __USE_FORTIFY_LEVEL
+#define __USE_FORTIFY_LEVEL 0
+#endif
+
 #ifndef __NO_INLINE__
 #define __NO_INLINE__ 1
 #define LIBC_SET_NO_INLINE
@@ -44,4 +55,14 @@
 #undef LIBC_SET_NO_INLINE
 #endif
 
+#ifdef LIBC_OLD_FORTIFY_LEVEL
+#define __USE_FORTIFY_LEVEL LIBC_OLD_USE_FORTIFY_LEVEL
+#undef LIBC_OLD_USE_FORTIFY_LEVEL
+#endif
+
+#ifdef LIBC_OLD_USE_EXTERN_INLINES
+#define __USE_EXTERN_INLINES LIBC_OLD_USE_EXTERN_INLINES
+#undef LIBC_OLD_USE_EXTERN_INLINES
+#endif
+
 #endif // LLVM_LIBC_HDR_STDIO_OVERLAY_H
diff --git a/libc/hdr/wchar_overlay.h b/libc/hdr/wchar_overlay.h
index a1de9d5085d47b..22777fdf0c2805 100644
--- a/libc/hdr/wchar_overlay.h
+++ b/libc/hdr/wchar_overlay.h
@@ -32,6 +32,17 @@
 #define LIBC_SET_NO_INLINE
 #endif
 
+#ifdef __USE_EXTERN_INLINES
+#define LIBC_OLD_EXTERN_INLINES __USE_EXTERN_INLINES
+#undef __USE_EXTERN_INLINES
+#endif
+
+#ifdef __USE_FORTIFY_LEVEL
+#define LIBC_OLD_USE_FORTIFY_LEVEL __USE_FORTIFY_LEVEL
+#undef __USE_FORTIFY_LEVEL
+#define __USE_FORTIFY_LEVEL 0
+#endif
+
 #include <wchar.h>
 
 #ifdef LIBC_OLD_FORTIFY_SOURCE
@@ -44,4 +55,14 @@
 #undef LIBC_SET_NO_INLINE
 #endif
 
+#ifdef LIBC_OLD_FORTIFY_LEVEL
+#define __USE_FORTIFY_LEVEL LIBC_OLD_USE_FORTIFY_LEVEL
+#undef LIBC_OLD_USE_FORTIFY_LEVEL
+#endif
+
+#ifdef LIBC_OLD_USE_EXTERN_INLINES
+#define __USE_EXTERN_INLINES LIBC_OLD_USE_EXTERN_INLINES
+#undef LIBC_OLD_USE_EXTERN_INLINES
+#endif
+
 #endif // LLVM_LIBC_HDR_WCHAR_OVERLAY_H



More information about the libc-commits mailing list