patches/glibc/2.2.5/glibc-2.2.5-mips-build-gmon.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.2.5/glibc-2.2.5-mips-build-gmon.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,86 @@
     1.4 +From http://www.ltc.com/~brad/mips/glibc-2.2.5-mips-build-gmon.diff
     1.5 +See http://www.ltc.com/~brad/mips/mips-cross-toolchain.html
     1.6 +
     1.7 +--- glibc-2.2.5/sysdeps/mips/machine-gmon.h	2001-08-13 04:42:44.000000000 -0400
     1.8 ++++ glibc-2.2.5/sysdeps/mips/machine-gmon.h	2002-09-25 17:10:59.000000000 -0400
     1.9 +@@ -17,42 +17,52 @@
    1.10 +    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    1.11 +    02111-1307 USA.  */
    1.12 + 
    1.13 +-#define _MCOUNT_DECL static void __mcount
    1.14 ++#define _MCOUNT_DECL(frompc,selfpc) \
    1.15 ++static void __attribute_used__ __mcount (u_long frompc, u_long selfpc)
    1.16 + 
    1.17 + /* Call __mcount with our the return PC for our caller,
    1.18 +    and the return PC our caller will return to.  */
    1.19 + #ifdef __PIC__
    1.20 + #define CPLOAD ".cpload $25;"
    1.21 ++#define CPRESTORE ".cprestore 44\n\t"
    1.22 + #else
    1.23 + #define CPLOAD
    1.24 ++#define CPRESTORE
    1.25 + #endif
    1.26 + 
    1.27 + #define MCOUNT asm(\
    1.28 +-	".globl _mcount;" \
    1.29 +-	".align 2;" \
    1.30 +-	".type _mcount,@function;" \
    1.31 +-        "_mcount:;" \
    1.32 +-        ".set noreorder;" \
    1.33 +-        ".set noat;" \
    1.34 ++	".globl _mcount;\n\t" \
    1.35 ++	".align 2;\n\t" \
    1.36 ++	".type _mcount,@function;\n\t" \
    1.37 ++	".ent _mcount\n\t" \
    1.38 ++        "_mcount:\n\t" \
    1.39 ++        ".frame $sp,44,$31\n\t" \
    1.40 ++        ".set noreorder;\n\t" \
    1.41 ++        ".set noat;\n\t" \
    1.42 +         CPLOAD \
    1.43 +-        "sw $4,8($29);" \
    1.44 +-        "sw $5,12($29);" \
    1.45 +-        "sw $6,16($29);" \
    1.46 +-        "sw $7,20($29);" \
    1.47 +-        "sw $1,0($29);" \
    1.48 +-        "sw $31,4($29);" \
    1.49 +-        "move $5,$31;" \
    1.50 +-        "move $4,$1;" \
    1.51 +-        "jal __mcount;" \
    1.52 +-	"nop;" \
    1.53 +-        "lw $4,8($29);" \
    1.54 +-        "lw $5,12($29);" \
    1.55 +-        "lw $6,16($29);" \
    1.56 +-        "lw $7,20($29);" \
    1.57 +-        "lw $31,4($29);" \
    1.58 +-        "lw $1,0($29);" \
    1.59 +-        "addu $29,$29,8;" \
    1.60 +-        "j $31;" \
    1.61 +-        "move $31,$1;" \
    1.62 +-        ".set reorder;" \
    1.63 +-        ".set at");
    1.64 ++	"subu $29,$29,48;\n\t" \
    1.65 ++	CPRESTORE \
    1.66 ++        "sw $4,24($29);\n\t" \
    1.67 ++        "sw $5,28($29);\n\t" \
    1.68 ++        "sw $6,32($29);\n\t" \
    1.69 ++        "sw $7,36($29);\n\t" \
    1.70 ++        "sw $2,40($29);\n\t" \
    1.71 ++        "sw $1,16($29);\n\t" \
    1.72 ++        "sw $31,20($29);\n\t" \
    1.73 ++        "move $5,$31;\n\t" \
    1.74 ++        "move $4,$1;\n\t" \
    1.75 ++        "jal __mcount;\n\t" \
    1.76 ++        "nop;\n\t" \
    1.77 ++        "lw $4,24($29);\n\t" \
    1.78 ++        "lw $5,28($29);\n\t" \
    1.79 ++        "lw $6,32($29);\n\t" \
    1.80 ++        "lw $7,36($29);\n\t" \
    1.81 ++        "lw $2,40($29);\n\t" \
    1.82 ++        "lw $31,20($29);\n\t" \
    1.83 ++        "lw $1,16($29);\n\t" \
    1.84 ++        "addu $29,$29,56;\n\t" \
    1.85 ++        "j $31;\n\t" \
    1.86 ++        "move $31,$1;\n\t" \
    1.87 ++        ".set reorder;\n\t" \
    1.88 ++        ".set at\n\t" \
    1.89 ++        ".end _mcount");