aboutsummaryrefslogtreecommitdiff
path: root/packages/gcc/13.3.0/0004-Remove-use-of-include_next-from-c-headers.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packages/gcc/13.3.0/0004-Remove-use-of-include_next-from-c-headers.patch')
-rw-r--r--packages/gcc/13.3.0/0004-Remove-use-of-include_next-from-c-headers.patch304
1 files changed, 304 insertions, 0 deletions
diff --git a/packages/gcc/13.3.0/0004-Remove-use-of-include_next-from-c-headers.patch b/packages/gcc/13.3.0/0004-Remove-use-of-include_next-from-c-headers.patch
new file mode 100644
index 00000000..e079849a
--- /dev/null
+++ b/packages/gcc/13.3.0/0004-Remove-use-of-include_next-from-c-headers.patch
@@ -0,0 +1,304 @@
+From 6c7efd415ef2fa5d9f2d8bcd5b30e9faf696d5ca Mon Sep 17 00:00:00 2001
+From: Keith Packard <keithp@keithp.com>
+Date: Sun, 24 Jan 2021 14:20:33 -0800
+Subject: [PATCH] Remove use of include_next from c++ headers
+
+Using include_next bypasses the default header search path and lets
+files later in the include path take priority over earlier files.
+
+This makes replacing libc impossible as the default libc headers will
+occur after the libstdc++ headers, and so be picked up in place of
+headers inserted at the begining of the search path or appended to the
+end of the search path.
+
+Using include_next is a hack to work-around broken combinations of
+libraries, and is not necessary in a well constructed toolchain.
+
+Signed-off-by: Keith Packard <keithp@keithp.com>
+---
+ libstdc++-v3/include/bits/std_abs.h | 4 ++--
+ libstdc++-v3/include/c/cassert | 2 +-
+ libstdc++-v3/include/c/cctype | 2 +-
+ libstdc++-v3/include/c/cerrno | 2 +-
+ libstdc++-v3/include/c/cfloat | 2 +-
+ libstdc++-v3/include/c/climits | 2 +-
+ libstdc++-v3/include/c/clocale | 2 +-
+ libstdc++-v3/include/c/cmath | 2 +-
+ libstdc++-v3/include/c/csetjmp | 2 +-
+ libstdc++-v3/include/c/csignal | 2 +-
+ libstdc++-v3/include/c/cstdarg | 2 +-
+ libstdc++-v3/include/c/cstddef | 2 +-
+ libstdc++-v3/include/c/cstdio | 2 +-
+ libstdc++-v3/include/c/cstdlib | 2 +-
+ libstdc++-v3/include/c/cstring | 2 +-
+ libstdc++-v3/include/c/ctime | 2 +-
+ libstdc++-v3/include/c/cuchar | 2 +-
+ libstdc++-v3/include/c/cwchar | 2 +-
+ libstdc++-v3/include/c/cwctype | 2 +-
+ libstdc++-v3/include/c_global/cmath | 2 +-
+ libstdc++-v3/include/c_global/cstdlib | 2 +-
+ 21 files changed, 22 insertions(+), 22 deletions(-)
+
+diff --git a/libstdc++-v3/include/bits/std_abs.h b/libstdc++-v3/include/bits/std_abs.h
+index c70c8e4edcfc..6a0d5307408a 100644
+--- a/libstdc++-v3/include/bits/std_abs.h
++++ b/libstdc++-v3/include/bits/std_abs.h
+@@ -35,9 +35,9 @@
+ #include <bits/c++config.h>
+
+ #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
+-#include_next <stdlib.h>
++#include <stdlib.h>
+ #ifdef __CORRECT_ISO_CPP_MATH_H_PROTO
+-# include_next <math.h>
++# include <math.h>
+ #endif
+ #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
+
+diff --git a/libstdc++-v3/include/c/cassert b/libstdc++-v3/include/c/cassert
+index abe013725b24..1df12c0af820 100644
+--- a/libstdc++-v3/include/c/cassert
++++ b/libstdc++-v3/include/c/cassert
+@@ -31,4 +31,4 @@
+ #pragma GCC system_header
+
+ #include <bits/c++config.h>
+-#include_next <assert.h>
++#include <assert.h>
+diff --git a/libstdc++-v3/include/c/cctype b/libstdc++-v3/include/c/cctype
+index 234008e328d3..3e259fbc75e9 100644
+--- a/libstdc++-v3/include/c/cctype
++++ b/libstdc++-v3/include/c/cctype
+@@ -31,6 +31,6 @@
+
+ #pragma GCC system_header
+
+-#include_next <ctype.h>
++#include <ctype.h>
+
+ #endif
+diff --git a/libstdc++-v3/include/c/cerrno b/libstdc++-v3/include/c/cerrno
+index 39eb9bbe5d50..e2c2e67356f3 100644
+--- a/libstdc++-v3/include/c/cerrno
++++ b/libstdc++-v3/include/c/cerrno
+@@ -41,7 +41,7 @@
+ #pragma GCC system_header
+
+ #include <bits/c++config.h>
+-#include_next <errno.h>
++#include <errno.h>
+
+ // Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
+ #ifndef errno
+diff --git a/libstdc++-v3/include/c/cfloat b/libstdc++-v3/include/c/cfloat
+index 6d431e8b73ac..176b66b143c3 100644
+--- a/libstdc++-v3/include/c/cfloat
++++ b/libstdc++-v3/include/c/cfloat
+@@ -32,6 +32,6 @@
+ #pragma GCC system_header
+
+ #include <bits/c++config.h>
+-#include_next <float.h>
++#include <float.h>
+
+ #endif
+diff --git a/libstdc++-v3/include/c/climits b/libstdc++-v3/include/c/climits
+index f58d3305dbdc..bd18e7a3b046 100644
+--- a/libstdc++-v3/include/c/climits
++++ b/libstdc++-v3/include/c/climits
+@@ -32,6 +32,6 @@
+ #pragma GCC system_header
+
+ #include <bits/c++config.h>
+-#include_next <limits.h>
++#include <limits.h>
+
+ #endif
+diff --git a/libstdc++-v3/include/c/clocale b/libstdc++-v3/include/c/clocale
+index e498a711b8df..05ce7cec0e72 100644
+--- a/libstdc++-v3/include/c/clocale
++++ b/libstdc++-v3/include/c/clocale
+@@ -31,6 +31,6 @@
+
+ #pragma GCC system_header
+
+-#include_next <locale.h>
++#include <locale.h>
+
+ #endif
+diff --git a/libstdc++-v3/include/c/cmath b/libstdc++-v3/include/c/cmath
+index 261c5cbafdba..3c536f5a0d56 100644
+--- a/libstdc++-v3/include/c/cmath
++++ b/libstdc++-v3/include/c/cmath
+@@ -33,7 +33,7 @@
+
+ #include <bits/c++config.h>
+
+-#include_next <math.h>
++#include <math.h>
+
+ // Get rid of those macros defined in <math.h> in lieu of real functions.
+ #undef abs
+diff --git a/libstdc++-v3/include/c/csetjmp b/libstdc++-v3/include/c/csetjmp
+index 1fd0c71eb722..2df49096ea23 100644
+--- a/libstdc++-v3/include/c/csetjmp
++++ b/libstdc++-v3/include/c/csetjmp
+@@ -31,7 +31,7 @@
+
+ #pragma GCC system_header
+
+-#include_next <setjmp.h>
++#include <setjmp.h>
+
+ // Get rid of those macros defined in <setjmp.h> in lieu of real functions.
+ #undef longjmp
+diff --git a/libstdc++-v3/include/c/csignal b/libstdc++-v3/include/c/csignal
+index ec8b4b5eef34..f5f04720d2a0 100644
+--- a/libstdc++-v3/include/c/csignal
++++ b/libstdc++-v3/include/c/csignal
+@@ -31,6 +31,6 @@
+
+ #pragma GCC system_header
+
+-#include_next <signal.h>
++#include <signal.h>
+
+ #endif
+diff --git a/libstdc++-v3/include/c/cstdarg b/libstdc++-v3/include/c/cstdarg
+index 41752d96e552..f69f27e51fdc 100644
+--- a/libstdc++-v3/include/c/cstdarg
++++ b/libstdc++-v3/include/c/cstdarg
+@@ -32,6 +32,6 @@
+ #pragma GCC system_header
+
+ #undef __need___va_list
+-#include_next <stdarg.h>
++#include <stdarg.h>
+
+ #endif
+diff --git a/libstdc++-v3/include/c/cstddef b/libstdc++-v3/include/c/cstddef
+index c30a34d57d7b..2209bd6b7354 100644
+--- a/libstdc++-v3/include/c/cstddef
++++ b/libstdc++-v3/include/c/cstddef
+@@ -35,6 +35,6 @@
+ #define __need_ptrdiff_t
+ #define __need_NULL
+ #define __need_offsetof
+-#include_next <stddef.h>
++#include <stddef.h>
+
+ #endif
+diff --git a/libstdc++-v3/include/c/cstdio b/libstdc++-v3/include/c/cstdio
+index 28032a2ec9fb..e94a5678bc71 100644
+--- a/libstdc++-v3/include/c/cstdio
++++ b/libstdc++-v3/include/c/cstdio
+@@ -31,7 +31,7 @@
+
+ #pragma GCC system_header
+
+-#include_next <stdio.h>
++#include <stdio.h>
+
+ // Get rid of those macros defined in <stdio.h> in lieu of real functions.
+ #undef clearerr
+diff --git a/libstdc++-v3/include/c/cstdlib b/libstdc++-v3/include/c/cstdlib
+index 473ae22f8840..c8bee71de315 100644
+--- a/libstdc++-v3/include/c/cstdlib
++++ b/libstdc++-v3/include/c/cstdlib
+@@ -31,6 +31,6 @@
+
+ #pragma GCC system_header
+
+-#include_next <stdlib.h>
++#include <stdlib.h>
+
+ #endif
+diff --git a/libstdc++-v3/include/c/cstring b/libstdc++-v3/include/c/cstring
+index 4edc7d9bfdc7..5e8d79fcf189 100644
+--- a/libstdc++-v3/include/c/cstring
++++ b/libstdc++-v3/include/c/cstring
+@@ -31,6 +31,6 @@
+
+ #pragma GCC system_header
+
+-#include_next <string.h>
++#include <string.h>
+
+ #endif
+diff --git a/libstdc++-v3/include/c/ctime b/libstdc++-v3/include/c/ctime
+index 2d478fe9beba..58a55bc18adc 100644
+--- a/libstdc++-v3/include/c/ctime
++++ b/libstdc++-v3/include/c/ctime
+@@ -31,6 +31,6 @@
+
+ #pragma GCC system_header
+
+-#include_next <time.h>
++#include <time.h>
+
+ #endif
+diff --git a/libstdc++-v3/include/c/cuchar b/libstdc++-v3/include/c/cuchar
+index 0ef94430b6f1..a91c7a68ca8a 100644
+--- a/libstdc++-v3/include/c/cuchar
++++ b/libstdc++-v3/include/c/cuchar
+@@ -39,7 +39,7 @@
+ #include <cwchar>
+
+ #if _GLIBCXX_USE_C11_UCHAR_CXX11
+-# include_next <uchar.h>
++# include <uchar.h>
+ #endif
+
+ #endif // C++11
+diff --git a/libstdc++-v3/include/c/cwchar b/libstdc++-v3/include/c/cwchar
+index 8ccc117792bb..6111ad108a79 100644
+--- a/libstdc++-v3/include/c/cwchar
++++ b/libstdc++-v3/include/c/cwchar
+@@ -36,7 +36,7 @@
+ #include <ctime>
+
+ #if _GLIBCXX_HAVE_WCHAR_H
+-#include_next <wchar.h>
++#include <wchar.h>
+ #endif
+
+ // Need to do a bit of trickery here with mbstate_t as char_traits
+diff --git a/libstdc++-v3/include/c/cwctype b/libstdc++-v3/include/c/cwctype
+index 07c02e562b02..63b76873532e 100644
+--- a/libstdc++-v3/include/c/cwctype
++++ b/libstdc++-v3/include/c/cwctype
+@@ -34,7 +34,7 @@
+ #include <bits/c++config.h>
+
+ #if _GLIBCXX_HAVE_WCTYPE_H
+-#include_next <wctype.h>
++#include <wctype.h>
+ #endif
+
+ #endif
+diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath
+index 992713b70da6..165d87f65f7f 100644
+--- a/libstdc++-v3/include/c_global/cmath
++++ b/libstdc++-v3/include/c_global/cmath
+@@ -44,7 +44,7 @@
+ #include <bits/cpp_type_traits.h>
+ #include <ext/type_traits.h>
+ #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
+-#include_next <math.h>
++#include <math.h>
+ #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
+ #include <bits/std_abs.h>
+
+diff --git a/libstdc++-v3/include/c_global/cstdlib b/libstdc++-v3/include/c_global/cstdlib
+index aeb961ad69df..a2c661acd243 100644
+--- a/libstdc++-v3/include/c_global/cstdlib
++++ b/libstdc++-v3/include/c_global/cstdlib
+@@ -76,7 +76,7 @@ namespace std
+ // Need to ensure this finds the C library's <stdlib.h> not a libstdc++
+ // wrapper that might already be installed later in the include search path.
+ #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
+-#include_next <stdlib.h>
++#include <stdlib.h>
+ #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
+ #include <bits/std_abs.h>
+