patches/glibc/2.2.5/cris-libc-symbols.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 From http://sources.redhat.com/ml/libc-alpha/2002-06/msg00006.html
     2 
     3 Message-ID: <15612.44195.299251.921969@honolulu.ilog.fr>
     4 Date: Tue, 4 Jun 2002 14:03:47 +0200 (CEST)
     5 From: Bruno Haible <bruno at clisp dot org>
     6 To: libc-alpha at sources dot redhat dot com
     7 Subject: link_warning fix
     8 
     9 
    10 Hi,
    11 
    12 While cross-compiling glibc-2.2.5 for target=cris-linux using gcc-3.1 and
    13 binutils-2.12.90.0.7, I get an error
    14 
    15 cris-linux-gcc ../sysdeps/unix/sysv/linux/sigstack.c -c -O2 -Wall -Winline -Wstrict-prototypes -Wwrite-strings -g      -I../include -I. -I/backup/cross-build/build-glibc-cris/signal -I.. -I../libio  -I/backup/cross-build/build-glibc-cris -I../sysdeps/cris/elf -I../linuxthreads/sysdeps/unix/sysv/linux -I../linuxthreads/sysdeps/pthread -I../sysdeps/pthread -I../linuxthreads/sysdeps/unix/sysv -I../linuxthreads/sysdeps/unix -I../linuxthreads/sysdeps/cris -I../sysdeps/unix/sysv/linux/cris -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/cris -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic  -nostdinc -isystem /cross/cris-linux-tools/lib/gcc-lib/cris-linux/3.1/include -isystem /cross/cris-linux/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h     -o /backup/cross-build/build-glibc-cris/signal/sigstack.o
    16 /tmp/cca7qZyI.s: Assembler messages:
    17 /tmp/cca7qZyI.s:87: Warning: rest of line ignored; first ignored character is `,'
    18 /tmp/cca7qZyI.s:87: Error: Unknown opcode: `progbits'
    19 make[2]: *** [/backup/cross-build/build-glibc-cris/signal/sigstack.o] Fehler 1
    20 
    21 
    22 The reason is that the .s file contains the following.
    23 
    24 ...
    25 	.size	sigstack,.Lfe1-sigstack
    26 #APP
    27 	.section .gnu.warning.sigstack
    28 	.previous
    29 #NO_APP
    30 	.section	.gnu.warning.sigstack
    31 	#,"a",@progbits
    32 	.align 2
    33 	.type	__evoke_link_warning_sigstack,@object
    34 ...
    35 
    36 and comments (introduced by '#') are recognized by the assembler only after
    37 #APP, not after #NO_APP. The workaround is to add '#APP' to the fake section
    38 name. The following patch works for me.
    39 
    40 2002-06-02  Bruno Haible  <bruno@clisp.org>
    41 
    42 	* include/libc-symbols.h (__as_app_line): New macro.
    43 	(link_warning): Emit #APP line to turn comment recognition on.
    44 
    45 *** glibc-2.2.5/include/libc-symbols.h.bak	2001-08-04 01:02:52.000000000 +0200
    46 --- glibc-2.2.5/include/libc-symbols.h	2002-06-02 16:22:15.000000000 +0200
    47 ***************
    48 *** 207,224 ****
    49   #   define __make_section_unallocated(section_string)
    50   #  endif
    51   
    52 ! /* Tacking on "\n\t#" to the section name makes gcc put it's bogus
    53 !    section attributes on what looks like a comment to the assembler.  */
    54   #  ifdef HAVE_SECTION_QUOTES
    55   #   define link_warning(symbol, msg) \
    56     __make_section_unallocated (".gnu.warning." #symbol) \
    57 !   static const char __evoke_link_warning_##symbol[]	\
    58 !     __attribute__ ((section (".gnu.warning." #symbol "\"\n\t#\""))) = msg;
    59   #  else
    60   #   define link_warning(symbol, msg) \
    61     __make_section_unallocated (".gnu.warning." #symbol) \
    62 !   static const char __evoke_link_warning_##symbol[]	\
    63 !     __attribute__ ((section (".gnu.warning." #symbol "\n\t#"))) = msg;
    64   #  endif
    65   # else /* Not ELF: a.out */
    66   #  ifdef HAVE_XCOFF
    67 --- 207,235 ----
    68   #   define __make_section_unallocated(section_string)
    69   #  endif
    70   
    71 ! /* Tacking on "\n\t#" to the section name makes gcc put its bogus
    72 !    section attributes on what looks like a comment to the assembler.
    73 !    Furthermore, with gas, we need to add a "#APP" line so the comment
    74 !    is recognized as such.  */
    75 ! #  ifdef HAVE_GNU_AS
    76 ! #   define __as_app_line "#APP\n"
    77 ! #  else
    78 ! #   define __as_app_line ""
    79 ! #  endif
    80   #  ifdef HAVE_SECTION_QUOTES
    81   #   define link_warning(symbol, msg) \
    82     __make_section_unallocated (".gnu.warning." #symbol) \
    83 !   static const char __evoke_link_warning_##symbol[]			 \
    84 !     __attribute__							 \
    85 !       ((section (".gnu.warning." #symbol "\"\n" __as_app_line "\t#\""))) \
    86 !     = msg;
    87   #  else
    88   #   define link_warning(symbol, msg) \
    89     __make_section_unallocated (".gnu.warning." #symbol) \
    90 !   static const char __evoke_link_warning_##symbol[]			\
    91 !     __attribute__							\
    92 !       ((section (".gnu.warning." #symbol "\n" __as_app_line "\t#")))	\
    93 !     = msg;
    94   #  endif
    95   # else /* Not ELF: a.out */
    96   #  ifdef HAVE_XCOFF
    97