gcc.patch 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. diff --git a/config.sub b/config.sub
  2. index 41146e1..8438e24 100755
  3. --- a/config.sub
  4. +++ b/config.sub
  5. @@ -1375,6 +1375,7 @@ case $os in
  6. # -sysv* is not here because it comes later, after sysvr4.
  7. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
  8. | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
  9. + | -toaru* \
  10. | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
  11. | -sym* | -kopensolaris* | -plan9* \
  12. | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
  13. diff --git a/fixincludes/mkfixinc.sh b/fixincludes/mkfixinc.sh
  14. index 0d96c8c..1ae6bdc 100755
  15. --- a/fixincludes/mkfixinc.sh
  16. +++ b/fixincludes/mkfixinc.sh
  17. @@ -13,6 +13,7 @@ target=fixinc.sh
  18. case $machine in
  19. i?86-*-cygwin* | \
  20. i?86-*-mingw32* | \
  21. + i?86-*-toaru* | \
  22. x86_64-*-mingw32* | \
  23. i?86-*-interix* | \
  24. powerpc-*-eabisim* | \
  25. diff --git a/gcc/config.gcc b/gcc/config.gcc
  26. index 1d5b23f..603a22b 100644
  27. --- a/gcc/config.gcc
  28. +++ b/gcc/config.gcc
  29. @@ -820,6 +820,11 @@ case ${target} in
  30. gnu_ld=yes
  31. default_use_cxa_atexit=yes
  32. ;;
  33. +*-*-toaru*)
  34. + gas=yes
  35. + gnu_ld=yes
  36. + default_use_cxa_atexit=yes
  37. + ;;
  38. *-*-rtems*)
  39. case ${enable_threads} in
  40. "" | yes | rtems) thread_file='rtems' ;;
  41. @@ -1441,6 +1446,9 @@ x86_64-*-rdos*)
  42. tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h i386/rdos.h i386/rdos64.h"
  43. tmake_file="i386/t-i386elf t-svr4"
  44. ;;
  45. +*-*-toaru*)
  46. + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h glibc-stdint.h i386/i386elf.h toaru.h"
  47. + ;;
  48. i[34567]86-*-dragonfly*)
  49. tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/dragonfly.h"
  50. tmake_file="${tmake_file} i386/t-crtstuff"
  51. diff --git a/gcc/config/toaru.h b/gcc/config/toaru.h
  52. new file mode 100644
  53. index 0000000..9157525
  54. --- /dev/null
  55. +++ b/gcc/config/toaru.h
  56. @@ -0,0 +1,26 @@
  57. +#undef TARGET_OS_CPP_BUILTINS
  58. +#define TARGET_OS_CPP_BUILTINS() \
  59. + do { \
  60. + builtin_define_std ("toaru"); \
  61. + builtin_define_std ("unix"); \
  62. + builtin_assert ("system=toaru"); \
  63. + builtin_assert ("system=unix"); \
  64. + } while (0);
  65. +
  66. +#undef STARTFILE_SPEC
  67. +#define STARTFILE_SPEC "%{!shared: %{!pg:crt0.o%s}} crti.o%s %{!shared:crtbegin.o%s}"
  68. +
  69. +#undef ENDFILE_SPEC
  70. +#define ENDFILE_SPEC "%{!shared:crtend.o%s} crtn.o%s"
  71. +
  72. +#undef LINK_SPEC
  73. +#define LINK_SPEC "%{shared:-shared} %{static:-static} %{!shared: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld.so}}}"
  74. +
  75. +#undef LIB_SPEC
  76. +#define LIB_SPEC "%{pthread:-lpthread} -lc"
  77. +
  78. +#undef OBJECT_FORMAT_ELF
  79. +#define OBJECT_FORMAT_ELF
  80. +
  81. +#undef NO_IMPLICIT_EXTERN_C
  82. +#define NO_IMPLICIT_EXTERN_C 1
  83. diff --git a/libgcc/config.host b/libgcc/config.host
  84. index 124f2ce..c865054 100644
  85. --- a/libgcc/config.host
  86. +++ b/libgcc/config.host
  87. @@ -656,6 +656,10 @@ i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
  88. ;;
  89. i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
  90. ;;
  91. +i[34567]86-*-toaru*)
  92. + extra_parts="$extra_parts crtbegin.o crtend.o"
  93. + tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
  94. + ;;
  95. i[34567]86-*-cygwin*)
  96. extra_parts="crtbegin.o crtbeginS.o crtend.o crtfastmath.o"
  97. if test x$enable_vtable_verify = xyes; then
  98. diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4
  99. index ece1256..97566e6 100644
  100. --- a/libstdc++-v3/crossconfig.m4
  101. +++ b/libstdc++-v3/crossconfig.m4
  102. @@ -248,6 +248,12 @@ case "${host}" in
  103. GLIBCXX_CHECK_MATH_SUPPORT
  104. GLIBCXX_CHECK_STDLIB_SUPPORT
  105. ;;
  106. + *-toaru*)
  107. + GLIBCXX_CHECK_COMPILER_FEATURES
  108. + GLIBCXX_CHECK_LINKER_FEATURES
  109. + GLIBCXX_CHECK_MATH_SUPPORT
  110. + GLIBCXX_CHECK_STDLIB_SUPPORT
  111. + ;;
  112. *-vxworks)
  113. AC_DEFINE(HAVE_ACOSF)
  114. AC_DEFINE(HAVE_ASINF)
  115. diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
  116. index 03e198a..e0eb9d6 100644
  117. --- a/libstdc++-v3/include/std/type_traits
  118. +++ b/libstdc++-v3/include/std/type_traits
  119. @@ -38,7 +38,7 @@
  120. #include <bits/c++config.h>
  121. #ifdef _GLIBCXX_USE_C99_STDINT_TR1
  122. -# if defined (__UINT_LEAST16_TYPE__) && defined(__UINT_LEAST32_TYPE__)
  123. +# if defined (__UINT_LEAST16_TYPE__) && defined(__UINT_LEAST32_TYPE__) && 0
  124. namespace std
  125. {
  126. typedef __UINT_LEAST16_TYPE__ uint_least16_t;