/usr/src/gcc-4.6/debian/patches/m68k-mint.diff is in gcc-4.6-source 4.6.4-6ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 | # DP: Add support for the m68k-atari-mint target.
Description: Add support for the m68k-atari-mint target
http://vincent.riviere.free.fr/soft/m68k-atari-mint/ contains a
collection of patches for a FreeMiNT cross and native toolchain.
This patch applies gcc-4.6.2-mint-20111028.patch.bz2 except the
not FreeMiNT-specific parts, which are already applied. It has
been reviewed, whitespace-sanitised, and some changes previously
globally applied are now only enabled for a FreeMiNT target.
Origin: http://vincent.riviere.free.fr/soft/m68k-atari-mint/archives/gcc-4.6.2-mint-20111028.patch.bz2
Author: Vincent Rivière <vincent.riviere@freesbee.fr>
Reviewed-by: Thorsten Glaser <tg@debian.org>
Last-Update: 2012-04-22
--- a/src/config-ml.in
+++ b/src/config-ml.in
@@ -351,6 +351,23 @@ m68*-*-*)
esac
done
fi
+ case "${host}" in
+ *-*-mint*)
+ case "${srcdir}" in
+ */libgcc ) : ;;
+ *)
+ old_multidirs="${multidirs}"
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "$x" in
+ *mshort ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ ;;
+ esac
+ ;;
+ esac
;;
mips*-*-*)
if [ x$enable_single_float = xno ]
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -523,6 +523,9 @@ if test x$enable_libmudflap = x ; then
*-*-freebsd*)
# Enable libmudflap by default in FreeBSD.
;;
+ *-*-mint*)
+ # Enable libmudflap by default in MiNT.
+ ;;
*)
# Disable it by default everywhere else.
noconfigdirs="$noconfigdirs target-libmudflap"
@@ -895,6 +898,9 @@ case "${target}" in
m68k-*-coff*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
+ m68k-*-mint*)
+ noconfigdirs="$noconfigdirs target-libiberty ${libgcj}"
+ ;;
m68*-*-* | fido-*-*)
libgloss_dir=m68k
;;
--- a/src/gcc/config/m68k/lb1sf68.asm
+++ b/src/gcc/config/m68k/lb1sf68.asm
@@ -666,7 +666,9 @@ ROUND_TO_MINUS = 3 | round result tow
.globl SYM (__negdf2)
.globl SYM (__cmpdf2)
.globl SYM (__cmpdf2_internal)
+#ifdef __ELF__
.hidden SYM (__cmpdf2_internal)
+#endif
.text
.even
@@ -2581,7 +2583,9 @@ ROUND_TO_MINUS = 3 | round result tow
.globl SYM (__negsf2)
.globl SYM (__cmpsf2)
.globl SYM (__cmpsf2_internal)
+#ifdef __ELF__
.hidden SYM (__cmpsf2_internal)
+#endif
| These are common routines to return and signal exceptions.
--- a/src/gcc/config/m68k/math-68881.h
+++ b/src/gcc/config/m68k/math-68881.h
@@ -42,6 +42,15 @@
#ifndef __math_68881
#define __math_68881
+#undef __math_68881_inline
+#if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__)
+#define __math_68881_inline extern __inline__ __attribute__((__gnu_inline__))
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+#define __math_68881_inline static inline
+#else
+#define __math_68881_inline extern __inline__
+#endif
+
#include <errno.h>
#undef HUGE_VAL
@@ -64,7 +73,7 @@
})
#endif
-__inline extern double
+__math_68881_inline double
sin (double x)
{
double value;
@@ -75,7 +84,7 @@ sin (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
cos (double x)
{
double value;
@@ -86,7 +95,7 @@ cos (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
tan (double x)
{
double value;
@@ -97,7 +106,7 @@ tan (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
asin (double x)
{
double value;
@@ -108,7 +117,7 @@ asin (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
acos (double x)
{
double value;
@@ -119,7 +128,7 @@ acos (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
atan (double x)
{
double value;
@@ -130,7 +139,7 @@ atan (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
atan2 (double y, double x)
{
double pi, pi_over_2;
@@ -187,7 +196,7 @@ atan2 (double y, double x)
}
}
-__inline extern double
+__math_68881_inline double
sinh (double x)
{
double value;
@@ -198,7 +207,7 @@ sinh (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
cosh (double x)
{
double value;
@@ -209,7 +218,7 @@ cosh (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
tanh (double x)
{
double value;
@@ -220,7 +229,7 @@ tanh (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
atanh (double x)
{
double value;
@@ -231,7 +240,7 @@ atanh (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
exp (double x)
{
double value;
@@ -242,7 +251,7 @@ exp (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
expm1 (double x)
{
double value;
@@ -253,7 +262,7 @@ expm1 (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
log (double x)
{
double value;
@@ -264,7 +273,7 @@ log (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
log1p (double x)
{
double value;
@@ -275,7 +284,7 @@ log1p (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
log10 (double x)
{
double value;
@@ -286,7 +295,7 @@ log10 (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
sqrt (double x)
{
double value;
@@ -297,13 +306,13 @@ sqrt (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
hypot (double x, double y)
{
return sqrt (x*x + y*y);
}
-__inline extern double
+__math_68881_inline double
pow (double x, double y)
{
if (x > 0)
@@ -352,7 +361,7 @@ pow (double x, double y)
}
}
-__inline extern double
+__math_68881_inline double
fabs (double x)
{
double value;
@@ -363,7 +372,7 @@ fabs (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
ceil (double x)
{
int rounding_mode, round_up;
@@ -385,7 +394,7 @@ ceil (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
floor (double x)
{
int rounding_mode, round_down;
@@ -408,7 +417,7 @@ floor (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
rint (double x)
{
int rounding_mode, round_nearest;
@@ -430,7 +439,7 @@ rint (double x)
return value;
}
-__inline extern double
+__math_68881_inline double
fmod (double x, double y)
{
double value;
@@ -442,7 +451,7 @@ fmod (double x, double y)
return value;
}
-__inline extern double
+__math_68881_inline double
drem (double x, double y)
{
double value;
@@ -454,7 +463,7 @@ drem (double x, double y)
return value;
}
-__inline extern double
+__math_68881_inline double
scalb (double x, int n)
{
double value;
@@ -466,7 +475,7 @@ scalb (double x, int n)
return value;
}
-__inline extern double
+__math_68881_inline double
logb (double x)
{
double exponent;
@@ -477,7 +486,7 @@ logb (double x)
return exponent;
}
-__inline extern double
+__math_68881_inline double
ldexp (double x, int n)
{
double value;
@@ -489,7 +498,7 @@ ldexp (double x, int n)
return value;
}
-__inline extern double
+__math_68881_inline double
frexp (double x, int *exp)
{
double float_exponent;
@@ -514,7 +523,7 @@ frexp (double x, int *exp)
return mantissa;
}
-__inline extern double
+__math_68881_inline double
modf (double x, double *ip)
{
double temp;
--- /dev/null
+++ b/src/gcc/config/m68k/mint.h
@@ -0,0 +1,179 @@
+/* Definitions of target machine for GNU compiler.
+ Atari ST TOS/MiNT.
+ Copyright (C) 1994, 1995, 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/>. */
+
+/* Here are four prefixes that are used by asm_fprintf to
+ facilitate customization for alternate assembler syntaxes.
+ Machines with no likelihood of an alternate syntax need not
+ define these and need not use asm_fprintf. */
+
+/* The prefix for register names. Note that REGISTER_NAMES
+ is supposed to include this prefix. Also note that this is NOT an
+ fprintf format string, it is a literal string */
+
+#undef REGISTER_PREFIX
+#define REGISTER_PREFIX "%"
+
+/* The prefix for local (compiler generated) labels.
+ These labels will not appear in the symbol table. */
+
+#undef LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX "."
+
+#undef ASM_COMMENT_START
+#define ASM_COMMENT_START "|"
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "short unsigned int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE SHORT_TYPE_SIZE
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__MINT__"); \
+ builtin_define_std ("atarist"); \
+ builtin_assert ("machine=atari"); \
+ builtin_assert ("system=mint"); \
+ if (TARGET_68881) \
+ /* non-standard */ \
+ builtin_define ("__M68881__"); \
+ } \
+ while (0)
+
+/* The following defines are nonstandard
+ and are kept only for compatibility
+ with older versions of GCC for MiNT. */
+
+#undef CPP_SPEC
+#define CPP_SPEC \
+ "%{m68000:-D__M68000__} " \
+ "%{mc68020:-D__M68020__} " \
+ "%{m68020:-D__M68020__} " \
+ "%{m68030:-D__M68020__} " \
+ "%{m68040:-D__M68020__} " \
+ "%{m68060:-D__M68020__} " \
+ "%{m68020-40:-D__M68020__} " \
+ "%{m68020-60:-D__M68020__} " \
+ "%{!m680*:%{!mc680*:-D__M68000__}} " \
+ "%{mshort:-D__MSHORT__}"
+
+#define STARTFILE_SPEC "%{pg|p|profile:gcrt0.o%s;:crt0.o%s}"
+#define LIB_SPEC "-lc"
+
+/* Every structure or union's size must be a multiple of 2 bytes. */
+#define STRUCTURE_SIZE_BOUNDARY 16
+
+/* The -g option generates stabs debug information. */
+#define DBX_DEBUGGING_INFO 1
+
+/* This is the assembler directive to equate two values. */
+#undef SET_ASM_OP
+#define SET_ASM_OP "\t.set\t"
+
+/* This is how we tell the assembler that a symbol is weak. */
+#undef ASM_WEAKEN_LABEL
+#define ASM_WEAKEN_LABEL(FILE,NAME) \
+ do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
+ fputc ('\n', FILE); } while (0)
+
+/* Don't default to pcc-struct-return, because gcc is the only compiler, and
+ we want to retain compatibility with older gcc versions. */
+#define DEFAULT_PCC_STRUCT_RETURN 0
+
+/* The system headers are C++-aware. */
+#define NO_IMPLICIT_EXTERN_C
+
+/* By default, the vtable entries are void pointers, the so the alignment
+ is the same as pointer alignment. The value of this macro specifies
+ the alignment of the vtable entry in bits. It should be defined only
+ when special alignment is necessary.
+
+ MiNT: The default value of 32 is too much and unsupported by a.out-mintprg.
+*/
+#define TARGET_VTABLE_ENTRY_ALIGN 16
+
+/* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
+ the rest of the DWARF 2 frame unwind support is also provided.
+
+ MiNT: DWARF 2 frame unwind is not supported by a.out-mint.
+*/
+#define DWARF2_UNWIND_INFO 0
+
+/* config/m68k.md has an explicit reference to the program counter,
+ prefix this by the register prefix. */
+
+#define ASM_RETURN_CASE_JUMP \
+ do { \
+ if (TARGET_COLDFIRE) \
+ { \
+ if (ADDRESS_REG_P (operands[0])) \
+ return "jmp %%pc@(2,%0:l)"; \
+ else \
+ return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \
+ } \
+ else \
+ return "jmp %%pc@(2,%0:w)"; \
+ } while (0)
+
+/* The ADDR_DIFF_VEC must exactly follow the previous instruction. */
+
+#undef ADDR_VEC_ALIGN
+#define ADDR_VEC_ALIGN(ADDR_VEC) 0
+
+/* If defined, a C expression whose value is a string containing the
+ assembler operation to identify the following data as uninitialized global
+ data. */
+
+#define BSS_SECTION_ASM_OP "\t.bss"
+
+/* A C statement (sans semicolon) to output to the stdio stream
+ FILE the assembler definition of uninitialized global DECL named
+ NAME whose size is SIZE bytes and alignment is ALIGN bytes.
+ Try to use asm_output_aligned_bss to implement this macro. */
+
+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
+ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
+
+/* Disable -fpic and -fPIC since bsr.l _label@PLTPC
+ is unsupported by the assembler. */
+
+#undef SUBTARGET_OVERRIDE_OPTIONS
+#define SUBTARGET_OVERRIDE_OPTIONS \
+do { \
+ if (flag_pic && !TARGET_PCREL) \
+ error ("-f%s is not supported on this target", \
+ (flag_pic > 1) ? "PIC" : "pic"); \
+} while (0)
+
+
+/* Workaround for GCC bug #35067 about multiple thunks. */
+
+#undef MAKE_DECL_ONE_ONLY
+#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+
+/* Avoid requiring -static with -fmudflap like in config/bfin/uclinux.h */
+#define MFWRAP_SPEC " %{fmudflap|fmudflapth: \
+ --wrap=malloc --wrap=free --wrap=calloc --wrap=realloc\
+ --wrap=mmap --wrap=munmap --wrap=alloca\
+ %{fmudflapth: --wrap=pthread_create\
+}} %{fmudflap|fmudflapth: --wrap=main}"
--- /dev/null
+++ b/src/gcc/config/m68k/t-mint
@@ -0,0 +1,41 @@
+#
+# Use multiple libraries
+#
+
+MULTILIB_OPTIONS = m68020-60/mcpu=5475 mshort
+
+MULTILIB_DIRNAMES = m68020-60 m5475 mshort
+
+MULTILIB_MATCHES = \
+ m68020-60=m68881 \
+ m68020-60=m68020 \
+ m68020-60=m68020-40 \
+ m68020-60=mc68020 \
+ m68020-60=m68030 \
+ m68020-60=m68040 \
+ m68020-60=m68060 \
+ m68020-60=mcpu?68020 \
+ m68020-60=mcpu?68030 \
+ m68020-60=mcpu?68040 \
+ m68020-60=mcpu?68060 \
+ m68020-60=march?68020 \
+ m68020-60=march?68030 \
+ m68020-60=march?68040 \
+ m68020-60=march?68060 \
+ mcpu?5475=mcfv4e \
+ mcpu?5475=mcpu?5470 \
+ mcpu?5475=mcpu?5471 \
+ mcpu?5475=mcpu?5472 \
+ mcpu?5475=mcpu?5473 \
+ mcpu?5475=mcpu?5474 \
+ mcpu?5475=mcpu?547x \
+ mcpu?5475=mcpu?5480 \
+ mcpu?5475=mcpu?5481 \
+ mcpu?5475=mcpu?5482 \
+ mcpu?5475=mcpu?5483 \
+ mcpu?5475=mcpu?5484 \
+ mcpu?5475=mcpu?5485 \
+ mcpu?5475=mcpu?548x
+
+LIBGCC = stmp-multilib
+INSTALL_LIBGCC = install-multilib
--- a/src/gcc/config.gcc
+++ b/src/gcc/config.gcc
@@ -1809,6 +1809,15 @@ m68k-*-linux*) # Motorola m68k's runni
fi
tmake_file="$tmake_file t-slibgcc-libgcc"
;;
+m68k-*-mint*)
+ default_m68k_cpu=68000
+ default_cf_cpu=5475
+ tm_file="${tm_file} m68k/mint.h"
+ tm_defines="${tm_defines} MOTOROLA=1"
+ tmake_file="m68k/t-floatlib m68k/t-mint"
+ gas=yes
+ gnu_ld=yes
+ ;;
m68k-*-rtems*)
default_m68k_cpu=68020
default_cf_cpu=5206
--- a/src/libdecnumber/decNumberLocal.h
+++ b/src/libdecnumber/decNumberLocal.h
@@ -188,7 +188,8 @@ see the files COPYING3 and COPYING.RUNTI
#if (DECNUMMAXE != DEC_MAX_EMAX)
#error Maximum exponent mismatch
#endif
- #if (DECNUMMINE != DEC_MIN_EMIN)
+ /* gcc 2.95.3 has bug in "!=" operator for negative constants */
+ #if !(DECNUMMINE == DEC_MIN_EMIN)
#error Minimum exponent mismatch
#endif
--- a/src/libgcc/config.host
+++ b/src/libgcc/config.host
@@ -388,6 +388,8 @@ m68k-*-linux*) # Motorola m68k's runni
# aka the GNU/Linux C library 6.
tmake_file="$tmake_file m68k/t-linux"
;;
+m68k-*-mint*)
+ ;;
m68k-*-rtems*)
;;
mcore-*-elf)
--- a/src/libiberty/configure.ac
+++ b/src/libiberty/configure.ac
@@ -201,6 +201,7 @@ esac
if [[ "${shared}" = "yes" ]]; then
case "${host}" in
*-*-cygwin*) ;;
+ *-*-mint*) ;;
alpha*-*-linux*) PICFLAG=-fPIC ;;
arm*-*-*) PICFLAG=-fPIC ;;
hppa*-*-*) PICFLAG=-fPIC ;;
--- a/src/libiberty/hex.c
+++ b/src/libiberty/hex.c
@@ -24,7 +24,8 @@ Boston, MA 02110-1301, USA. */
#include "libiberty.h"
#include "safe-ctype.h" /* for HOST_CHARSET_ASCII */
-#if EOF != -1
+/* gcc 2.95.3 has bug in "!=" operator for negative constants */
+#if !(EOF == -1)
#error "hex.c requires EOF == -1"
#endif
--- a/src/libiberty/safe-ctype.c
+++ b/src/libiberty/safe-ctype.c
@@ -119,7 +119,8 @@ sets of characters:
#include <safe-ctype.h>
#include <stdio.h> /* for EOF */
-#if EOF != -1
+/* gcc 2.95.3 has bug in "!=" operator for negative constants */
+#if !(EOF == -1)
#error "<safe-ctype.h> requires EOF == -1"
#endif
--- a/src/libmudflap/mf-hooks2.c
+++ b/src/libmudflap/mf-hooks2.c
@@ -1667,6 +1667,7 @@ WRAPPER2(int, system, const char *string
return system (string);
}
+#ifdef HAVE_DLFCN_H
WRAPPER2(void *, dlopen, const char *path, int flags)
{
@@ -1737,6 +1738,7 @@ WRAPPER2(void *, dlsym, void *handle, ch
return p;
}
+#endif /* HAVE_DLFCN_H */
#if defined (HAVE_SYS_IPC_H) && defined (HAVE_SYS_SEM_H) && defined (HAVE_SYS_SHM_H)
--- a/src/libmudflap/mf-runtime.h
+++ b/src/libmudflap/mf-runtime.h
@@ -97,6 +97,7 @@ extern int __mf_set_options (const char
instrumented modules are meant to be affected. */
#ifdef _MUDFLAP
+#ifndef __USER_LABEL_PREFIX__
#pragma redefine_extname memcpy __mfwrap_memcpy
#pragma redefine_extname memmove __mfwrap_memmove
#pragma redefine_extname memset __mfwrap_memset
@@ -230,6 +231,141 @@ extern int __mf_set_options (const char
#pragma redefine_extname getprotoent __mfwrap_getprotoent
#pragma redefine_extname getprotobyname __mfwrap_getprotobyname
#pragma redefine_extname getprotobynumber __mfwrap_getprotobynumber
+#else
+#pragma redefine_extname memcpy ___mfwrap_memcpy
+#pragma redefine_extname memmove ___mfwrap_memmove
+#pragma redefine_extname memset ___mfwrap_memset
+#pragma redefine_extname memcmp ___mfwrap_memcmp
+#pragma redefine_extname memchr ___mfwrap_memchr
+#pragma redefine_extname memrchr ___mfwrap_memrchr
+#pragma redefine_extname strcpy ___mfwrap_strcpy
+#pragma redefine_extname strncpy ___mfwrap_strncpy
+#pragma redefine_extname strcat ___mfwrap_strcat
+#pragma redefine_extname strncat ___mfwrap_strncat
+#pragma redefine_extname strcmp ___mfwrap_strcmp
+#pragma redefine_extname strcasecmp ___mfwrap_strcasecmp
+#pragma redefine_extname strncmp ___mfwrap_strncmp
+#pragma redefine_extname strncasecmp ___mfwrap_strncasecmp
+#pragma redefine_extname strdup ___mfwrap_strdup
+#pragma redefine_extname strndup ___mfwrap_strndup
+#pragma redefine_extname strchr ___mfwrap_strchr
+#pragma redefine_extname strrchr ___mfwrap_strrchr
+#pragma redefine_extname strstr ___mfwrap_strstr
+#pragma redefine_extname memmem ___mfwrap_memmem
+#pragma redefine_extname strlen ___mfwrap_strlen
+#pragma redefine_extname strnlen ___mfwrap_strnlen
+#pragma redefine_extname bzero ___mfwrap_bzero
+#pragma redefine_extname bcopy ___mfwrap_bcopy
+#pragma redefine_extname bcmp ___mfwrap_bcmp
+#pragma redefine_extname index ___mfwrap_index
+#pragma redefine_extname rindex ___mfwrap_rindex
+#pragma redefine_extname asctime ___mfwrap_asctime
+#pragma redefine_extname ctime ___mfwrap_ctime
+#pragma redefine_extname gmtime ___mfwrap_gmtime
+#pragma redefine_extname localtime ___mfwrap_localtime
+#pragma redefine_extname time ___mfwrap_time
+#pragma redefine_extname strerror ___mfwrap_strerror
+#pragma redefine_extname fopen ___mfwrap_fopen
+#pragma redefine_extname fdopen ___mfwrap_fdopen
+#pragma redefine_extname freopen ___mfwrap_freopen
+#pragma redefine_extname fclose ___mfwrap_fclose
+#pragma redefine_extname fread ___mfwrap_fread
+#pragma redefine_extname fwrite ___mfwrap_fwrite
+#pragma redefine_extname fgetc ___mfwrap_fgetc
+#pragma redefine_extname fgets ___mfwrap_fgets
+#pragma redefine_extname getc ___mfwrap_getc
+#pragma redefine_extname gets ___mfwrap_gets
+#pragma redefine_extname ungetc ___mfwrap_ungetc
+#pragma redefine_extname fputc ___mfwrap_fputc
+#pragma redefine_extname fputs ___mfwrap_fputs
+#pragma redefine_extname putc ___mfwrap_putc
+#pragma redefine_extname puts ___mfwrap_puts
+#pragma redefine_extname clearerr ___mfwrap_clearerr
+#pragma redefine_extname feof ___mfwrap_feof
+#pragma redefine_extname ferror ___mfwrap_ferror
+#pragma redefine_extname fileno ___mfwrap_fileno
+#pragma redefine_extname printf ___mfwrap_printf
+#pragma redefine_extname fprintf ___mfwrap_fprintf
+#pragma redefine_extname sprintf ___mfwrap_sprintf
+#pragma redefine_extname snprintf ___mfwrap_snprintf
+#pragma redefine_extname vprintf ___mfwrap_vprintf
+#pragma redefine_extname vfprintf ___mfwrap_vfprintf
+#pragma redefine_extname vsprintf ___mfwrap_vsprintf
+#pragma redefine_extname vsnprintf ___mfwrap_vsnprintf
+#pragma redefine_extname access ___mfwrap_access
+#pragma redefine_extname remove ___mfwrap_remove
+#pragma redefine_extname fflush ___mfwrap_fflush
+#pragma redefine_extname fseek ___mfwrap_fseek
+#pragma redefine_extname ftell ___mfwrap_ftell
+#pragma redefine_extname rewind ___mfwrap_rewind
+#pragma redefine_extname fgetpos ___mfwrap_fgetpos
+#pragma redefine_extname fsetpos ___mfwrap_fsetpos
+#pragma redefine_extname stat ___mfwrap_stat
+#pragma redefine_extname fstat ___mfwrap_fstat
+#pragma redefine_extname lstat ___mfwrap_lstat
+#pragma redefine_extname mkfifo ___mfwrap_mkfifo
+#pragma redefine_extname setvbuf ___mfwrap_setvbuf
+#pragma redefine_extname setbuf ___mfwrap_setbuf
+#pragma redefine_extname setbuffer ___mfwrap_setbuffer
+#pragma redefine_extname setlinebuf ___mfwrap_setlinebuf
+#pragma redefine_extname opendir ___mfwrap_opendir
+#pragma redefine_extname closedir ___mfwrap_closedir
+#pragma redefine_extname readdir ___mfwrap_readdir
+#pragma redefine_extname recv ___mfwrap_recv
+#pragma redefine_extname recvfrom ___mfwrap_recvfrom
+#pragma redefine_extname recvmsg ___mfwrap_recvmsg
+#pragma redefine_extname send ___mfwrap_send
+#pragma redefine_extname sendto ___mfwrap_sendto
+#pragma redefine_extname sendmsg ___mfwrap_sendmsg
+#pragma redefine_extname setsockopt ___mfwrap_setsockopt
+#pragma redefine_extname getsockopt ___mfwrap_getsockopt
+#pragma redefine_extname accept ___mfwrap_accept
+#pragma redefine_extname bind ___mfwrap_bind
+#pragma redefine_extname connect ___mfwrap_connect
+#pragma redefine_extname gethostname ___mfwrap_gethostname
+#pragma redefine_extname sethostname ___mfwrap_sethostname
+#pragma redefine_extname gethostbyname ___mfwrap_gethostbyname
+#pragma redefine_extname wait ___mfwrap_wait
+#pragma redefine_extname waitpid ___mfwrap_waitpid
+#pragma redefine_extname popen ___mfwrap_popen
+#pragma redefine_extname pclose ___mfwrap_pclose
+#pragma redefine_extname execve ___mfwrap_execve
+#pragma redefine_extname execv ___mfwrap_execv
+#pragma redefine_extname execvp ___mfwrap_execvp
+#pragma redefine_extname system ___mfwrap_system
+#pragma redefine_extname dlopen ___mfwrap_dlopen
+#pragma redefine_extname dlerror ___mfwrap_dlerror
+#pragma redefine_extname dlsym ___mfwrap_dlsym
+#pragma redefine_extname dlclose ___mfwrap_dlclose
+#pragma redefine_extname fopen64 ___mfwrap_fopen64
+#pragma redefine_extname freopen64 ___mfwrap_freopen64
+#pragma redefine_extname stat64 ___mfwrap_stat64
+#pragma redefine_extname fseeko64 ___mfwrap_fseeko64
+#pragma redefine_extname ftello64 ___mfwrap_ftello64
+#pragma redefine_extname semop ___mfwrap_semop
+#pragma redefine_extname semctl ___mfwrap_semctl
+#pragma redefine_extname shmctl ___mfwrap_shmctl
+#pragma redefine_extname shmat ___mfwrap_shmat
+#pragma redefine_extname shmdt ___mfwrap_shmdt
+#pragma redefine_extname __ctype_b_loc ___mfwrap___ctype_b_loc
+#pragma redefine_extname __ctype_toupper_loc ___mfwrap___ctype_toupper_loc
+#pragma redefine_extname __ctype_tolower_loc ___mfwrap___ctype_tolower_loc
+#pragma redefine_extname getlogin ___mfwrap_getlogin
+#pragma redefine_extname cuserid ___mfwrap_cuserid
+#pragma redefine_extname getpwnam ___mfwrap_getpwnam
+#pragma redefine_extname getpwuid ___mfwrap_getpwuid
+#pragma redefine_extname getgrnam ___mfwrap_getgrnam
+#pragma redefine_extname getgrgid ___mfwrap_getgrgid
+#pragma redefine_extname getservent ___mfwrap_getservent
+#pragma redefine_extname getservbyname ___mfwrap_getservbyname
+#pragma redefine_extname getservbyport ___mfwrap_getservbyport
+#pragma redefine_extname gai_strerror ___mfwrap_gai_strerror
+#pragma redefine_extname getmntent ___mfwrap_getmntent
+#pragma redefine_extname inet_ntoa ___mfwrap_inet_ntoa
+#pragma redefine_extname getprotoent ___mfwrap_getprotoent
+#pragma redefine_extname getprotobyname ___mfwrap_getprotobyname
+#pragma redefine_extname getprotobynumber ___mfwrap_getprotobynumber
+#endif /* __USER_LABEL_PREFIX__ */
/* Disable glibc macros. */
#define __NO_STRING_INLINES
--- a/src/libssp/ssp.c
+++ b/src/libssp/ssp.c
@@ -63,6 +63,9 @@ see the files COPYING3 and COPYING.RUNTI
#ifdef HAVE_SYSLOG_H
# include <syslog.h>
#endif
+#ifdef __MINT__
+#include <mint/osbind.h>
+#endif
void *__stack_chk_guard = 0;
@@ -96,7 +99,10 @@ __guard_setup (void)
static void
fail (const char *msg1, size_t msg1len, const char *msg3)
{
-#ifdef __GNU_LIBRARY__
+#if defined(__MINT__)
+#define __progname program_invocation_short_name
+#endif
+#if defined(__GNU_LIBRARY__) || defined(__MINT__)
extern char * __progname;
#else
static const char __progname[] = "";
@@ -139,6 +145,9 @@ fail (const char *msg1, size_t msg1len,
syslog (LOG_CRIT, msg3);
#endif /* HAVE_SYSLOG_H */
+#ifdef __MINT__
+ Pterm(127);
+#else
/* Try very hard to exit. Note that signals may be blocked preventing
the first two options from working. The use of volatile is here to
prevent optimizers from "knowing" that __builtin_trap is called first,
@@ -160,6 +169,7 @@ fail (const char *msg1, size_t msg1len,
break;
}
}
+#endif
}
void
--- /dev/null
+++ b/src/libstdc++-v3/config/os/mint/ctype_base.h
@@ -0,0 +1,59 @@
+// 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/>.
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+// Mint C types, taken from mintlib-0.57.3/include/ctype.h
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ /// @brief Base class for ctype.
+ struct ctype_base
+ {
+ // Non-standard typedefs.
+ typedef const 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 = _CTu;
+ static const mask lower = _CTl;
+ static const mask alpha = _CTu | _CTl;
+ static const mask digit = _CTd;
+ static const mask xdigit = _CTx;
+ static const mask space = _CTs;
+ static const mask print = _CTP;
+ static const mask graph = _CTg;
+ static const mask cntrl = _CTc;
+ static const mask punct = _CTp;
+ static const mask alnum = _CTd | _CTu | _CTl ;
+ };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
--- /dev/null
+++ b/src/libstdc++-v3/config/os/mint/ctype_inline.h
@@ -0,0 +1,76 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2000, 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_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
+
+// Mint C types, taken from mintlib-0.57.3/include/ctype.h
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ bool
+ ctype<char>::
+ is(mask __m, char __c) const
+ { return _ctype[(unsigned char)((__c) + 1)] & __m; }
+
+ const char*
+ ctype<char>::
+ is(const char* __low, const char* __high, mask* __vec) const
+ {
+ while (__low < __high)
+ *__vec++ = _ctype[(*__low++) + 1] ;
+ 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) != 0)
+ ++__low;
+ return __low;
+ }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
--- /dev/null
+++ b/src/libstdc++-v3/config/os/mint/ctype_noninline.h
@@ -0,0 +1,92 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 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_noninline.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
+
+ 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 ? __table : classic_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 ? __table : classic_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((int) __c); }
+
+ const char*
+ ctype<char>::do_toupper(char* __low, const char* __high) const
+ {
+ while (__low < __high)
+ {
+ *__low = ::toupper((int) *__low);
+ ++__low;
+ }
+ return __high;
+ }
+
+ char
+ ctype<char>::do_tolower(char __c) const
+ { return ::tolower((int) __c); }
+
+ const char*
+ ctype<char>::do_tolower(char* __low, const char* __high) const
+ {
+ while (__low < __high)
+ {
+ *__low = ::tolower((int) *__low);
+ ++__low;
+ }
+ return __high;
+ }
--- /dev/null
+++ b/src/libstdc++-v3/config/os/mint/os_defines.h
@@ -0,0 +1,36 @@
+// Specific definitions for generic platforms -*- C++ -*-
+
+// Copyright (C) 2000, 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.
+
+#endif
--- a/src/libstdc++-v3/configure.host
+++ b/src/libstdc++-v3/configure.host
@@ -258,6 +258,10 @@ case "${host_os}" in
error_constants_dir="os/mingw32"
OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)"
;;
+ mint*)
+ SECTION_FLAGS="${SECTION_FLAGS} -D_GNU_SOURCE"
+ os_include_dir="os/mint"
+ ;;
netbsd*)
os_include_dir="os/bsd/netbsd"
;;
--- a/src/libstdc++-v3/crossconfig.m4
+++ b/src/libstdc++-v3/crossconfig.m4
@@ -141,7 +141,7 @@ case "${host}" in
;;
esac
;;
- *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
+ *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu | *-mint*)
GLIBCXX_CHECK_COMPILER_FEATURES
GLIBCXX_CHECK_LINKER_FEATURES
GLIBCXX_CHECK_MATH_SUPPORT
|