patches/glibc/2.3.3/glibc-2.3.2-sparc32-sysdep.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.3.3/glibc-2.3.2-sparc32-sysdep.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,46 @@
     1.4 +Fixes the error
     1.5 +
     1.6 +<stdin>: Assembler messages:
     1.7 +<stdin>:2: Error: junk at end of line, first unrecognized character is `1' ...
     1.8 +<stdin>:2: Error: Illegal operands: PC-relative operand can't be a constant
     1.9 +make[4]: *** [/home/dank/wk/crosstool-0.28-rc13/build/sparc-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/io/rtld-open.os] Error 1
    1.10 +make[4]: Leaving directory `/home/dank/wk/crosstool-0.28-rc13/build/sparc-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/glibc-2.3.2/io'
    1.11 +make[3]: *** [/home/dank/wk/crosstool-0.28-rc13/build/sparc-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/io/rtld-xstat64.os] Error 2
    1.12 +make[3]: Leaving directory `/home/dank/wk/crosstool-0.28-rc13/build/sparc-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/glibc-2.3.2/elf'
    1.13 +make[2]: *** [/home/dank/wk/crosstool-0.28-rc13/build/sparc-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/elf/rtld-libc.a] Error 2
    1.14 +make[2]: Leaving directory `/home/dank/wk/crosstool-0.28-rc13/build/sparc-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/glibc-2.3.2/elf'
    1.15 +make[1]: *** [elf/subdir_lib] Error 2
    1.16 +
    1.17 +when building glibc-2.3.2 with gcc-3.4.0 for sparc32.
    1.18 +
    1.19 +The .s file left behind by -save-temps contains the big long line
    1.20 +
    1.21 +.text; .global __libc_open; .align 4; __libc_open:; .type __libc_open,@function;; mov 5, %g1; ta 0x10; bcs __syscall_error_handler; nop; .section .gnu.linkonce.t. 1 .get_pic.l7,"ax",@progbits; .globl 1 .get_pic.l7; .hidden 1 .get_pic.l7; .type 1 .get_pic.l7,@function; 1 .get_pic.l7: retl; add %o7, %l7, %l7; .previous; .subsection 3; __syscall_error_handler: save %sp,-96,%sp; sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; call 1 .get_pic.l7; add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; ld [%l7 + errno], %l0; st %i0, [%l0]; jmpl %i7+8, %g0; restore %g0, -1, %o0; .previous;
    1.22 + retl; nop 
    1.23 + 
    1.24 +The error messages appear to refer to the '1 .get_pic.17', e.g.
    1.25 +        .globl 1 .get_pic.l7; .hidden 1 .get_pic.l7;
    1.26 +which seems to come from
    1.27 +glibc-2.3.2/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
    1.28 +where it appears originally as
    1.29 +        .globl __sparc.get_pic.l7;                                      \
    1.30 +        .hidden __sparc.get_pic.l7;                                     \
    1.31 +
    1.32 +Note that __sparc is a predefined symbol on Solaris and some other environments;
    1.33 +it's not surprising to see it predefined on Linux, too.
    1.34 +
    1.35 +
    1.36 +--- glibc-2.3.2/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h.old	2004-05-15 10:23:11.000000000 -0700
    1.37 ++++ glibc-2.3.2/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h	2004-05-15 10:24:12.000000000 -0700
    1.38 +@@ -39,6 +39,11 @@
    1.39 + #undef END
    1.40 + #undef LOC
    1.41 + 
    1.42 ++/* gcc-3.4.0 seems to expand __sparc as a predefined preprocessor symbol, which we don't want here */
    1.43 ++#ifdef __sparc
    1.44 ++#undef __sparc
    1.45 ++#endif
    1.46 ++
    1.47 + #define ENTRY(name) \
    1.48 + 	.global C_SYMBOL_NAME(name); \
    1.49 + 	.align 4;\