components/gcc53/patches/009-r234365.patch
author Jesse Butler <jesse.butler@oracle.com>
Fri, 29 Jul 2016 11:50:34 -0700
changeset 6527 106e3067f7cc
parent 5928 f0b68e20e980
permissions -rw-r--r--
24376511 docker should add developer/golang to REQUIRED_PACKAGES in the Makefile
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5928
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     1
#
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     2
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38239 
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     3
# This will be fixed in 5.4.
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     4
# 
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     5
# Index: libgcc/ChangeLog
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     6
# ===================================================================
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     7
# --- a/libgcc/ChangeLog	(revision 234364)
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     8
# +++ b/libgcc/ChangeLog	(revision 234365)
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     9
# @@ -1,3 +1,13 @@
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    10
# +2016-03-21  Rainer Orth  <[email protected]>
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    11
# +
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    12
# +	Backport from mainline
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    13
# +	2016-03-16  Rainer Orth  <[email protected]>
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    14
# +
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    15
# +	PR target/38239
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    16
# +	* config/sol2/gmon.c [__i386__] (_mcount): Save and restore
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    17
# +	call-clobbered registers.
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    18
# +	(internal_mcount): Remove __i386__ handling.
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    19
# +
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    20
#  2016-02-10  Ian Lance Taylor  <[email protected]>
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    21
#  
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    22
#  	PR go/68562
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    23
Index: libgcc/config/sol2/gmon.c
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    24
===================================================================
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    25
--- a/libgcc/config/sol2/gmon.c	(revision 234364)
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    26
+++ b/libgcc/config/sol2/gmon.c	(revision 234365)
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    27
@@ -44,11 +44,7 @@
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    28
 
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    29
 extern void monstartup (char *, char *);
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    30
 extern void _mcleanup (void);
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    31
-#ifdef __i386__
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    32
-static void internal_mcount (void) __attribute__ ((used));
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    33
-#else
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    34
 static void internal_mcount (char *, unsigned short *) __attribute__ ((used));
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    35
-#endif
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    36
 static void moncontrol (int);
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    37
 
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    38
 struct phdr {
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    39
@@ -223,8 +219,19 @@
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    40
 /* Solaris 2 libraries use _mcount.  */
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    41
 #if defined __i386__
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    42
 asm(".globl _mcount\n"
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    43
+    "	.type	_mcount, @function\n"
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    44
     "_mcount:\n"
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    45
-    "	jmp	internal_mcount\n");
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    46
+    /* Save and restore the call-clobbered registers.  */
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    47
+    "	pushl	%eax\n"
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    48
+    "	pushl	%ecx\n"
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    49
+    "	pushl	%edx\n"
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    50
+    "	movl	12(%esp), %edx\n"
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    51
+    "	movl	4(%ebp), %eax\n"
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    52
+    "	call	internal_mcount\n"
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    53
+    "	popl	%edx\n"
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    54
+    "	popl	%ecx\n"
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    55
+    "	popl	%eax\n"
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    56
+    "	ret\n");
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    57
 #elif defined __x86_64__
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    58
 /* See GLIBC for additional information about this technique.  */
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    59
 asm(".globl _mcount\n" 
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    60
@@ -299,11 +306,7 @@
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    61
 #endif
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    62
 
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    63
 static void
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    64
-#ifdef __i386__
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    65
-internal_mcount (void)
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    66
-#else
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    67
 internal_mcount (char *selfpc, unsigned short *frompcindex)
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    68
-#endif
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    69
 {
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    70
   struct tostruct *top;
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    71
   struct tostruct *prevtop;
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    72
@@ -310,21 +313,6 @@
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    73
   long toindex;
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    74
   static char already_setup;
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    75
 
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    76
-#ifdef __i386__
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    77
-  char *selfpc;
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    78
-  unsigned short *frompcindex;
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    79
-
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    80
-  /* Find the return address for mcount and the return address for mcount's
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    81
-     caller.  */
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    82
-
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    83
-  /* selfpc = pc pushed by mcount call.
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    84
-     This identifies the function that was just entered.  */
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    85
-  selfpc = (void *) __builtin_return_address (0);
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    86
-  /* frompcindex = pc in preceding frame.
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    87
-     This identifies the caller of the function just entered.  */
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    88
-  frompcindex = (void *) __builtin_return_address (1);
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    89
-#endif
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    90
-
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    91
 /* Only necessary without the Solaris CRTs or a proper gcrt1.o, otherwise
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    92
    crtpg.o or gcrt1.o take care of that.
f0b68e20e980 23220901 gcc failing with 32-bit gprof
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    93