Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
2845 lines (2794 sloc) 98.4 KB
diff -N -u -r -w gcc-8.2.0/fixincludes/fixincl.x gcc-8.2.0-patched/fixincludes/fixincl.x
--- gcc-8.2.0/fixincludes/fixincl.x 2018-02-22 16:12:26.000000000 +0000
+++ gcc-8.2.0-patched/fixincludes/fixincl.x 2019-08-08 09:38:28.000000000 +0000
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed February 22, 2018 at 03:46:51 PM by AutoGen 5.18
+ * It has been AutoGen-ed June 1, 2019 at 12:13:46 AM by AutoGen 5.18.12
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Feb 22 15:46:51 UTC 2018
+/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Jun 1 00:13:46 BST 2019
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -15,7 +15,7 @@
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
- * This file contains 249 fixup descriptions.
+ * This file contains 259 fixup descriptions.
*
* See README for more information.
*
@@ -5622,6 +5622,211 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Irix_Stdio_Va_List fix
+ */
+tSCC zIrix_Stdio_Va_ListName[] =
+ "irix_stdio_va_list";
+
+/*
+ * File name selection pattern
+ */
+tSCC zIrix_Stdio_Va_ListList[] =
+ "stdio.h\0internal/stdio_core.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzIrix_Stdio_Va_ListMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zIrix_Stdio_Va_ListSelect0[] =
+ "/\\* va_list \\*/ char \\*";
+
+#define IRIX_STDIO_VA_LIST_TEST_CT 1
+static tTestDesc aIrix_Stdio_Va_ListTests[] = {
+ { TT_EGREP, zIrix_Stdio_Va_ListSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Irix_Stdio_Va_List
+ */
+static const char* apzIrix_Stdio_Va_ListPatch[] = {
+ "format",
+ "__gnuc_va_list",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Irix___Restrict fix
+ */
+tSCC zIrix___RestrictName[] =
+ "irix___restrict";
+
+/*
+ * File name selection pattern
+ */
+tSCC zIrix___RestrictList[] =
+ "internal/sgimacros.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzIrix___RestrictMachs[] = {
+ "mips-sgi-irix6.5",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zIrix___RestrictSelect0[] =
+ "(#ifdef __c99\n\
+)(#[ \t]*define __restrict restrict)";
+
+#define IRIX___RESTRICT_TEST_CT 1
+static tTestDesc aIrix___RestrictTests[] = {
+ { TT_EGREP, zIrix___RestrictSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Irix___Restrict
+ */
+static const char* apzIrix___RestrictPatch[] = {
+ "format",
+ "%1# ifndef __cplusplus\n\
+%2\n\
+# endif",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Irix___Generic1 fix
+ */
+tSCC zIrix___Generic1Name[] =
+ "irix___generic1";
+
+/*
+ * File name selection pattern
+ */
+tSCC zIrix___Generic1List[] =
+ "internal/math_core.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzIrix___Generic1Machs[] = {
+ "mips-sgi-irix6.5",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zIrix___Generic1Select0[] =
+ "#define ([a-z]+)\\(x\\) *__generic.*";
+
+#define IRIX___GENERIC1_TEST_CT 1
+static tTestDesc aIrix___Generic1Tests[] = {
+ { TT_EGREP, zIrix___Generic1Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Irix___Generic1
+ */
+static const char* apzIrix___Generic1Patch[] = {
+ "format",
+ "extern int %1(double);\n\
+extern int %1f(float);\n\
+extern int %1l(long double);\n\
+#if !defined(__cplusplus)\n\
+#define %1(x) (sizeof(x) == sizeof(double) ? _%1(x) \\\n\
+ : sizeof(x) == sizeof(float) ? _%1f(x) \\\n\
+ : _%1l(x))\n\
+#else\n\
+namespace std\n\
+{\n\
+ inline int %1(double x) { return _%1(x); };\n\
+ inline int %1f(float x) { return _%1f(x); };\n\
+ inline int %1l(long double x) { return _%1l(x); };\n\
+}\n\
+#endif\n",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Irix___Generic2 fix
+ */
+tSCC zIrix___Generic2Name[] =
+ "irix___generic2";
+
+/*
+ * File name selection pattern
+ */
+tSCC zIrix___Generic2List[] =
+ "internal/math_core.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzIrix___Generic2Machs[] = {
+ "mips-sgi-irix6.5",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zIrix___Generic2Select0[] =
+ "#define ([a-z]+)\\(x,y\\) *__generic.*";
+
+#define IRIX___GENERIC2_TEST_CT 1
+static tTestDesc aIrix___Generic2Tests[] = {
+ { TT_EGREP, zIrix___Generic2Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Irix___Generic2
+ */
+static const char* apzIrix___Generic2Patch[] = {
+ "format",
+ "#define %1(x,y) \\\n\
+ ((sizeof(x)<=4 && sizeof(y)<=4) ? _%1f(x,y) \\\n\
+ : (sizeof(x)<=8 && sizeof(y)<=8) ? _%1(x,y) \\\n\
+ : _%1l(x,y))\n",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Irix_Complex fix
+ */
+tSCC zIrix_ComplexName[] =
+ "irix_complex";
+
+/*
+ * File name selection pattern
+ */
+tSCC zIrix_ComplexList[] =
+ "complex.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzIrix_ComplexMachs[] = {
+ "mips-sgi-irix6.5",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zIrix_ComplexSelect0[] =
+ "#define[ \t]_Complex_I[ \t]\\(\\(float[ \t]_Complex\\)[ \t]\\(__I__\\)\\)";
+
+#define IRIX_COMPLEX_TEST_CT 1
+static tTestDesc aIrix_ComplexTests[] = {
+ { TT_EGREP, zIrix_ComplexSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Irix_Complex
+ */
+static const char* apzIrix_ComplexPatch[] = { sed_cmd_z,
+ "-e", "s/#define[ \t]_Complex_I[ \t]((float[ \t]_Complex)[ \t](__I__))/#define _Complex_I (__extension__ 1.0iF)/",
+ "-e", "/#define[ \t]imaginary[ \t]_Imaginary/d",
+ "-e", "/#define[ \t]_Imaginary_I/d",
+ "-e", "s/#define[ \t]I[ \t]_Imaginary_I/#define I _Complex_I/",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Irix_Limits_Const fix
*/
tSCC zIrix_Limits_ConstName[] =
@@ -5657,37 +5862,236 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Irix_Stdio_Va_List fix
+ * Description of Irix_Pthread_Init fix
*/
-tSCC zIrix_Stdio_Va_ListName[] =
- "irix_stdio_va_list";
+tSCC zIrix_Pthread_InitName[] =
+ "irix_pthread_init";
/*
* File name selection pattern
*/
-tSCC zIrix_Stdio_Va_ListList[] =
- "stdio.h\0";
+tSCC zIrix_Pthread_InitList[] =
+ "pthread.h\0";
/*
* Machine/OS name selection pattern
*/
-#define apzIrix_Stdio_Va_ListMachs (const char**)NULL
+tSCC* apzIrix_Pthread_InitMachs[] = {
+ "mips-sgi-irix6.5",
+ (const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
-tSCC zIrix_Stdio_Va_ListSelect0[] =
- "/\\* va_list \\*/ char \\*";
+tSCC zIrix_Pthread_InitSelect0[] =
+ "^(#define[ \t]+PTHREAD_.*_INITIALIZER[ \t]+)(\\{ 0 \\})";
-#define IRIX_STDIO_VA_LIST_TEST_CT 1
-static tTestDesc aIrix_Stdio_Va_ListTests[] = {
- { TT_EGREP, zIrix_Stdio_Va_ListSelect0, (regex_t*)NULL }, };
+#define IRIX_PTHREAD_INIT_TEST_CT 1
+static tTestDesc aIrix_Pthread_InitTests[] = {
+ { TT_EGREP, zIrix_Pthread_InitSelect0, (regex_t*)NULL }, };
/*
- * Fix Command Arguments for Irix_Stdio_Va_List
+ * Fix Command Arguments for Irix_Pthread_Init
*/
-static const char* apzIrix_Stdio_Va_ListPatch[] = {
+static const char* apzIrix_Pthread_InitPatch[] = {
"format",
- "__gnuc_va_list",
+ "%1{ %2 }",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Irix_Socklen_T fix
+ */
+tSCC zIrix_Socklen_TName[] =
+ "irix_socklen_t";
+
+/*
+ * File name selection pattern
+ */
+tSCC zIrix_Socklen_TList[] =
+ "sys/socket.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzIrix_Socklen_TMachs[] = {
+ "mips-sgi-irix6.5",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zIrix_Socklen_TSelect0[] =
+ "(#define _SOCKLEN_T\n\
+)(typedef u_int32_t socklen_t;)";
+
+#define IRIX_SOCKLEN_T_TEST_CT 1
+static tTestDesc aIrix_Socklen_TTests[] = {
+ { TT_EGREP, zIrix_Socklen_TSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Irix_Socklen_T
+ */
+static const char* apzIrix_Socklen_TPatch[] = {
+ "format",
+ "%1#if _NO_XOPEN4 && _NO_XOPEN5\n\
+typedef int socklen_t;\n\
+#else\n\
+%2\n\
+#endif /* _NO_XOPEN4 && _NO_XOPEN5 */",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Irix_Stdint_C99_Mode fix
+ */
+tSCC zIrix_Stdint_C99_ModeName[] =
+ "irix_stdint_c99_mode";
+
+/*
+ * File name selection pattern
+ */
+tSCC zIrix_Stdint_C99_ModeList[] =
+ "stdint.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzIrix_Stdint_C99_ModeMachs[] = {
+ "mips-sgi-irix6.5",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zIrix_Stdint_C99_ModeSelect0[] =
+ "(#ifndef __c99\n\
+)(#error This header file is to be used only for c99 mode compilations)";
+
+#define IRIX_STDINT_C99_MODE_TEST_CT 1
+static tTestDesc aIrix_Stdint_C99_ModeTests[] = {
+ { TT_EGREP, zIrix_Stdint_C99_ModeSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Irix_Stdint_C99_Mode
+ */
+static const char* apzIrix_Stdint_C99_ModePatch[] = {
+ "format",
+ "#if 0\n\
+%2",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Irix_Stdint_C99_Types fix
+ */
+tSCC zIrix_Stdint_C99_TypesName[] =
+ "irix_stdint_c99_types";
+
+/*
+ * File name selection pattern
+ */
+tSCC zIrix_Stdint_C99_TypesList[] =
+ "stdint-irix65.h\0stdint.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzIrix_Stdint_C99_TypesMachs[] = {
+ "mips-sgi-irix6.5",
+ (const char*)NULL };
+#define IRIX_STDINT_C99_TYPES_TEST_CT 0
+#define aIrix_Stdint_C99_TypesTests (tTestDesc*)NULL
+
+/*
+ * Fix Command Arguments for Irix_Stdint_C99_Types
+ */
+static const char* apzIrix_Stdint_C99_TypesPatch[] = { sed_cmd_z,
+ "-e", "s@^#define INT64_MIN.*(-0x7fffffffffffffff - 1)$@#define INT64_MIN (-0x7fffffffffffffffLL - 1)@",
+ "-e", "s@^#define INT64_MAX.*0x7fffffffffffffff$@#define INT64_MAX 0x7fffffffffffffffLL@",
+ "-e", "s@^#define UINT32_MAX.*0xffffffff$@#define UINT32_MAX 0xffffffffU@",
+ "-e", "s@^#define UINT64_MAX.*0xffffffffffffffff$@#define UINT64_MAX 0xffffffffffffffffULL@",
+ "-e", "s@^#define INTPTR_MIN.*INT32_MIN$@#define INTPTR_MIN (-0x7fffffffL - 1)@",
+ "-e", "s@^#define INTPTR_MAX.*INT32_MAX$@#define INTPTR_MAX 0x7fffffffL@",
+ "-e", "s@^#define UINTPTR_MAX.*UINT32_MAX$@#define UINTPTR_MAX 0xffffffffUL@",
+ "-e", "s@^#define INTPTR_MIN.*INT64_MIN@#define INTPTR_MIN (-0x7fffffffffffffffL - 1)@",
+ "-e", "s@^#define INTPTR_MAX.*INT64_MAX$@#define INTPTR_MAX 0x7fffffffffffffffL@",
+ "-e", "s@^#define UINTPTR_MAX.*UINT64_MAX$@#define UINTPTR_MAX 0xffffffffffffffffUL@",
+ "-e", "s@^#define PTRDIFF_MIN.*INT64_MIN$@#define PTRDIFF_MIN (-0x7fffffffffffffffL - 1)@",
+ "-e", "s@^#define PTRDIFF_MAX.*INT64_MAX$@#define PTRDIFF_MAX 0x7fffffffffffffffL@",
+ "-e", "s@^#define SIZE_MAX.*UINT64_MAX$@#define SIZE_MAX 0xffffffffffffffffUL@",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Irix_Stdint_C99_Macros fix
+ */
+tSCC zIrix_Stdint_C99_MacrosName[] =
+ "irix_stdint_c99_macros";
+
+/*
+ * File name selection pattern
+ */
+tSCC zIrix_Stdint_C99_MacrosList[] =
+ "stdint-irix65.h\0stdint.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzIrix_Stdint_C99_MacrosMachs[] = {
+ "mips-sgi-irix6.5",
+ (const char*)NULL };
+#define IRIX_STDINT_C99_MACROS_TEST_CT 0
+#define aIrix_Stdint_C99_MacrosTests (tTestDesc*)NULL
+
+/*
+ * Fix Command Arguments for Irix_Stdint_C99_Macros
+ */
+static const char* apzIrix_Stdint_C99_MacrosPatch[] = { sed_cmd_z,
+ "-e", "s@^#define INT8_C(x).*int.*_t.*$@#define INT8_C(x) (x)@",
+ "-e", "s@^#define INT16_C(x).*int.*_t.*$@#define INT16_C(x) (x)@",
+ "-e", "s@^#define INT32_C(x).*int.*_t.*$@#define INT32_C(x) (x)@",
+ "-e", "s@^#define INT64_C(x).*int.*_t.*$@#define INT64_C(x) (x ## LL)@",
+ "-e", "s@^#define UINT8_C(x).*int.*_t.*$@#define UINT8_C(x) (x)@",
+ "-e", "s@^#define UINT16_C(x).*int.*_t.*$@#define UINT16_C(x) (x)@",
+ "-e", "s@^#define UINT32_C(x).*int.*_t.*$@#define UINT32_C(x) (x ## U)@",
+ "-e", "s@^#define UINT64_C(x).*int.*_t.*$@#define UINT64_C(x) (x ## ULL)@",
+ "-e", "s@^#define INTMAX_C(x).*int.*_t.*$@#define INTMAX_C(x) (x ## LL)@",
+ "-e", "s@^#define UINTMAX_C(x).*int.*_t.*$@#define UINTMAX_C(x) (x ## ULL)@",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Irix_Wcsftime fix
+ */
+tSCC zIrix_WcsftimeName[] =
+ "irix_wcsftime";
+
+/*
+ * File name selection pattern
+ */
+tSCC zIrix_WcsftimeList[] =
+ "internal/wchar_core.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzIrix_WcsftimeMachs[] = {
+ "mips-sgi-irix6.5",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zIrix_WcsftimeSelect0[] =
+ "#if _NO_XOPEN5\n\
+(extern size_t[ \t]+wcsftime.*const char *.*)";
+
+#define IRIX_WCSFTIME_TEST_CT 1
+static tTestDesc aIrix_WcsftimeTests[] = {
+ { TT_EGREP, zIrix_WcsftimeSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Irix_Wcsftime
+ */
+static const char* apzIrix_WcsftimePatch[] = {
+ "format",
+ "#if _NO_XOPEN5 && !defined(__c99)\n\
+%1",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -10099,9 +10503,9 @@
*
* List of all fixes
*/
-#define REGEX_COUNT 287
+#define REGEX_COUNT 295
#define MACH_LIST_SIZE_LIMIT 187
-#define FIX_COUNT 249
+#define FIX_COUNT 259
/*
* Enumerate the fixes
@@ -10243,8 +10647,18 @@
IO_QUOTES_DEF_FIXIDX,
IO_QUOTES_USE_FIXIDX,
IP_MISSING_SEMI_FIXIDX,
- IRIX_LIMITS_CONST_FIXIDX,
IRIX_STDIO_VA_LIST_FIXIDX,
+ IRIX___RESTRICT_FIXIDX,
+ IRIX___GENERIC1_FIXIDX,
+ IRIX___GENERIC2_FIXIDX,
+ IRIX_COMPLEX_FIXIDX,
+ IRIX_LIMITS_CONST_FIXIDX,
+ IRIX_PTHREAD_INIT_FIXIDX,
+ IRIX_SOCKLEN_T_FIXIDX,
+ IRIX_STDINT_C99_MODE_FIXIDX,
+ IRIX_STDINT_C99_TYPES_FIXIDX,
+ IRIX_STDINT_C99_MACROS_FIXIDX,
+ IRIX_WCSFTIME_FIXIDX,
KANDR_CONCAT_FIXIDX,
LINUX_IA64_UCONTEXT_FIXIDX,
LYNXOS_NO_WARNING_IN_SYS_TIME_H_FIXIDX,
@@ -11039,15 +11453,65 @@
IP_MISSING_SEMI_TEST_CT, FD_MACH_ONLY,
aIp_Missing_SemiTests, apzIp_Missing_SemiPatch, 0 },
+ { zIrix_Stdio_Va_ListName, zIrix_Stdio_Va_ListList,
+ apzIrix_Stdio_Va_ListMachs,
+ IRIX_STDIO_VA_LIST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aIrix_Stdio_Va_ListTests, apzIrix_Stdio_Va_ListPatch, 0 },
+
+ { zIrix___RestrictName, zIrix___RestrictList,
+ apzIrix___RestrictMachs,
+ IRIX___RESTRICT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aIrix___RestrictTests, apzIrix___RestrictPatch, 0 },
+
+ { zIrix___Generic1Name, zIrix___Generic1List,
+ apzIrix___Generic1Machs,
+ IRIX___GENERIC1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aIrix___Generic1Tests, apzIrix___Generic1Patch, 0 },
+
+ { zIrix___Generic2Name, zIrix___Generic2List,
+ apzIrix___Generic2Machs,
+ IRIX___GENERIC2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aIrix___Generic2Tests, apzIrix___Generic2Patch, 0 },
+
+ { zIrix_ComplexName, zIrix_ComplexList,
+ apzIrix_ComplexMachs,
+ IRIX_COMPLEX_TEST_CT, FD_MACH_ONLY,
+ aIrix_ComplexTests, apzIrix_ComplexPatch, 0 },
+
{ zIrix_Limits_ConstName, zIrix_Limits_ConstList,
apzIrix_Limits_ConstMachs,
IRIX_LIMITS_CONST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aIrix_Limits_ConstTests, apzIrix_Limits_ConstPatch, 0 },
- { zIrix_Stdio_Va_ListName, zIrix_Stdio_Va_ListList,
- apzIrix_Stdio_Va_ListMachs,
- IRIX_STDIO_VA_LIST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
- aIrix_Stdio_Va_ListTests, apzIrix_Stdio_Va_ListPatch, 0 },
+ { zIrix_Pthread_InitName, zIrix_Pthread_InitList,
+ apzIrix_Pthread_InitMachs,
+ IRIX_PTHREAD_INIT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aIrix_Pthread_InitTests, apzIrix_Pthread_InitPatch, 0 },
+
+ { zIrix_Socklen_TName, zIrix_Socklen_TList,
+ apzIrix_Socklen_TMachs,
+ IRIX_SOCKLEN_T_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aIrix_Socklen_TTests, apzIrix_Socklen_TPatch, 0 },
+
+ { zIrix_Stdint_C99_ModeName, zIrix_Stdint_C99_ModeList,
+ apzIrix_Stdint_C99_ModeMachs,
+ IRIX_STDINT_C99_MODE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aIrix_Stdint_C99_ModeTests, apzIrix_Stdint_C99_ModePatch, 0 },
+
+ { zIrix_Stdint_C99_TypesName, zIrix_Stdint_C99_TypesList,
+ apzIrix_Stdint_C99_TypesMachs,
+ IRIX_STDINT_C99_TYPES_TEST_CT, FD_MACH_ONLY,
+ aIrix_Stdint_C99_TypesTests, apzIrix_Stdint_C99_TypesPatch, 0 },
+
+ { zIrix_Stdint_C99_MacrosName, zIrix_Stdint_C99_MacrosList,
+ apzIrix_Stdint_C99_MacrosMachs,
+ IRIX_STDINT_C99_MACROS_TEST_CT, FD_MACH_ONLY,
+ aIrix_Stdint_C99_MacrosTests, apzIrix_Stdint_C99_MacrosPatch, 0 },
+
+ { zIrix_WcsftimeName, zIrix_WcsftimeList,
+ apzIrix_WcsftimeMachs,
+ IRIX_WCSFTIME_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aIrix_WcsftimeTests, apzIrix_WcsftimePatch, 0 },
{ zKandr_ConcatName, zKandr_ConcatList,
apzKandr_ConcatMachs,
diff -N -u -r -w gcc-8.2.0/fixincludes/inclhack.def gcc-8.2.0-patched/fixincludes/inclhack.def
--- gcc-8.2.0/fixincludes/inclhack.def 2018-02-22 16:12:26.000000000 +0000
+++ gcc-8.2.0-patched/fixincludes/inclhack.def 2019-08-08 09:38:28.000000000 +0000
@@ -2813,6 +2813,119 @@
"}; /* mumbled struct */\n";
};
+/* REINTRODUCE */
+
+/*
+ * IRIX 5.x's stdio.h and IRIX 6.5's internal/stdio_core.h declare
+ * some functions that take a va_list as
+ * taking char *. However, GCC uses void * for va_list, so
+ * calling vfprintf with a va_list fails in C++. */
+fix = {
+ hackname = irix_stdio_va_list;
+ files = stdio.h;
+ files = internal/stdio_core.h;
+
+ select = '/\* va_list \*/ char \*';
+ c_fix = format;
+ c_fix_arg = "__gnuc_va_list";
+ test_text =
+ "extern int printf( const char *, /* va_list */ char * );";
+};
+
+/*
+ * IRIX 6.5.1[89] <internal/sgimacros.h> unconditionally defines
+ * __restrict as restrict iff __c99. This is wrong for C++, which
+ * needs many C99 features, but only supports __restrict.
+ */
+fix = {
+ hackname = irix___restrict;
+ files = internal/sgimacros.h;
+ select = "(#ifdef __c99\n)(#[ \t]*define __restrict restrict)";
+
+ mach = "mips-sgi-irix6.5";
+ c_fix = format;
+ c_fix_arg = "%1"
+ "# ifndef __cplusplus\n%2\n# endif";
+
+ test_text = "#ifdef __c99\n# define __restrict restrict";
+};
+
+/*
+ * IRIX 6.5.22 <internal/math_core.h> uses the SGI c99 __generic() intrinsic
+ * to define the fpclasify, isfinite, isinf, isnan, isnormal and signbit
+ * functions.
+ *
+ * This was probably introduced around IRIX 6.5.18
+ */
+fix = {
+ hackname = irix___generic1;
+ files = internal/math_core.h;
+ mach = "mips-sgi-irix6.5";
+ select = "#define ([a-z]+)\\(x\\) *__generic.*";
+
+ c_fix = format;
+ c_fix_arg = "extern int %1(double);\n"
+ "extern int %1f(float);\n"
+ "extern int %1l(long double);\n"
+ "#if !defined(__cplusplus)\n"
+ "#define %1(x) (sizeof(x) == sizeof(double) ? _%1(x) \\\n"
+ " : sizeof(x) == sizeof(float) ? _%1f(x) \\\n"
+ " : _%1l(x))\n"
+ "#else\n"
+ "namespace std\n"
+ "{\n"
+ " inline int %1(double x) { return _%1(x); };\n"
+ " inline int %1f(float x) { return _%1f(x); };\n"
+ " inline int %1l(long double x) { return _%1l(x); };\n"
+ "}\n"
+ "#endif\n";
+
+ test_text =
+ "#define isnan(x) __generic(x,,, _isnan, _isnanf, _isnanl,,,)(x)\n";
+};
+
+/* Likewise <internal/math_core.h> on IRIX 6.5.19 and later uses the SGI
+ compiler's __generic intrinsic to define isgreater, isgreaterequal,
+ isless, islessequal, islessgreater and isunordered functions. */
+fix = {
+ hackname = irix___generic2;
+ files = internal/math_core.h;
+ mach = "mips-sgi-irix6.5";
+ select = "#define ([a-z]+)\\(x,y\\) *__generic.*";
+
+ c_fix = format;
+ c_fix_arg = "#define %1(x,y) \\\n"
+ " ((sizeof(x)<=4 && sizeof(y)<=4) ? _%1f(x,y) \\\n"
+ " : (sizeof(x)<=8 && sizeof(y)<=8) ? _%1(x,y) \\\n"
+ " : _%1l(x,y))\n";
+
+ test_text =
+ "#define isless(x,y) __generic(x,y,, _isless, _islessf, _islessl,,,)(x,y)";
+};
+
+
+/*
+ * IRIX 6.5 complex.h defines _Complex_I and _Imaginary_I in terms of __I__,
+ * which is a MIPSpro compiler builtin. Remove _Imaginary_I and imaginary
+ * definitions which are not supported by GCC.
+ */
+fix = {
+ hackname = irix_complex;
+ mach = "mips-sgi-irix6.5";
+ files = complex.h;
+ select = "#define[ \t]_Complex_I[ \t]\\(\\(float[ \t]_Complex\\)[ \t]\\(__I__\\)\\)";
+ sed = "s/#define[ \t]_Complex_I[ \t]((float[ \t]_Complex)[ \t](__I__))/"
+ "#define _Complex_I (__extension__ 1.0iF)/";
+ sed = "/#define[ \t]imaginary[ \t]_Imaginary/d";
+ sed = "/#define[ \t]_Imaginary_I/d";
+ sed = "s/#define[ \t]I[ \t]_Imaginary_I/#define I _Complex_I/";
+ test_text = "#define _Complex_I ((float _Complex) (__I__))\n"
+ "#define imaginary _Imaginary\n"
+ "// #define _Imaginary_I ((float _Imaginary) 1)\n"
+ "#define _Imaginary_I __I__\n"
+ "#define I _Imaginary_I";
+};
+
/*
* Non-traditional "const" declaration in Irix's limits.h.
*/
@@ -2826,20 +2939,169 @@
};
/*
- * IRIX 5.x's stdio.h declares some functions that take a va_list as
- * taking char *. However, GCC uses void * for va_list, so
- * calling vfprintf with a va_list fails in C++. */
+ * IRIX 6.5 PTHREAD_*_INITIALIZER need an additional level of braces in
+ * <pthread.h>.
+ */
fix = {
- hackname = irix_stdio_va_list;
- files = stdio.h;
+ hackname = irix_pthread_init;
+ files = pthread.h;
+ select = "^(#define[ \t]+PTHREAD_.*_INITIALIZER[ \t]+)(\\{ 0 \\})";
- select = '/\* va_list \*/ char \*';
+ mach = "mips-sgi-irix6.5";
c_fix = format;
- c_fix_arg = "__gnuc_va_list";
+ c_fix_arg = "%1{ %2 }";
+ test_text = "#define PTHREAD_MUTEX_INITIALIZER { 0 }\n"
+ "#define PTHREAD_COND_INITIALIZER { 0 }\n"
+ "#define PTHREAD_RWLOCK_INITIALIZER { 0 }";
+};
+
+
+/*
+ * IRIX 6.5.1[78] <sys/socket.h> has a broken definition of socklen_t.
+ * Various socket function prototypes use different types instead,
+ * depending on the API in use (BSD, XPG4/5), but the socklen_t
+ * definition doesn't reflect this (SGI Bug Id 864477, fixed in
+ * IRIX 6.5.19).
+ */
+fix = {
+ hackname = irix_socklen_t;
+ files = sys/socket.h;
+ select = "(#define _SOCKLEN_T\n)(typedef u_int32_t socklen_t;)";
+
+ mach = "mips-sgi-irix6.5";
+ c_fix = format;
+ c_fix_arg = "%1"
+ "#if _NO_XOPEN4 && _NO_XOPEN5\n"
+ "typedef int socklen_t;\n"
+ "#else\n"
+ "%2\n"
+ "#endif /* _NO_XOPEN4 && _NO_XOPEN5 */";
+
+ test_text = "#define _SOCKLEN_T\ntypedef u_int32_t socklen_t;";
+};
+
+/*
+ * IRIX 6.5 <stdint.h> only works with ISO C99 and errors out
+ * otherwise.
+ */
+fix = {
+ hackname = irix_stdint_c99_mode;
+ files = stdint.h;
+ select = "(#ifndef __c99\n)(#error This header file is to be used only for c99 mode compilations)";
+
+ mach = "mips-sgi-irix6.5";
+ c_fix = format;
+ c_fix_arg = "#if 0\n"
+ "%2";
test_text =
- "extern int printf( const char *, /* va_list */ char * );";
+ "#ifndef __c99\n#error This header file is to be used only for c99 mode compilations\n#else";
+};
+
+
+/*
+ * IRIX 6.5 <stdint.h> has some *_MIN/MAX constants whose types don't
+ * match the corresponding types, as required by ISO C99.
+ */
+fix = {
+ hackname = irix_stdint_c99_types;
+ files = stdint-irix65.h, stdint.h;
+ mach = "mips-sgi-irix6.5";
+ sed = "s@^#define INT64_MIN.*(-0x7fffffffffffffff - 1)$@"
+ "#define INT64_MIN (-0x7fffffffffffffffLL - 1)@";
+ sed = "s@^#define INT64_MAX.*0x7fffffffffffffff$@"
+ "#define INT64_MAX 0x7fffffffffffffffLL@";
+ sed = "s@^#define UINT32_MAX.*0xffffffff$@"
+ "#define UINT32_MAX 0xffffffffU@";
+ sed = "s@^#define UINT64_MAX.*0xffffffffffffffff$@"
+ "#define UINT64_MAX 0xffffffffffffffffULL@";
+ sed = "s@^#define INTPTR_MIN.*INT32_MIN$@"
+ "#define INTPTR_MIN (-0x7fffffffL - 1)@";
+ sed = "s@^#define INTPTR_MAX.*INT32_MAX$@"
+ "#define INTPTR_MAX 0x7fffffffL@";
+ sed = "s@^#define UINTPTR_MAX.*UINT32_MAX$@"
+ "#define UINTPTR_MAX 0xffffffffUL@";
+ sed = "s@^#define INTPTR_MIN.*INT64_MIN@"
+ "#define INTPTR_MIN (-0x7fffffffffffffffL - 1)@";
+ sed = "s@^#define INTPTR_MAX.*INT64_MAX$@"
+ "#define INTPTR_MAX 0x7fffffffffffffffL@";
+ sed = "s@^#define UINTPTR_MAX.*UINT64_MAX$@"
+ "#define UINTPTR_MAX 0xffffffffffffffffUL@";
+ sed = "s@^#define PTRDIFF_MIN.*INT64_MIN$@"
+ "#define PTRDIFF_MIN (-0x7fffffffffffffffL - 1)@";
+ sed = "s@^#define PTRDIFF_MAX.*INT64_MAX$@"
+ "#define PTRDIFF_MAX 0x7fffffffffffffffL@";
+ sed = "s@^#define SIZE_MAX.*UINT64_MAX$@"
+ "#define SIZE_MAX 0xffffffffffffffffUL@";
+ test_text = "#define INT64_MIN (-0x7fffffffffffffff - 1)\n"
+ "#define INT64_MAX 0x7fffffffffffffff\n"
+ "#define UINT32_MAX 0xffffffff\n"
+ "#define UINT64_MAX 0xffffffffffffffff\n"
+ "#define INTPTR_MIN INT32_MIN\n"
+ "#define INTPTR_MAX INT32_MAX\n"
+ "#define UINTPTR_MAX UINT32_MAX\n"
+ "#define INTPTR_MIN INT64_MIN\n"
+ "#define INTPTR_MAX INT64_MAX\n"
+ "#define UINTPTR_MAX UINT64_MAX\n"
+ "#define PTRDIFF_MIN INT64_MIN\n"
+ "#define PTRDIFF_MAX INT64_MAX\n"
+ "#define SIZE_MAX UINT64_MAX";
+};
+
+
+/*
+ * IRIX 6.5 <stdint.h> uses casts in some macros which cannot thus be used
+ * in preprocessor tests, although ISO C99 requires this.
+ */
+fix = {
+ hackname = irix_stdint_c99_macros;
+ files = stdint-irix65.h, stdint.h;
+ mach = "mips-sgi-irix6.5";
+ sed = "s@^#define INT8_C(x).*int.*_t.*$@#define INT8_C(x) (x)@";
+ sed = "s@^#define INT16_C(x).*int.*_t.*$@#define INT16_C(x) (x)@";
+ sed = "s@^#define INT32_C(x).*int.*_t.*$@#define INT32_C(x) (x)@";
+ sed = "s@^#define INT64_C(x).*int.*_t.*$@#define INT64_C(x) (x ## LL)@";
+ sed = "s@^#define UINT8_C(x).*int.*_t.*$@#define UINT8_C(x) (x)@";
+ sed = "s@^#define UINT16_C(x).*int.*_t.*$@#define UINT16_C(x) (x)@";
+ sed = "s@^#define UINT32_C(x).*int.*_t.*$@#define UINT32_C(x) (x ## U)@";
+ sed = "s@^#define UINT64_C(x).*int.*_t.*$@#define UINT64_C(x) (x ## ULL)@";
+ sed = "s@^#define INTMAX_C(x).*int.*_t.*$@#define INTMAX_C(x) (x ## LL)@";
+ sed = "s@^#define UINTMAX_C(x).*int.*_t.*$@#define UINTMAX_C(x) (x ## ULL)@";
+ test_text = "#define INT8_C(x) (int_least8_t)(x)\n"
+ "#define INT16_C(x) (int_least16_t)(x)\n"
+ "#define INT32_C(x) (int_least32_t)(x)\n"
+ "#define INT64_C(x) (int_least64_t)(x)\n"
+ "#define UINT8_C(x) (uint_least8_t)(x)\n"
+ "#define UINT16_C(x) (uint_least16_t)(x)\n"
+ "#define UINT32_C(x) (uint_least32_t)(x)\n"
+ "#define UINT64_C(x) (uint_least64_t)(x)\n"
+ "#define INTMAX_C(x) (intmax_t)(x)\n"
+ "#define UINTMAX_C(x) (uintmax_t)(x)";
};
+
+/*
+ * IRIX 6.5.19 <internal/wchar_core.h> provides the XPG4 variant of
+ * wcsftime by default. ISO C99 requires the XPG5 variant instead.
+ */
+fix = {
+ hackname = irix_wcsftime;
+ files = internal/wchar_core.h;
+ select = "#if _NO_XOPEN5\n(extern size_t[ \t]+wcsftime.*const char \*.*)";
+
+ mach = "mips-sgi-irix6.5";
+ c_fix = format;
+ c_fix_arg = "#if _NO_XOPEN5 && !defined(__c99)\n%1";
+
+ test_text = "#if _NO_XOPEN5\n"
+ "extern size_t wcsftime(wchar_t *, "
+ "__SGI_LIBC_NAMESPACE_QUALIFIER size_t, const char *, "
+ "const struct tm *);";
+};
+
+
+
+/* END REINTRODUCE */
+
/*
* These files in Sun OS 4.x and ARM/RISCiX and BSD4.3
* use / * * / to concatenate tokens.
diff -N -u -r -w gcc-8.2.0/fixincludes/tests/base/complex.h gcc-8.2.0-patched/fixincludes/tests/base/complex.h
--- gcc-8.2.0/fixincludes/tests/base/complex.h 2012-03-14 16:33:37.000000000 +0000
+++ gcc-8.2.0-patched/fixincludes/tests/base/complex.h 2019-08-08 09:38:29.000000000 +0000
@@ -21,6 +21,12 @@
#endif /* HPUX_IMAGINARY_I_CHECK */
+#if defined( IRIX_COMPLEX_CHECK )
+#define _Complex_I (__extension__ 1.0iF)
+#define I _Complex_I
+#endif /* IRIX_COMPLEX_CHECK */
+
+
#if defined( SOLARIS_COMPLEX_CHECK )
#define _Complex_I (__extension__ 1.0iF)
#define complex _Complex
diff -N -u -r -w gcc-8.2.0/fixincludes/tests/base/internal/math_core.h gcc-8.2.0-patched/fixincludes/tests/base/internal/math_core.h
--- gcc-8.2.0/fixincludes/tests/base/internal/math_core.h 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/fixincludes/tests/base/internal/math_core.h 2019-08-08 09:38:29.000000000 +0000
@@ -0,0 +1,39 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/internal/math_core.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( IRIX___GENERIC1_CHECK )
+extern int isnan(double);
+extern int isnanf(float);
+extern int isnanl(long double);
+#if !defined(__cplusplus)
+#define isnan(x) (sizeof(x) == sizeof(double) ? _isnan(x) \
+ : sizeof(x) == sizeof(float) ? _isnanf(x) \
+ : _isnanl(x))
+#else
+namespace std
+{
+ inline int isnan(double x) { return _isnan(x); };
+ inline int isnanf(float x) { return _isnanf(x); };
+ inline int isnanl(long double x) { return _isnanl(x); };
+}
+#endif
+
+
+#endif /* IRIX___GENERIC1_CHECK */
+
+
+#if defined( IRIX___GENERIC2_CHECK )
+#define isless(x,y) \
+ ((sizeof(x)<=4 && sizeof(y)<=4) ? _islessf(x,y) \
+ : (sizeof(x)<=8 && sizeof(y)<=8) ? _isless(x,y) \
+ : _islessl(x,y))
+
+#endif /* IRIX___GENERIC2_CHECK */
diff -N -u -r -w gcc-8.2.0/fixincludes/tests/base/internal/sgimacros.h gcc-8.2.0-patched/fixincludes/tests/base/internal/sgimacros.h
--- gcc-8.2.0/fixincludes/tests/base/internal/sgimacros.h 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/fixincludes/tests/base/internal/sgimacros.h 2019-08-08 09:38:29.000000000 +0000
@@ -0,0 +1,17 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/internal/sgimacros.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( IRIX___RESTRICT_CHECK )
+#ifdef __c99
+# ifndef __cplusplus
+# define __restrict restrict
+# endif
+#endif /* IRIX___RESTRICT_CHECK */
diff -N -u -r -w gcc-8.2.0/fixincludes/tests/base/internal/wchar_core.h gcc-8.2.0-patched/fixincludes/tests/base/internal/wchar_core.h
--- gcc-8.2.0/fixincludes/tests/base/internal/wchar_core.h 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/fixincludes/tests/base/internal/wchar_core.h 2019-08-08 09:38:29.000000000 +0000
@@ -0,0 +1,15 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/internal/wchar_core.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( IRIX_WCSFTIME_CHECK )
+#if _NO_XOPEN5 && !defined(__c99)
+extern size_t wcsftime(wchar_t *, __SGI_LIBC_NAMESPACE_QUALIFIER size_t, const char *, const struct tm *);
+#endif /* IRIX_WCSFTIME_CHECK */
diff -N -u -r -w gcc-8.2.0/fixincludes/tests/base/pthread.h gcc-8.2.0-patched/fixincludes/tests/base/pthread.h
--- gcc-8.2.0/fixincludes/tests/base/pthread.h 2014-04-22 13:30:59.000000000 +0000
+++ gcc-8.2.0-patched/fixincludes/tests/base/pthread.h 2019-08-08 09:38:29.000000000 +0000
@@ -91,6 +91,13 @@
#endif /* GLIBC_MUTEX_INIT_CHECK */
+#if defined( IRIX_PTHREAD_INIT_CHECK )
+#define PTHREAD_MUTEX_INITIALIZER { { 0 } }
+#define PTHREAD_COND_INITIALIZER { { 0 } }
+#define PTHREAD_RWLOCK_INITIALIZER { { 0 } }
+#endif /* IRIX_PTHREAD_INIT_CHECK */
+
+
#if defined( PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_CHECK )
extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask);
#endif /* PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_CHECK */
diff -N -u -r -w gcc-8.2.0/fixincludes/tests/base/stdint-irix65.h gcc-8.2.0-patched/fixincludes/tests/base/stdint-irix65.h
--- gcc-8.2.0/fixincludes/tests/base/stdint-irix65.h 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/fixincludes/tests/base/stdint-irix65.h 2019-08-08 09:38:29.000000000 +0000
@@ -0,0 +1,40 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/stdint-irix65.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( IRIX_STDINT_C99_TYPES_CHECK )
+#define INT64_MIN (-0x7fffffffffffffffLL - 1)
+#define INT64_MAX 0x7fffffffffffffffLL
+#define UINT32_MAX 0xffffffffU
+#define UINT64_MAX 0xffffffffffffffffULL
+#define INTPTR_MIN (-0x7fffffffL - 1)
+#define INTPTR_MAX 0x7fffffffL
+#define UINTPTR_MAX 0xffffffffUL
+#define INTPTR_MIN (-0x7fffffffffffffffL - 1)
+#define INTPTR_MAX 0x7fffffffffffffffL
+#define UINTPTR_MAX 0xffffffffffffffffUL
+#define PTRDIFF_MIN (-0x7fffffffffffffffL - 1)
+#define PTRDIFF_MAX 0x7fffffffffffffffL
+#define SIZE_MAX 0xffffffffffffffffUL
+#endif /* IRIX_STDINT_C99_TYPES_CHECK */
+
+
+#if defined( IRIX_STDINT_C99_MACROS_CHECK )
+#define INT8_C(x) (x)
+#define INT16_C(x) (x)
+#define INT32_C(x) (x)
+#define INT64_C(x) (x ## LL)
+#define UINT8_C(x) (x)
+#define UINT16_C(x) (x)
+#define UINT32_C(x) (x ## U)
+#define UINT64_C(x) (x ## ULL)
+#define INTMAX_C(x) (x ## LL)
+#define UINTMAX_C(x) (x ## ULL)
+#endif /* IRIX_STDINT_C99_MACROS_CHECK */
diff -N -u -r -w gcc-8.2.0/fixincludes/tests/base/stdint.h gcc-8.2.0-patched/fixincludes/tests/base/stdint.h
--- gcc-8.2.0/fixincludes/tests/base/stdint.h 2012-03-14 16:33:37.000000000 +0000
+++ gcc-8.2.0-patched/fixincludes/tests/base/stdint.h 2019-08-08 09:38:29.000000000 +0000
@@ -14,3 +14,10 @@
# define UINT8_C(c) c
# define UINT16_C(c) c
#endif /* GLIBC_STDINT_CHECK */
+
+
+#if defined( IRIX_STDINT_C99_MODE_CHECK )
+#if 0
+#error This header file is to be used only for c99 mode compilations
+#else
+#endif /* IRIX_STDINT_C99_MODE_CHECK */
diff -N -u -r -w gcc-8.2.0/fixincludes/tests/base/sys/socket.h gcc-8.2.0-patched/fixincludes/tests/base/sys/socket.h
--- gcc-8.2.0/fixincludes/tests/base/sys/socket.h 2015-05-21 18:25:00.000000000 +0000
+++ gcc-8.2.0-patched/fixincludes/tests/base/sys/socket.h 2019-08-08 09:38:29.000000000 +0000
@@ -37,3 +37,13 @@
#endif
#endif /* HPUX11_EXTERN_SENDPATH_CHECK */
+
+
+#if defined( IRIX_SOCKLEN_T_CHECK )
+#define _SOCKLEN_T
+#if _NO_XOPEN4 && _NO_XOPEN5
+typedef int socklen_t;
+#else
+typedef u_int32_t socklen_t;
+#endif /* _NO_XOPEN4 && _NO_XOPEN5 */
+#endif /* IRIX_SOCKLEN_T_CHECK */
diff -N -u -r -w gcc-8.2.0/gcc/config/mips/driver-native.c gcc-8.2.0-patched/gcc/config/mips/driver-native.c
--- gcc-8.2.0/gcc/config/mips/driver-native.c 2018-01-03 10:03:58.000000000 +0000
+++ gcc-8.2.0-patched/gcc/config/mips/driver-native.c 2019-08-08 09:31:21.675483560 +0000
@@ -24,6 +24,59 @@
#include "coretypes.h"
#include "tm.h"
+#ifdef __sgi__
+#include <invent.h>
+#include <sys/sbd.h>
+
+/* Cf. MIPS R10000 Microprocessor User Guide, Version 2.0, 14.13 Processor
+ Revision Identifier (PRId) Register (15).
+
+ http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi/hdwr/bks/SGI_Developer/books/R10K_UM/sgi_html/t5.Ver.2.0.book_279.html */
+
+static const struct cpu_types {
+ int impl;
+ const char *cpu;
+} cpu_types[] = {
+ { C0_IMP_R2000, "r2000" },
+ { C0_IMP_R3000, "r3000" },
+ { C0_IMP_R6000, "r6000" },
+ { C0_IMP_R4000, "r4000" },
+ { C0_IMP_R6000A, "r6000" },
+ { C0_IMP_R10000, "r10000" },
+ { C0_IMP_R12000, "r12000" },
+ { C0_IMP_R14000, "r14000" },
+ { C0_IMP_R8000, "r8000" },
+ { C0_IMP_R4600, "r4600" },
+ { C0_IMP_R4700, "r4600" },
+ { C0_IMP_R4650, "r4650" },
+ { C0_IMP_R5000, "vr5000" },
+ { C0_IMP_RM7000, "rm7000" },
+ { C0_IMP_RM5271, "vr5000" },
+ { 0, 0 }
+};
+
+static int
+cputype (inventory_t *inv, void *arg)
+{
+ if (inv != NULL
+ && inv->inv_class == INV_PROCESSOR
+ && inv->inv_type == INV_CPUCHIP)
+ {
+ int i;
+ /* inv_state is the cpu revision number. */
+ int impl = (inv->inv_state & C0_IMPMASK) >> C0_IMPSHIFT;
+
+ for (i = 0; cpu_types[i].cpu != NULL; i++)
+ if (cpu_types[i].impl == impl)
+ {
+ *((const char **) arg) = cpu_types[i].cpu;
+ break;
+ }
+ }
+ return 0;
+}
+#endif
+
/* This will be called by the spec parser in gcc.c when it sees
a %:local_cpu_detect(args) construct. Currently it will be called
with either "arch" or "tune" as argument depending on if -march=native
@@ -41,8 +94,10 @@
host_detect_local_cpu (int argc, const char **argv)
{
const char *cpu = NULL;
+#ifndef __sgi__
char buf[128];
FILE *f;
+#endif
bool arch;
if (argc < 1)
@@ -52,6 +107,9 @@
if (!arch && strcmp (argv[0], "tune"))
return NULL;
+#ifdef __sgi__
+ scaninvent (cputype, &cpu);
+#else
f = fopen ("/proc/cpuinfo", "r");
if (f == NULL)
return NULL;
@@ -83,6 +141,7 @@
}
fclose (f);
+#endif
if (cpu == NULL)
return NULL;
diff -N -u -r -w gcc-8.2.0/gcc/config/mips/iris6.h gcc-8.2.0-patched/gcc/config/mips/iris6.h
--- gcc-8.2.0/gcc/config/mips/iris6.h 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/gcc/config/mips/iris6.h 2019-08-08 09:31:21.679754600 +0000
@@ -0,0 +1,385 @@
+/* Definitions of target machine for GNU compiler. IRIX 6.5 version.
+ Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 2000,
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* We are compiling for IRIX 6 now. */
+#undef TARGET_IRIX6
+#define TARGET_IRIX6 1
+
+/* we use GNU binutils here */
+#define IRIX_USING_GNU_LD 1
+
+/* Default to -mabi=n32 and -mips3. */
+#undef MULTILIB_DEFAULTS
+#define MULTILIB_DEFAULTS { "mabi=n32" }
+
+/* -march=native handling only makes sense with compiler running on
+ a MIPS chip. */
+#if defined(__mips__)
+extern const char *host_detect_local_cpu (int argc, const char **argv);
+# define EXTRA_SPEC_FUNCTIONS \
+ { "local_cpu_detect", host_detect_local_cpu },
+
+# define MARCH_MTUNE_NATIVE_SPECS \
+ " %{march=native:%<march=native %:local_cpu_detect(arch)}" \
+ " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}"
+#else
+# define MARCH_MTUNE_NATIVE_SPECS ""
+#endif
+
+#define PREFERRRED_DEBUGGING_TYPE DWARF2_DEBUG
+
+/* Force the default ABI onto the command line in order to make the specs
+ easier to write. */
+#undef DRIVER_SELF_SPECS
+#define DRIVER_SELF_SPECS \
+ "%{!mabi=*: -mabi=n32}", \
+ /* Configuration-independent MIPS rules. */ \
+ BASE_DRIVER_SELF_SPECS, \
+ MARCH_MTUNE_NATIVE_SPECS
+
+/* IRIX 6.5 has the float and long double forms of math functions. */
+/* #define TARGET_C99_FUNCTIONS 1 */
+
+/* MIPS specific debugging info */
+/* #define MIPS_DEBUGGING_INFO 1 */
+#define SGUG_DEBUGGING_INFO 1
+
+/* Force the generation of dwarf .debug_frame sections even if not
+ compiling -g. This guarantees that we can unwind the stack. */
+#define DWARF2_FRAME_INFO 1
+
+/* The system unwinder in libexc requires a specific dwarf return address
+ column to work. */
+#undef DWARF_FRAME_RETURN_COLUMN
+#define DWARF_FRAME_RETURN_COLUMN (FP_REG_LAST + 1)
+
+/* The size in bytes of a DWARF field indicating an offset or length
+ relative to a debug info section, specified to be 4 bytes in the DWARF-2
+ specification. The SGI/MIPS ABI defines it to be the same as PTR_SIZE. */
+#define DWARF_OFFSET_SIZE PTR_SIZE
+
+/* The size in bytes of the initial length field in a debug info
+ section. The DWARF 3 (draft) specification defines this to be
+ either 4 or 12 (with a 4-byte "escape" word when it's 12), but the
+ SGI/MIPS ABI predates this standard and defines it to be the same
+ as DWARF_OFFSET_SIZE. */
+#define DWARF_INITIAL_LENGTH_SIZE DWARF_OFFSET_SIZE
+
+/* MIPS assemblers don't have the usual .set foo,bar construct;
+ .set is used for assembler options instead. */
+#undef SET_ASM_OP
+#define ASM_OUTPUT_DEF(FILE, LABEL1, LABEL2) \
+ do \
+ { \
+ fputc ('\t', FILE); \
+ assemble_name (FILE, LABEL1); \
+ fputs (" = ", FILE); \
+ assemble_name (FILE, LABEL2); \
+ fputc ('\n', FILE); \
+ } \
+ while (0)
+
+#undef LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX "."
+
+#undef ASM_DECLARE_OBJECT_NAME
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
+
+#undef ASM_FINISH_DECLARE_OBJECT
+#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
+
+/* The native IRIX 6 linker does not support merging without a special
+ elspec(5) file. */
+#ifndef IRIX_USING_GNU_LD
+#undef HAVE_GAS_SHF_MERGE
+#define HAVE_GAS_SHF_MERGE 0
+#endif
+
+/* Specify wchar_t types. */
+#undef WCHAR_TYPE
+#define WCHAR_TYPE (Pmode == DImode ? "int" : "long int")
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE INT_TYPE_SIZE
+
+/* Same for wint_t. */
+#undef WINT_TYPE
+#define WINT_TYPE (Pmode == DImode ? "int" : "long int")
+
+#undef WINT_TYPE_SIZE
+#define WINT_TYPE_SIZE INT_TYPE_SIZE
+
+#ifndef USED_FOR_TARGET
+/* Use long for intmax_t, uintmax_t? */
+extern int long_intmax;
+#endif
+
+/* C99 stdint.h types. */
+#define INT8_TYPE "signed char"
+#define INT16_TYPE "short int"
+#define INT32_TYPE "int"
+#define INT64_TYPE "long long int"
+#define UINT8_TYPE "unsigned char"
+#define UINT16_TYPE "short unsigned int"
+#define UINT32_TYPE "unsigned int"
+#define UINT64_TYPE "long long unsigned int"
+
+#define INT_LEAST8_TYPE "signed char"
+#define INT_LEAST16_TYPE "short int"
+#define INT_LEAST32_TYPE "int"
+#define INT_LEAST64_TYPE "long long int"
+#define UINT_LEAST8_TYPE "unsigned char"
+#define UINT_LEAST16_TYPE "short unsigned int"
+#define UINT_LEAST32_TYPE "unsigned int"
+#define UINT_LEAST64_TYPE "long long unsigned int"
+
+#define INT_FAST8_TYPE "signed char"
+#define INT_FAST16_TYPE "short int"
+#define INT_FAST32_TYPE "int"
+#define INT_FAST64_TYPE "long long int"
+#define UINT_FAST8_TYPE "unsigned char"
+#define UINT_FAST16_TYPE "short unsigned int"
+#define UINT_FAST32_TYPE "unsigned int"
+#define UINT_FAST64_TYPE "long long unsigned int"
+
+#define INTMAX_TYPE (long_intmax ? "long int" : "long long int")
+#define UINTMAX_TYPE (long_intmax ? "long unsigned int" : "long long unsigned int")
+
+#define INTPTR_TYPE "long int"
+#define UINTPTR_TYPE "long unsigned int"
+
+#define SIG_ATOMIC_TYPE "int"
+
+/* Plain char is unsigned in the SGI compiler. */
+#undef DEFAULT_SIGNED_CHAR
+#define DEFAULT_SIGNED_CHAR 0
+
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define_std ("host_mips"); \
+ builtin_define_std ("sgi"); \
+ builtin_define_std ("unix"); \
+ builtin_define_std ("SYSTYPE_SVR4"); \
+ builtin_define ("_MODERN_C"); \
+ builtin_define ("_SVR4_SOURCE"); \
+ builtin_define ("__DSO__"); \
+ builtin_assert ("system=unix"); \
+ builtin_assert ("system=svr4"); \
+ builtin_assert ("machine=sgi"); \
+ \
+ if (!ISA_MIPS1 && !ISA_MIPS2) \
+ builtin_define ("_COMPILER_VERSION=601"); \
+ \
+ /* We must always define _LONGLONG, even when -ansi is \
+ used, because IRIX 5 system header files require it. \
+ This is OK, because gcc never warns when long long \
+ is used in system header files. \
+ \
+ An alternative would be to support the SGI builtin \
+ type __long_long. */ \
+ builtin_define ("_LONGLONG"); \
+ \
+ /* IRIX 6.5.18 and above provide many ISO C99 \
+ features protected by the __c99 macro. \
+ libstdc++ v3 needs them as well. */ \
+ if (flag_isoc99 || c_dialect_cxx ()) \
+ builtin_define ("__c99"); \
+ \
+ /* The GNU C++ standard library requires that \
+ __EXTENSIONS__ and _SGI_SOURCE be defined on at \
+ least IRIX 6.2 and probably all IRIX 6 prior to 6.5. \
+ We don't need this on IRIX 6.5 itself, but it \
+ shouldn't hurt other than the namespace pollution. */ \
+ if (!flag_iso || c_dialect_cxx ()) \
+ { \
+ builtin_define ("__EXTENSIONS__"); \
+ builtin_define ("_SGI_SOURCE"); \
+ } \
+ } \
+ while (0)
+
+/* SUBTARGET_OVERRIDE_OPTIONS is run after C_COMMON_OVERRIDE_OPTIONS, so
+ only set long_intmax if uninitialized. */
+#undef SUBTARGET_OVERRIDE_OPTIONS
+#define SUBTARGET_OVERRIDE_OPTIONS \
+ do \
+ { \
+ if (long_intmax == -1) \
+ long_intmax = mips_abi == ABI_64; \
+ } \
+ while (0)
+
+/*
+ if (!global_options_set.x_dwarf_strict) \
+ dwarf_strict = 1; \
+ if (!global_options_set.x_dwarf_version) \
+ dwarf_version = 2; \
+*/
+
+extern void irix6_c_common_override_options (void);
+#define C_COMMON_OVERRIDE_OPTIONS irix6_c_common_override_options()
+
+#undef SUBTARGET_CC1_SPEC
+#define SUBTARGET_CC1_SPEC "%{static: -mno-abicalls}"
+
+#undef SUBTARGET_CPP_SPEC
+#define SUBTARGET_CPP_SPEC "%{pthread:-D_REENTRANT}"
+
+#undef INIT_SECTION_ASM_OP
+#define INIT_SECTION_ASM_OP "\t.section\t.gcc_init,\"ax\",@progbits"
+
+#undef FINI_SECTION_ASM_OP
+#define FINI_SECTION_ASM_OP "\t.section\t.gcc_fini,\"ax\",@progbits"
+
+#ifdef IRIX_USING_GNU_LD
+#define IRIX_NO_UNRESOLVED ""
+#else
+#define IRIX_NO_UNRESOLVED "-no_unresolved"
+#endif
+
+#ifdef IRIX_USING_GNU_LD
+#define SUBTARGET_DONT_WARN_UNUSED_SPEC ""
+#define SUBTARGET_WARN_UNUSED_SPEC ""
+#else
+#define SUBTARGET_DONT_WARN_UNUSED_SPEC "-dont_warn_unused"
+#define SUBTARGET_WARN_UNUSED_SPEC "-warn_unused"
+#endif
+
+/* Profiling is supported via libprof1.a not -lc_p as in IRIX 3. */
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+ "%{!shared: \
+ %{mabi=n32: \
+ %{mips4:%{pg:/usr/lib32/mips4/gcrt1.o%s} \
+ %{!pg:%{p:/usr/lib32/mips4/mcrt1.o%s /usr/lib32/mips4/libprof1.a%s} \
+ %{!p:/usr/lib32/mips4/crt1.o%s}}} \
+ %{!mips4:%{pg:/usr/lib32/mips3/gcrt1.o%s} \
+ %{!pg:%{p:/usr/lib32/mips3/mcrt1.o%s /usr/lib32/mips3/libprof1.a%s} \
+ %{!p:/usr/lib32/mips3/crt1.o%s}}}} \
+ %{mabi=64: \
+ %{mips4:%{pg:/usr/lib64/mips4/gcrt1.o} \
+ %{!pg:%{p:/usr/lib64/mips4/mcrt1.o /usr/lib64/mips4/libprof1.a} \
+ %{!p:/usr/lib64/mips4/crt1.o}}} \
+ %{!mips4:%{pg:/usr/lib64/mips3/gcrt1.o} \
+ %{!pg:%{p:/usr/lib64/mips3/mcrt1.o /usr/lib64/mips3/libprof1.a} \
+ %{!p:/usr/lib64/mips3/crt1.o}}}}} \
+ irix-crti.o%s crtbegin.o%s"
+
+#undef LIB_SPEC
+#define LIB_SPEC \
+ "%{mabi=n32: %{mips4:-L/usr/lib32/mips4} %{!mips4:-L/usr/lib32/mips3} \
+ -L/usr/lib32} \
+ %{mabi=64: %{mips4:-L/usr/lib64/mips4} %{!mips4:-L/usr/lib64/mips3} \
+ -L/usr/lib64} \
+ %{!shared:" \
+ SUBTARGET_DONT_WARN_UNUSED_SPEC \
+ " %{pthread:-lpthread} %{p:libprof1.a%s}%{pg:libprof1.a%s} -lc " \
+ SUBTARGET_WARN_UNUSED_SPEC "}"
+
+/* Avoid getting two warnings for libgcc.a everytime we link. libgcc.a
+ contains references to copysignl, so link with libm to resolve them. */
+#undef LIBGCC_SPEC
+#define LIBGCC_SPEC \
+ SUBTARGET_DONT_WARN_UNUSED_SPEC " -lgcc -lm " SUBTARGET_WARN_UNUSED_SPEC
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+ crtend.o%s irix-crtn.o%s \
+ %{!shared: \
+ %{mabi=n32:%{mips4:/usr/lib32/mips4/crtn.o%s}\
+ %{!mips4:/usr/lib32/mips3/crtn.o%s}}\
+ %{mabi=64:%{mips4:/usr/lib64/mips4/crtn.o%s}\
+ %{!mips4:/usr/lib64/mips3/crtn.o%s}}}"
+
+/* Generic part of the LINK_SPEC. */
+#undef LINK_SPEC
+#define LINK_SPEC "\
+%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
+%{bestGnum} %{shared} %{non_shared} \
+%{call_shared} %{no_archive} %{exact_version} \
+%{!shared: \
+ %{!non_shared: %{!call_shared:%{!r: -call_shared " IRIX_NO_UNRESOLVED "}}}} \
+%{rpath} %{!r: -init __gcc_init -fini __gcc_fini} " IRIX_SUBTARGET_LINK_SPEC
+
+#ifdef IRIX_USING_GNU_LD
+#define IRIX_SUBTARGET_LINK_SPEC \
+ "%{mabi=n32: -melf32bmipn32}%{mabi=64: -melf64bmip}"
+#else
+ /* Explicitly hide crt symbols that would normally be marked with
+ a "hidden" visibility attribute.
+
+ We have traditionally disabled this attribute when using the
+ native linker because the native linker's visibility support is
+ not fully-compatible with the GNU linker's. In particular, the
+ native linker does not pull in archive objects purely to resolve
+ references to the object's hidden symbols, whereas the GNU
+ linker does.
+
+ The gcc build system currently hides symbols in some static
+ libraries (typically libgcov.a or libgcc.a) whenever visibility
+ attributes are supported. On targets with GNU semantics, this
+ makes sure that uses of libx.so symbols in one dynamic object are
+ not resolved to libx.a symbols in another dynamic object. But
+ on targets with IRIX semantics, hiding the symbols prevents the
+ static archive from working at all.
+
+ It would probably be better to enable visiblity attributes for
+ IRIX ld and disable the static archives versioning. It shouldn't
+ make anything worse, since libx.a symbols are global by default
+ anyway. However, no-one has volunteered to do this yet. */
+
+#define IRIX_SUBTARGET_LINK_SPEC \
+ "%{w} -_SYSTYPE_SVR4 -woff 131 \
+ %{shared:-hidden_symbol __dso_handle} \
+ %{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}"
+#endif
+
+/* A linker error can empirically be avoided by removing duplicate
+ library search directories. */
+/* #define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 1 */
+
+/* The SGI linker doesn't understand constructor priorities. */
+#ifndef IRIX_USING_GNU_LD
+#define SUPPORTS_INIT_PRIORITY 0
+#endif
+
+/* Add -g to mips.h default to avoid confusing gas with local symbols
+ generated from stabs info. */
+#undef NM_FLAGS
+#define NM_FLAGS "-Bng"
+
+/* The system header files are C++ aware. */
+/* ??? Unfortunately, most but not all of the headers are C++ aware.
+ Specifically, curses.h is not, and as a consequence, defining this
+ used to prevent libg++ building. This is no longer the case so
+ define it again to prevent other problems, e.g. with getopt in
+ unistd.h. We still need some way to fix just those files that need
+ fixing. */
+#define NO_IMPLICIT_EXTERN_C 1
+
+/* -G is incompatible with -KPIC which is the default, so only allow objects
+ in the small data section if the user explicitly asks for it. */
+#undef MIPS_DEFAULT_GVALUE
+#define MIPS_DEFAULT_GVALUE 0
+
+#define MIPS_TFMODE_FORMAT mips_extended_format
diff -N -u -r -w gcc-8.2.0/gcc/config/mips/iris6.opt gcc-8.2.0-patched/gcc/config/mips/iris6.opt
--- gcc-8.2.0/gcc/config/mips/iris6.opt 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/gcc/config/mips/iris6.opt 2019-08-08 09:31:21.682415880 +0000
@@ -0,0 +1,45 @@
+; IRIX 6.5 options.
+
+; Copyright (C) 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+bestGnum
+Driver
+
+call_shared
+Driver
+
+exact_version
+Driver
+
+no_archive
+Driver
+
+non_shared
+Driver
+
+pthread
+Driver
+
+; This comment is to ensure we retain the blank line above.
diff -N -u -r -w gcc-8.2.0/gcc/config/mips/irix6-c.c gcc-8.2.0-patched/gcc/config/mips/irix6-c.c
--- gcc-8.2.0/gcc/config/mips/irix6-c.c 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/gcc/config/mips/irix6-c.c 2019-08-08 09:31:21.685041720 +0000
@@ -0,0 +1,38 @@
+/* IRIX 6 support needed only by C/C++ frontends.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tree.h"
+#include "tm.h"
+#include "c-family/c-common.h"
+
+/* For C99, intmax_t, uintmax_t are always long long int, otherwise the
+ type differs between 32-bit and 64-bit compilations. */
+void
+irix6_c_common_override_options (void)
+{
+ if (flag_isoc99 || c_dialect_cxx ())
+ long_intmax = 0;
+ else
+ /* Cannot use LONG_TYPE_SIZE == 64. LONG_TYPE_SIZE is only set in
+ mips_option_override after C_COMMON_OVERRIDE_OPTIONS. */
+ long_intmax = mips_abi == ABI_64;
+}
diff -N -u -r -w gcc-8.2.0/gcc/config/mips/mips.c gcc-8.2.0-patched/gcc/config/mips/mips.c
--- gcc-8.2.0/gcc/config/mips/mips.c 2018-03-01 11:37:35.000000000 +0000
+++ gcc-8.2.0-patched/gcc/config/mips/mips.c 2019-08-08 09:31:21.792037640 +0000
@@ -464,6 +464,12 @@
enum processor mips_arch;
const struct mips_cpu_info *mips_arch_info;
+#if TARGET_IRIX6
+/* On IRIX 6, intmax_t and uintmax_t depend on __c99, which is only
+ available in C-family compilers. See irix6_c_common_override_options. */
+int long_intmax = -1;
+#endif
+
/* The processor that we should tune the code for. */
enum processor mips_tune;
const struct mips_cpu_info *mips_tune_info;
@@ -6626,6 +6632,9 @@
layout_type (record);
return record;
}
+ else if (TARGET_IRIX6)
+ /* On IRIX 6, this type is 'char *'. */
+ return build_pointer_type (char_type_node);
else
/* Otherwise, we use 'void *'. */
return ptr_type_node;
@@ -9827,6 +9836,8 @@
/* Generate a special section to describe the ABI switches used to
produce the resultant binary. */
+ if (!TARGET_IRIX6) {
+
/* Record the ABI itself. Modern versions of binutils encode
this information in the ELF header flags, but GDB needs the
information in order to correctly debug binaries produced by
@@ -9911,6 +9922,7 @@
}
#endif
#endif
+ }
/* If TARGET_ABICALLS, tell GAS to generate -KPIC code. */
if (TARGET_ABICALLS)
@@ -20014,6 +20026,10 @@
REAL_MODE_FORMAT (TFmode) = &mips_quad_format;
}
+#ifdef MIPS_TFMODE_FORMAT
+ REAL_MODE_FORMAT (TFmode) = &MIPS_TFMODE_FORMAT;
+#endif
+
/* Make sure that the user didn't turn off paired single support when
MIPS-3D support is requested. */
if (TARGET_MIPS3D
diff -N -u -r -w gcc-8.2.0/gcc/config/mips/mips.h gcc-8.2.0-patched/gcc/config/mips/mips.h
--- gcc-8.2.0/gcc/config/mips/mips.h 2018-01-03 10:03:58.000000000 +0000
+++ gcc-8.2.0-patched/gcc/config/mips/mips.h 2019-08-08 09:31:21.821370040 +0000
@@ -201,7 +201,9 @@
/* True if .gpword or .gpdword should be used for switch tables. */
#define TARGET_GPWORD \
- (TARGET_ABICALLS && !TARGET_ABSOLUTE_ABICALLS)
+ (TARGET_ABICALLS \
+ && !TARGET_ABSOLUTE_ABICALLS \
+ && !(mips_abi == ABI_64 && TARGET_IRIX6))
/* True if the output must have a writable .eh_frame.
See ASM_PREFERRED_EH_DATA_FORMAT for details. */
diff -N -u -r -w gcc-8.2.0/gcc/config/mips/t-irix6 gcc-8.2.0-patched/gcc/config/mips/t-irix6
--- gcc-8.2.0/gcc/config/mips/t-irix6 2011-06-03 18:16:44.000000000 +0000
+++ gcc-8.2.0-patched/gcc/config/mips/t-irix6 2019-08-08 09:31:21.848051560 +0000
@@ -2,3 +2,7 @@
MULTILIB_DIRNAMES=n32 64
MULTILIB_MATCHES=
MULTILIB_OSDIRNAMES=../lib32 ../lib64
+
+irix6-c.o: $(srcdir)/config/mips/irix6-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ tree.h $(TM_H) $(C_COMMON_H)
+ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
diff -N -u -r -w gcc-8.2.0/gcc/config.gcc gcc-8.2.0-patched/gcc/config.gcc
--- gcc-8.2.0/gcc/config.gcc 2018-06-25 20:34:01.000000000 +0000
+++ gcc-8.2.0-patched/gcc/config.gcc 2019-08-08 09:31:21.891501640 +0000
@@ -2057,6 +2057,28 @@
cxx_target_objs="${cxx_target_objs} microblaze-c.o"
tmake_file="${tmake_file} microblaze/t-microblaze"
;;
+mips-sgi-irix6.5*)
+ tm_file="elfos.h ${tm_file} mips/iris6.h"
+ tmake_file="mips/t-irix6 t-slibgcc"
+ c_target_objs="irix6-c.o"
+ cxx_target_objs="irix6-c.o"
+ extra_options="${extra_options} rpath.opt mips/iris6.opt"
+ target_cpu_default="MASK_ABICALLS"
+ tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
+ # Only IRIX Development Foundation 1.3 for IRIX 6.5 provides stdint.h.
+ use_gcc_stdint=wrap
+ if test "x$stabs" = xyes
+ then
+ tm_file="${tm_file} dbx.h"
+ fi
+ if test "x$gnu_ld" = xyes
+ then
+ tm_defines="${tm_defines} IRIX_USING_GNU_LD"
+ fi
+ case ${enable_threads}:${have_pthread_h} in
+ "":yes | yes:yes ) thread_file=posix ;;
+ esac
+ ;;
riscv*-*-linux*)
tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} riscv/linux.h"
case "x${enable_multilib}" in
diff -N -u -r -w gcc-8.2.0/gcc/config.host gcc-8.2.0-patched/gcc/config.host
--- gcc-8.2.0/gcc/config.host 2018-01-03 10:03:58.000000000 +0000
+++ gcc-8.2.0-patched/gcc/config.host 2019-08-08 09:31:21.905042200 +0000
@@ -133,9 +133,9 @@
;;
esac
;;
- mips*-*-linux*)
+ mips*-*-linux* | mips-sgi-irix*)
case ${target} in
- mips*-*-linux*)
+ mips*-*-linux* | mips-sgi-irix*)
host_extra_gcc_objs="driver-native.o"
host_xmake_file="${host_xmake_file} mips/x-native"
;;
diff -N -u -r -w gcc-8.2.0/gcc/configure gcc-8.2.0-patched/gcc/configure
--- gcc-8.2.0/gcc/configure 2018-04-18 10:46:58.000000000 +0000
+++ gcc-8.2.0-patched/gcc/configure 2019-08-08 09:31:22.060580840 +0000
@@ -1,3 +1,4 @@
+
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.64.
@@ -7525,8 +7526,17 @@
;;
mips*-*-*)
+ case $host in
+ mips*-sgi-irix*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: fixed-point is not supported on IRIX, ignored" >&5
+$as_echo "$as_me: WARNING: fixed-point is not supported on IRIX, ignored" >&2;}
+ enable_fixed_point=no
+ ;;
+ *)
enable_fixed_point=yes
;;
+ esac
+ ;;
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: fixed-point is not supported for this target, ignored" >&5
$as_echo "$as_me: WARNING: fixed-point is not supported for this target, ignored" >&2;}
@@ -24430,6 +24440,10 @@
gcc_cv_ld_dynamic_option="-adefault"
fi
;;
+ # IRIX 6 ld supports -Bstatic/-Bdynamic
+ mips-sgi-irix6*)
+ gcc_cv_ld_static_dynamic=yes
+ ;;
# Solaris 2 ld always supports -Bstatic/-Bdynamic.
*-*-solaris2*)
gcc_cv_ld_static_dynamic=yes
diff -N -u -r -w gcc-8.2.0/gcc/configure.ac gcc-8.2.0-patched/gcc/configure.ac
--- gcc-8.2.0/gcc/configure.ac 2018-04-18 10:46:58.000000000 +0000
+++ gcc-8.2.0-patched/gcc/configure.ac 2019-08-08 09:31:22.103312280 +0000
@@ -843,8 +843,16 @@
;;
mips*-*-*)
+ case $host in
+ mips*-sgi-irix*)
+ AC_MSG_WARN([fixed-point is not supported on IRIX, ignored])
+ enable_fixed_point=no
+ ;;
+ *)
enable_fixed_point=yes
;;
+ esac
+ ;;
*)
AC_MSG_WARN([fixed-point is not supported for this target, ignored])
enable_fixed_point=no
@@ -3638,6 +3646,10 @@
gcc_cv_ld_dynamic_option="-adefault"
fi
;;
+ # IRIX 6 ld supports -Bstatic/-Bdynamic.
+ mips-sgi-irix6*)
+ gcc_cv_ld_static_dynamic=yes
+ ;;
# Solaris 2 ld always supports -Bstatic/-Bdynamic.
*-*-solaris2*)
gcc_cv_ld_static_dynamic=yes
diff -N -u -r -w gcc-8.2.0/gcc/dwarf2cfi.c gcc-8.2.0-patched/gcc/dwarf2cfi.c
--- gcc-8.2.0/gcc/dwarf2cfi.c 2018-01-19 22:36:04.000000000 +0000
+++ gcc-8.2.0-patched/gcc/dwarf2cfi.c 2019-08-08 09:31:22.127395880 +0000
@@ -797,6 +797,7 @@
cfi->dw_cfi_opc = DW_CFA_def_cfa_offset;
cfi->dw_cfi_oprnd1.dw_cfi_offset = const_offset;
}
+#ifndef SGUG_DEBUGGING_INFO
else if (new_cfa->offset.is_constant ()
&& known_eq (new_cfa->offset, old_cfa->offset)
&& old_cfa->reg != INVALID_REGNUM
@@ -811,6 +812,8 @@
cfi->dw_cfi_opc = DW_CFA_def_cfa_register;
cfi->dw_cfi_oprnd1.dw_cfi_reg_num = new_cfa->reg;
}
+#endif
+
else if (new_cfa->indirect == 0
&& new_cfa->offset.is_constant (&const_offset))
{
@@ -2848,22 +2851,23 @@
create_pseudo_cfg (void)
{
bool saw_barrier, switch_sections;
- dw_trace_info ti;
+ dw_trace_info ti1;
+ dw_trace_info* ti = &ti1;
rtx_insn *insn;
unsigned i;
/* The first trace begins at the start of the function,
and begins with the CIE row state. */
trace_info.create (16);
- memset (&ti, 0, sizeof (ti));
- ti.head = get_insns ();
- ti.beg_row = cie_cfi_row;
- ti.cfa_store = cie_cfi_row->cfa;
- ti.cfa_temp.reg = INVALID_REGNUM;
- trace_info.quick_push (ti);
+ memset (&ti1, 0, sizeof (ti1));
+ ti1.head = get_insns ();
+ ti1.beg_row = cie_cfi_row;
+ ti1.cfa_store = cie_cfi_row->cfa;
+ ti1.cfa_temp.reg = INVALID_REGNUM;
+ ti = trace_info.quick_push (ti1);
if (cie_return_save)
- ti.regs_saved_in_regs.safe_push (*cie_return_save);
+ ti->regs_saved_in_regs.safe_push (*cie_return_save);
/* Walk all the insns, collecting start of trace locations. */
saw_barrier = false;
@@ -2885,11 +2889,12 @@
else if (save_point_p (insn)
&& (LABEL_P (insn) || !saw_barrier))
{
- memset (&ti, 0, sizeof (ti));
- ti.head = insn;
- ti.switch_sections = switch_sections;
- ti.id = trace_info.length ();
- trace_info.safe_push (ti);
+ dw_trace_info ti2;
+ memset (&ti2, 0, sizeof (ti2));
+ ti2.head = insn;
+ ti2.switch_sections = switch_sections;
+ ti2.id = trace_info.length ();
+ ti = trace_info.safe_push (ti2);
saw_barrier = false;
switch_sections = false;
@@ -2900,19 +2905,18 @@
avoiding stale pointer problems due to reallocation. */
trace_index
= new hash_table<trace_info_hasher> (trace_info.length ());
- dw_trace_info *tp;
- FOR_EACH_VEC_ELT (trace_info, i, tp)
+ FOR_EACH_VEC_ELT (trace_info, i, ti)
{
dw_trace_info **slot;
if (dump_file)
- fprintf (dump_file, "Creating trace %u : start at %s %d%s\n", tp->id,
- rtx_name[(int) GET_CODE (tp->head)], INSN_UID (tp->head),
- tp->switch_sections ? " (section switch)" : "");
+ fprintf (dump_file, "Creating trace %u : start at %s %d%s\n", ti->id,
+ rtx_name[(int) GET_CODE (ti->head)], INSN_UID (ti->head),
+ ti->switch_sections ? " (section switch)" : "");
- slot = trace_index->find_slot_with_hash (tp, INSN_UID (tp->head), INSERT);
+ slot = trace_index->find_slot_with_hash (ti, INSN_UID (ti->head), INSERT);
gcc_assert (*slot == NULL);
- *slot = tp;
+ *slot = ti;
}
}
@@ -3488,6 +3492,10 @@
{
int enc;
+#ifdef SGUG_DEBUGGING_INFO
+ return false;
+#endif
+
if (saved_do_cfi_asm != 0)
return saved_do_cfi_asm > 0;
diff -N -u -r -w gcc-8.2.0/gcc/dwarf2out.c gcc-8.2.0-patched/gcc/dwarf2out.c
--- gcc-8.2.0/gcc/dwarf2out.c 2018-07-16 12:57:10.000000000 +0000
+++ gcc-8.2.0-patched/gcc/dwarf2out.c 2019-08-08 09:31:22.285851200 +0000
@@ -955,6 +955,12 @@
if (for_eh && targetm.terminate_dw2_eh_frame_info)
dw2_asm_output_data (4, 0, "End of Table");
+#ifdef SGUG_DEBUGGING_INFO
+ /* Work around Irix 6 assembler bug whereby labels at the end of a section
+ get a value of 0. Putting .align 0 after the label fixes it. */
+ ASM_OUTPUT_ALIGN (asm_out_file, 0);
+#endif
+
/* Turn off app to make assembly quicker. */
if (flag_debug_asm)
@@ -19311,7 +19317,14 @@
/* The DWARF2 standard says that we should assume that the structure
address is already on the stack, so we can specify a structure
field address by using DW_OP_plus_uconst. */
+#ifdef SGUG_DEBUGGING_INFO
+ /* ??? The SGI dwarf reader does not handle the DW_OP_plus_uconst
+ operator correctly. It works only if we leave the offset on the
+ stack. */
+ op = DW_OP_constu;
+#else
op = DW_OP_plus_uconst;
+#endif
loc_descr = new_loc_descr (op, offset, 0);
}
}
@@ -21698,6 +21711,17 @@
return;
}
+ /* ??? The SGI dwarf reader fails for array of array of enum types
+ (e.g. const enum machine_mode insn_operand_mode[2][10]) unless the inner
+ array type comes before the outer array type. We thus call gen_type_die
+ before we new_die and must prevent nested array types collapsing for this
+ target. */
+
+#ifdef SGUG_DEBUGGING_INFO
+ gen_type_die (TREE_TYPE (type), context_die);
+ collapse_nested_arrays = false;
+#endif
+
array_die = new_die (DW_TAG_array_type, scope_die, type);
add_name_attribute (array_die, type_tag (type));
equate_type_number_to_die (type, array_die);
@@ -21722,6 +21746,14 @@
for multidimensional arrays. */
add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_row_major);
#endif
+#ifdef SGUG_DEBUGGING_INFO
+ /* The SGI compilers handle arrays of unknown bound by setting
+ AT_declaration and not emitting any subrange DIEs. */
+ if (TREE_CODE (type) == ARRAY_TYPE
+ && ! TYPE_DOMAIN (type))
+ add_AT_flag (array_die, DW_AT_declaration, 1);
+ else
+#endif
if (TREE_CODE (type) == VECTOR_TYPE)
{
@@ -21745,6 +21777,10 @@
element_type = TREE_TYPE (element_type);
}
+#ifndef SGUG_DEBUGGING_INFO
+ gen_type_die (element_type, context_die);
+#endif
+
add_type_attribute (array_die, element_type, TYPE_UNQUALIFIED,
TREE_CODE (type) == ARRAY_TYPE
&& TYPE_REVERSE_STORAGE_ORDER (type),
@@ -23031,6 +23067,11 @@
false);
}
+#ifdef SGUG_DEBUGGING_INFO
+ /* Add a reference to the FDE for this routine. */
+ add_AT_fde_ref (subr_die, DW_AT_MIPS_fde, cfun->fde->fde_index);
+#endif
+
cfa_fb_offset = CFA_FRAME_BASE_OFFSET (decl);
/* We define the "frame base" as the function's CFA. This is more
@@ -24272,6 +24313,24 @@
sprintf (tail, "%s %s", language_string, version_string);
tail += plen;
+ if (!dwarf_record_gcc_switches)
+ {
+#ifdef SGUG_DEBUGGING_INFO
+ /* The MIPS/SGI compilers place the 'cc' command line options in the
+ producer string. The SGI debugger looks for -g, -g1, -g2, or -g3;
+ if they do not appear in the producer string, the debugger reaches
+ the conclusion that the object file is stripped and has no debugging
+ information. To get the MIPS/SGI debugger to believe that there is
+ debugging information in the object file, we add a -g to the producer
+ string. */
+ if (debug_info_level > DINFO_LEVEL_TERSE)
+ {
+ memcpy (tail, " -g", 3);
+ tail += 3;
+ }
+#endif
+ }
+
FOR_EACH_VEC_ELT (switches, j, p)
{
len = strlen (p);
diff -N -u -r -w gcc-8.2.0/libgcc/config/mips/irix-crti.S gcc-8.2.0-patched/libgcc/config/mips/irix-crti.S
--- gcc-8.2.0/libgcc/config/mips/irix-crti.S 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/libgcc/config/mips/irix-crti.S 2019-08-08 09:31:22.317878320 +0000
@@ -0,0 +1,71 @@
+/* Copyright (C) 2004, 2008, 2011 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+ .abicalls
+ .set noreorder
+ .set nomacro
+
+/* The GNU and SGI linkers differ in their implementation of -init and -fini.
+ With the GNU linker, there can only be a single -init option, and the
+ linker simply sets DT_INIT to that value. gcc's initialization and
+ finalization code can go directly in .init, with the prologue and
+ epilogue of the main initialization routine being provided by external
+ object files (*crti.o and *crtn.o in this case).
+
+ The SGI linker instead accepts several -init options. It will set DT_INIT
+ to a linker-created function (placed in .init) that calls each of the -init
+ functions in turn. If there is any user code in .init, this linker-created
+ function will be placed after it. Note that such user code is not treated
+ specially; it will only be called if the -init options arrange for it to
+ be called.
+
+ In theory, the SGI model should allow the crti, crtn and intermediate code
+ to go in .init, just like it can with the GNU linker. However, doing this
+ seems to confuse the linker and triggers an internal error:
+
+ ld32: FATAL 2 : Internal: at ../../ld/mips_code.c mips_code_fixup()
+ text section overflow!
+
+ (seen with MIPSpro 7.30). We therefore put everything in a special
+ .gcc_init section instead. */
+
+ .section .gcc_init,"ax",@progbits
+ .globl __gcc_init
+__gcc_init:
+ daddiu $sp,$sp,-16
+ sd $31,0($sp)
+ sd $28,8($sp)
+
+ .section .gcc_fini,"ax",@progbits
+ .globl __gcc_fini
+__gcc_fini:
+ daddiu $sp,$sp,-16
+ sd $31,0($sp)
+ sd $28,8($sp)
+
+/* This object will typically be included in the final link for both
+ shared libraries and executable, and we need to hide the symbols to
+ prevent possible symbol preemption warnings from the SGI linker. */
+.hidden __gcc_init
+.hidden __gcc_fini
+
diff -N -u -r -w gcc-8.2.0/libgcc/config/mips/irix-crtn.S gcc-8.2.0-patched/libgcc/config/mips/irix-crtn.S
--- gcc-8.2.0/libgcc/config/mips/irix-crtn.S 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/libgcc/config/mips/irix-crtn.S 2019-08-08 09:31:22.320326960 +0000
@@ -0,0 +1,38 @@
+/* Copyright (C) 2004, 2011 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+ .abicalls
+ .set noreorder
+ .set nomacro
+
+ .section .gcc_init,"ax",@progbits
+ ld $31,0($sp)
+ ld $28,8($sp)
+ jr $31
+ daddiu $sp,$sp,16
+
+ .section .gcc_fini,"ax",@progbits
+ ld $31,0($sp)
+ ld $28,8($sp)
+ jr $31
+ daddiu $sp,$sp,16
diff -N -u -r -w gcc-8.2.0/libgcc/config/mips/irix6-unwind.h gcc-8.2.0-patched/libgcc/config/mips/irix6-unwind.h
--- gcc-8.2.0/libgcc/config/mips/irix6-unwind.h 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/libgcc/config/mips/irix6-unwind.h 2019-08-08 09:31:22.323507520 +0000
@@ -0,0 +1,180 @@
+/* DWARF2 EH unwinding support for MIPS IRIX 6.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
+/* This code was developed-for and only tested-in limited ABI
+ configurations. Characterize that. */
+
+#if defined (_ABIN32) || defined (_ABI64)
+#define SUPPORTED_ABI 1
+#else
+#define SUPPORTED_ABI 0
+#endif
+
+#include <signal.h>
+
+#define MD_FALLBACK_FRAME_STATE_FOR mips_fallback_frame_state
+
+/* Look at the code around RA to see if it matches a sighandler caller with a
+ sigcontext_t * argument (SA_SIGINFO cleared). Return that pointer argument
+ if it does match, or 0 otherwise. */
+
+static sigcontext_t *
+sigcontext_for (unsigned int *ra, void *cfa)
+{
+ /* IRIX 6.5, mono-threaded application. We're lucky enough to be able
+ to expect a short very sighandler specific sequence around.
+
+ <_sigtramp+124>: li v0,1088 (SYS_sigreturn)
+ <_sigtramp+128>: syscall */
+
+ if ( ra[6] == 0x24020440
+ && ra[7] == 0x0000000c)
+ return (sigcontext_t *)(cfa + 0x30);
+
+ /* IRIX 6.5 variants, multi-threaded application, pthreads. Nothing really
+ sighandler specific handy, so match a fairly long constant sequence. */
+
+#if _MIPS_SIM == _ABIN32
+ /*
+ <sig_fixup_mask+40>: sd s0,0(sp)
+ <sig_fixup_mask+44>: sll ra,a0,0x2
+ <sig_fixup_mask+48>: addiu t9,t9,-28584/-28456/-28448
+ <sig_fixup_mask+52>: lw s0,3804(at)
+ <sig_fixup_mask+56>: addu t9,t9,ra
+ <sig_fixup_mask+60>: lw t9,0(t9)
+ <sig_fixup_mask+64>: ld at,3696(at)
+ <sig_fixup_mask+68>: ld s2,88(s0)
+ <sig_fixup_mask+72>: jalr t9
+ <sig_fixup_mask+76>: sd at,88(s0) */
+ if ( ra[-10] == 0xffb00000
+ && ra[ -9] == 0x0004f880
+ && (ra[-8] == 0x27399058
+ || ra[-8] == 0x273990d8
+ || ra[-8] == 0x273990e0)
+ && ra[ -7] == 0x8c300edc
+ && ra[ -6] == 0x033fc821
+ && ra[ -5] == 0x8f390000
+ && ra[ -4] == 0xdc210e70
+ && ra[ -3] == 0xde120058
+ && ra[ -2] == 0x0320f809
+ && ra[ -1] == 0xfe010058)
+
+#elif _MIPS_SIM == _ABI64
+ /*
+ <sig_fixup_mask+44>: sd s0,0(sp)
+ <sig_fixup_mask+48>: daddu t9,t9,ra
+ <sig_fixup_mask+52>: dsll ra,a0,0x3
+ <sig_fixup_mask+56>: ld s0,3880(at)
+ <sig_fixup_mask+60>: daddu t9,t9,ra
+ <sig_fixup_mask+64>: ld t9,0(t9)
+ <sig_fixup_mask+68>: ld at,3696(at)
+ <sig_fixup_mask+72>: ld s2,152(s0)
+ <sig_fixup_mask+76>: jalr t9
+ <sig_fixup_mask+80>: sd at,152(s0) */
+ if ( ra[-10] == 0xffb00000
+ && ra[ -9] == 0x033fc82d
+ && ra[ -8] == 0x0004f8f8
+ && ra[ -7] == 0xdc300f28
+ && ra[ -6] == 0x033fc82d
+ && ra[ -5] == 0xdf390000
+ && ra[ -4] == 0xdc210e70
+ && ra[ -3] == 0xde120098
+ && ra[ -2] == 0x0320f809
+ && ra[ -1] == 0xfe010098)
+#endif
+ return (sigcontext_t *)(cfa + 0x60);
+
+ return 0;
+}
+
+#define SIGCTX_GREG_ADDR(REGNO,SIGCTX) \
+ ((void *) &(SIGCTX)->sc_regs[REGNO])
+
+#define SIGCTX_FPREG_ADDR(REGNO,SIGCTX) \
+ ((void *) &(SIGCTX)->sc_fpregs[REGNO])
+
+static _Unwind_Reason_Code
+mips_fallback_frame_state (struct _Unwind_Context *context,
+ _Unwind_FrameState *fs)
+{
+ /* Return address and CFA of the frame we're attempting to unwind through,
+ possibly a signal handler. */
+ void *ctx_ra = (void *)context->ra;
+ void *ctx_cfa = (void *)context->cfa;
+
+ /* CFA of the intermediate abstract kernel frame between the interrupted
+ code and the signal handler, if we're indeed unwinding through a signal
+ handler. */
+ void *k_cfa;
+
+ /* Pointer to the sigcontext_t structure pushed by the kernel when we're
+ unwinding through a signal handler setup with SA_SIGINFO cleared. */
+ sigcontext_t *sigctx;
+ int i;
+
+ if (! SUPPORTED_ABI)
+ return _URC_END_OF_STACK;
+
+ sigctx = sigcontext_for (ctx_ra, ctx_cfa);
+
+ if (sigctx == 0)
+ return _URC_END_OF_STACK;
+
+ /* The abstract kernel frame's CFA is extactly the stack pointer
+ value at the interruption point. */
+ k_cfa = *(void **)SIGCTX_GREG_ADDR (CTX_SP, sigctx);
+
+ /* State the rules to compute the CFA we have the value of: use the
+ previous CFA and offset by the difference between the two. See
+ uw_update_context_1 for the supporting details. */
+ fs->regs.cfa_how = CFA_REG_OFFSET;
+ fs->regs.cfa_reg = __builtin_dwarf_sp_column ();
+ fs->regs.cfa_offset = k_cfa - ctx_cfa;
+
+ /* Fill the internal frame_state structure with information stating where
+ each register of interest can be found from the CFA. */
+ for (i = 0; i <= 31; i ++)
+ {
+ fs->regs.reg[i].how = REG_SAVED_OFFSET;
+ fs->regs.reg[i].loc.offset = SIGCTX_GREG_ADDR (i, sigctx) - k_cfa;
+ }
+
+ for (i = 0; i <= 31; i ++)
+ {
+ fs->regs.reg[32+i].how = REG_SAVED_OFFSET;
+ fs->regs.reg[32+i].loc.offset = SIGCTX_FPREG_ADDR (i, sigctx) - k_cfa;
+ }
+
+ /* State the rules to find the kernel's code "return address", which is the
+ address of the active instruction when the signal was caught. */
+ fs->retaddr_column = DWARF_FRAME_RETURN_COLUMN;
+ fs->regs.reg[fs->retaddr_column].how = REG_SAVED_OFFSET;
+ fs->regs.reg[fs->retaddr_column].loc.offset = (void *)&sigctx->sc_pc - k_cfa;
+ fs->signal_frame = 1;
+
+ return _URC_NO_REASON;
+}
diff -N -u -r -w gcc-8.2.0/libgcc/config/mips/t-irix6 gcc-8.2.0-patched/libgcc/config/mips/t-irix6
--- gcc-8.2.0/libgcc/config/mips/t-irix6 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/libgcc/config/mips/t-irix6 2019-08-08 09:31:22.325889040 +0000
@@ -0,0 +1,24 @@
+# Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
+# 2006, 2010, 2011 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+irix-crti.o: $(srcdir)/config/mips/irix-crti.S
+ $(crt_compile) -c $<
+
+irix-crtn.o: $(srcdir)/config/mips/irix-crtn.S
+ $(crt_compile) -c $<
diff -N -u -r -w gcc-8.2.0/libgcc/config/mips/t-slibgcc-irix gcc-8.2.0-patched/libgcc/config/mips/t-slibgcc-irix
--- gcc-8.2.0/libgcc/config/mips/t-slibgcc-irix 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/libgcc/config/mips/t-slibgcc-irix 2019-08-08 09:31:22.328167520 +0000
@@ -0,0 +1,9 @@
+# Build a shared libgcc library with the SGI linker.
+
+SHLIB_LDFLAGS = -Wl,-soname,$(SHLIB_SONAME)
+#\
+ #-Wl,-exports_file,$(SHLIB_MAP)
+
+SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
+SHLIB_MAPFILES = libgcc-std.ver
+SHLIB_LC =
diff -N -u -r -w gcc-8.2.0/libgcc/config.host gcc-8.2.0-patched/libgcc/config.host
--- gcc-8.2.0/libgcc/config.host 2018-04-06 21:04:17.000000000 +0000
+++ gcc-8.2.0-patched/libgcc/config.host 2019-08-08 09:31:22.348275120 +0000
@@ -876,6 +876,11 @@
tmake_file="${tmake_file} microblaze/t-microblaze t-fdpbit"
extra_parts="$extra_parts crtbeginS.o crtendS.o crtbeginT.o crti.o crtn.o"
;;
+mips-sgi-irix6.5*)
+ tmake_file="$tmake_file mips/t-irix6 t-crtfm mips/t-tpbit t-slibgcc mips/t-slibgcc-irix"
+ extra_parts="crtbegin.o crtend.o crtfastmath.o irix-crti.o irix-crtn.o"
+ md_unwind_header=mips/irix6-unwind.h
+ ;;
microblaze*-*-rtems*)
tmake_file="${tmake_file} microblaze/t-microblaze t-fdpbit"
extra_parts="$extra_parts crtbeginS.o crtendS.o crtbeginT.o crti.o crtn.o"
diff -N -u -r -w gcc-8.2.0/libstdc++-v3/config/os/irix/atomic_word.h gcc-8.2.0-patched/libstdc++-v3/config/os/irix/atomic_word.h
--- gcc-8.2.0/libstdc++-v3/config/os/irix/atomic_word.h 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/libstdc++-v3/config/os/irix/atomic_word.h 2019-08-08 09:31:22.411092240 +0000
@@ -0,0 +1,35 @@
+// Low-level type for atomic operations -*- C++ -*-
+
+// Copyright (C) 2004, 2009, 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/atomic_word.h
+ * This is an internal header file, included by other library headers.
+ * Do not attempt to use it directly. @headername{ext/atomicity.h}
+ */
+
+#ifndef _GLIBCXX_ATOMIC_WORD_H
+#define _GLIBCXX_ATOMIC_WORD_H 1
+
+typedef long _Atomic_word;
+
+#endif
diff -N -u -r -w gcc-8.2.0/libstdc++-v3/config/os/irix/atomicity.h gcc-8.2.0-patched/libstdc++-v3/config/os/irix/atomicity.h
--- gcc-8.2.0/libstdc++-v3/config/os/irix/atomicity.h 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/libstdc++-v3/config/os/irix/atomicity.h 2019-08-08 09:31:22.413603360 +0000
@@ -0,0 +1,41 @@
+// Low-level functions for atomic operations: IRIX version -*- C++ -*-
+
+// Copyright (C) 2001, 2004, 2005, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+#include <mutex.h>
+#include <ext/atomicity.h>
+
+namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ _Atomic_word
+ __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
+ { return (_Atomic_word) test_then_add((unsigned long*) const_cast<_Atomic_word*>(__mem), __val); }
+
+ void
+ __atomic_add(volatile _Atomic_word* __mem, int __val) throw ()
+ { __exchange_and_add(__mem, __val); }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff -N -u -r -w gcc-8.2.0/libstdc++-v3/config/os/irix/irix6.5/ctype_base.h gcc-8.2.0-patched/libstdc++-v3/config/os/irix/irix6.5/ctype_base.h
--- gcc-8.2.0/libstdc++-v3/config/os/irix/irix6.5/ctype_base.h 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/libstdc++-v3/config/os/irix/irix6.5/ctype_base.h 2019-08-08 09:31:22.449049680 +0000
@@ -0,0 +1,65 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2003, 2009, 2010
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/ctype_base.h
+ * This is an internal header file, included by other library headers.
+ * Do not attempt to use it directly. @headername{locale}
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+// Information as gleaned from /usr/include/ctype.h on irix 6.5
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ /// @brief Base class for ctype.
+ struct ctype_base
+ {
+ // Non-standard typedefs.
+ typedef int* __to_type;
+
+ // NB: Offsets into ctype<char>::_M_table force a particular size
+ // on the mask type. Because of this, we don't use an enum.
+ typedef unsigned int mask;
+ static const mask upper = _ISupper;
+ static const mask lower = _ISlower;
+ static const mask alpha = _ISalpha;
+ static const mask digit = _ISdigit;
+ static const mask xdigit = _ISxdigit;
+ static const mask space = _ISspace;
+ static const mask print = _ISprint;
+ static const mask graph = _ISalpha | _ISdigit | _ISpunct;
+ static const mask cntrl = _IScntrl;
+ static const mask punct = _ISpunct;
+ static const mask alnum = _ISalpha | _ISdigit;
+ static const mask blank = _ISblank;
+ };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff -N -u -r -w gcc-8.2.0/libstdc++-v3/config/os/irix/irix6.5/ctype_configure_char.cc gcc-8.2.0-patched/libstdc++-v3/config/os/irix/irix6.5/ctype_configure_char.cc
--- gcc-8.2.0/libstdc++-v3/config/os/irix/irix6.5/ctype_configure_char.cc 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/libstdc++-v3/config/os/irix/irix6.5/ctype_configure_char.cc 2019-08-08 09:31:22.451898400 +0000
@@ -0,0 +1,101 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return 0; }
+
+ ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
+ size_t __refs)
+ : facet(__refs), _M_del(__table != 0 && __del),
+ _M_toupper(NULL), _M_tolower(NULL),
+ _M_table(!__table ?
+ (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
+
+ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
+ : facet(__refs), _M_del(__table != 0 && __del),
+ _M_toupper(NULL), _M_tolower(NULL),
+ _M_table(!__table ?
+ (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
+
+ char
+ ctype<char>::do_toupper(char __c) const
+ { return _toupper(__c); }
+
+ const char*
+ ctype<char>::do_toupper(char* __low, const char* __high) const
+ {
+ while (__low < __high)
+ {
+ *__low = do_toupper(*__low);
+ ++__low;
+ }
+ return __high;
+ }
+
+ char
+ ctype<char>::do_tolower(char __c) const
+ { return _tolower(__c); }
+
+ const char*
+ ctype<char>::do_tolower(char* __low, const char* __high) const
+ {
+ while (__low < __high)
+ {
+ *__low = do_tolower(*__low);
+ ++__low;
+ }
+ return __high;
+ }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff -N -u -r -w gcc-8.2.0/libstdc++-v3/config/os/irix/irix6.5/ctype_inline.h gcc-8.2.0-patched/libstdc++-v3/config/os/irix/irix6.5/ctype_inline.h
--- gcc-8.2.0/libstdc++-v3/config/os/irix/irix6.5/ctype_inline.h 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/libstdc++-v3/config/os/irix/irix6.5/ctype_inline.h 2019-08-08 09:31:22.456201520 +0000
@@ -0,0 +1,74 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2000, 2002, 2009, 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/ctype_inline.h
+ * This is an internal header file, included by other library headers.
+ * Do not attempt to use it directly. @headername{locale}
+ */
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
+// functions go in ctype.cc
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ bool
+ ctype<char>::
+ is(mask __m, char __c) const
+ { return (_M_table)[static_cast<unsigned char>(__c)] & __m; }
+
+ const char*
+ ctype<char>::
+ is(const char* __low, const char* __high, mask* __vec) const
+ {
+ while (__low < __high)
+ *__vec++ = (_M_table)[static_cast<unsigned char>(*__low++)];
+ return __high;
+ }
+
+ const char*
+ ctype<char>::
+ scan_is(mask __m, const char* __low, const char* __high) const
+ {
+ while (__low < __high && ! this->is(__m, *__low))
+ ++__low;
+ return __low;
+ }
+
+ const char*
+ ctype<char>::
+ scan_not(mask __m, const char* __low, const char* __high) const
+ {
+ while (__low < __high && this->is(__m, *__low))
+ ++__low;
+ return __low;
+ }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff -N -u -r -w gcc-8.2.0/libstdc++-v3/config/os/irix/irix6.5/os_defines.h gcc-8.2.0-patched/libstdc++-v3/config/os/irix/irix6.5/os_defines.h
--- gcc-8.2.0/libstdc++-v3/config/os/irix/irix6.5/os_defines.h 1970-01-01 00:00:00.000000000 +0000
+++ gcc-8.2.0-patched/libstdc++-v3/config/os/irix/irix6.5/os_defines.h 2019-08-08 09:31:22.458922960 +0000
@@ -0,0 +1,60 @@
+// Specific definitions for IRIX -*- C++ -*-
+
+// Copyright (C) 2000, 2002, 2009, 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/os_defines.h
+ * This is an internal header file, included by other library headers.
+ * Do not attempt to use it directly. @headername{iosfwd}
+ */
+
+#ifndef _GLIBCXX_OS_DEFINES
+#define _GLIBCXX_OS_DEFINES 1
+
+// System-specific #define, typedefs, corrections, etc, go here. This
+// file will come before all others.
+
+#define _GLIBCXX_USE_C99 1
+#define _GLIBCXX_USE_C99_STDIO 1
+#define _GLIBCXX_USE_C99_STDLIB 1
+#define _GLIBCXX_USE_C99_WCHAR 1
+#define _GLIBCXX_USE_WCHAR_T 1
+
+// We need large file support. There are two ways to turn it on: by
+// defining either _LARGEFILE64_SOURCE or _SGI_SOURCE. However, it
+// does not actually work to define only the former, as then
+// <sys/stat.h> is invalid: `st_blocks' is defined to be a macro, but
+// then used as a field name. So, we have to turn on _SGI_SOURCE.
+// That only works if _POSIX_SOURCE is turned off, so we have to
+// explicitly turn it off. (Some of the libio C files explicitly try
+// to turn it on.) _SGI_SOURCE is actually turned on implicitly via
+// the command-line.
+#undef _POSIX_SOURCE
+
+// GCC does not use thunks on IRIX.
+#define _G_USING_THUNKS 0
+
+// FINOREAD takes an "off_t *" as argument.
+#define _GLIBCXX_FIONREAD_TAKES_OFF_T
+
+#endif
+
diff -N -u -r -w gcc-8.2.0/libstdc++-v3/configure.host gcc-8.2.0-patched/libstdc++-v3/configure.host
--- gcc-8.2.0/libstdc++-v3/configure.host 2017-02-02 16:24:03.000000000 +0000
+++ gcc-8.2.0-patched/libstdc++-v3/configure.host 2019-08-08 09:31:22.491972080 +0000
@@ -273,6 +273,15 @@
hpux*)
os_include_dir="os/hpux"
;;
+ irix6.5*)
+ os_include_dir="os/irix/irix6.5"
+ atomicity_dir=os/irix
+ atomic_word_dir=os/irix
+ # libstdc++.so relies on emutls on IRIX, which only works with the
+ # real functions implemented in libpthread.so, not with the stubs in
+ # libc, so always pass -lpthread.
+ OPT_LDFLAGS="${OPT_LDFLAGS} -lpthread"
+ ;;
mingw32*)
case "$host" in
*-w64-*)
You can’t perform that action at this time.