Skip to content

Commit b994299

Browse files
authored
[libc] Also remove _FORTIFY_SOURCE before including <stdlib.h> in overlay mode. (#142647)
1 parent 5d2e1c0 commit b994299

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

libc/hdr/stdlib_overlay.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
// functions, causing external alias errors. They are guarded by
2020
// `__USE_FORTIFY_LEVEL`, which will be temporarily disabled.
2121

22+
#ifdef _FORTIFY_SOURCE
23+
#define LIBC_OLD_FORTIFY_SOURCE _FORTIFY_SOURCE
24+
#undef _FORTIFY_SOURCE
25+
#endif
26+
2227
#ifdef __USE_FORTIFY_LEVEL
2328
#define LIBC_OLD_USE_FORTIFY_LEVEL __USE_FORTIFY_LEVEL
2429
#undef __USE_FORTIFY_LEVEL
@@ -27,6 +32,11 @@
2732

2833
#include <stdlib.h>
2934

35+
#ifdef LIBC_OLD_FORTIFY_SOURCE
36+
#define _FORTIFY_SOURCE LIBC_OLD_FORTIFY_SOURCE
37+
#undef LIBC_OLD_FORTIFY_SOURCE
38+
#endif
39+
3040
#ifdef LIBC_OLD_USE_FORTIFY_LEVEL
3141
#undef __USE_FORTIFY_LEVEL
3242
#define __USE_FORTIFY_LEVEL LIBC_OLD_USE_FORTIFY_LEVEL

0 commit comments

Comments
 (0)