oss-build-scripts/quilt/qnap/patches/qnap-entware-gcc-8.4.0-ssize_max.patch

25 lines
798 B
Diff

Entware GCC (8.4.0) installs a supposedly fixed ~limits.h~ (in
~/opt/lib/gcc/x86_64-openwrt-linux-gnu/8.4.0/include-fixed/limits.h~, see
https://gcc.gnu.org/onlinedocs/gcc/Fixed-Headers.html) which is the source of a
number of issues due to missing macro definitions.
Observed issues:
* cpython: missing definition of SSIZE_MAX
* abseil-cpp: missing definition of SSIZE_MAX
* llvm:
--- a/opt/lib/gcc/x86_64-openwrt-linux-gnu/8.4.0/include-fixed/limits.h
+++ b/opt/lib/gcc/x86_64-openwrt-linux-gnu/8.4.0/include-fixed/limits.h
@@ -149,4 +149,11 @@
# define ULLONG_WIDTH __LONG_LONG_WIDTH__
#endif
+/*
+ KTKT: Include system/libc limits.h (define _GCC_LIMITS_H_ to avoid recursion
+ in /opt/include/limits.h).
+*/
+#define _GCC_LIMITS_H_
+#include_next <limits.h>
+
#endif /* _LIMITS_H___ */