-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc] temporaliy disable __USE_EXTERN_INLINES and set __USE_FORITFY_LEVEL to 1 before including in overlay mode #113012
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: Job Henandez Lara (Jobhdez) ChangesFull diff: https://github.com/llvm/llvm-project/pull/113012.diff 2 Files Affected:
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
|
libc/hdr/stdio_overlay.h
Outdated
@@ -27,6 +27,17 @@ | |||
#undef _FORTIFY_SOURCE | |||
#endif | |||
|
|||
#ifdef __USE_EXTERN_INLINES | |||
#define LIBC_OLD_EXTERN_INLINES __USE_EXTERN_INLINES |
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.
#define LIBC_OLD_EXTERN_INLINES
is enough, system headers do not set any value for __USE_EXTERN_INLINES
libc/hdr/stdio_overlay.h
Outdated
#endif | ||
|
||
#ifdef LIBC_OLD_USE_EXTERN_INLINES | ||
#define __USE_EXTERN_INLINES LIBC_OLD_USE_EXTERN_INLINES |
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.
#define __USE_EXTERN_INLINES
is enough
✅ With the latest revision this PR passed the C/C++ code formatter. |
No description provided.