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... :-(
yann@1
     1
From http://sources.redhat.com/ml/libc-alpha/2002-06/msg00006.html
yann@1
     2
yann@1
     3
Message-ID: <15612.44195.299251.921969@honolulu.ilog.fr>
yann@1
     4
Date: Tue, 4 Jun 2002 14:03:47 +0200 (CEST)
yann@1
     5
From: Bruno Haible <bruno at clisp dot org>
yann@1
     6
To: libc-alpha at sources dot redhat dot com
yann@1
     7
Subject: link_warning fix
yann@1
     8
yann@1
     9
yann@1
    10
Hi,
yann@1
    11
yann@1
    12
While cross-compiling glibc-2.2.5 for target=cris-linux using gcc-3.1 and
yann@1
    13
binutils-2.12.90.0.7, I get an error
yann@1
    14
yann@1
    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
yann@1
    16
/tmp/cca7qZyI.s: Assembler messages:
yann@1
    17
/tmp/cca7qZyI.s:87: Warning: rest of line ignored; first ignored character is `,'
yann@1
    18
/tmp/cca7qZyI.s:87: Error: Unknown opcode: `progbits'
yann@1
    19
make[2]: *** [/backup/cross-build/build-glibc-cris/signal/sigstack.o] Fehler 1
yann@1
    20
yann@1
    21
yann@1
    22
The reason is that the .s file contains the following.
yann@1
    23
yann@1
    24
...
yann@1
    25
	.size	sigstack,.Lfe1-sigstack
yann@1
    26
#APP
yann@1
    27
	.section .gnu.warning.sigstack
yann@1
    28
	.previous
yann@1
    29
#NO_APP
yann@1
    30
	.section	.gnu.warning.sigstack
yann@1
    31
	#,"a",@progbits
yann@1
    32
	.align 2
yann@1
    33
	.type	__evoke_link_warning_sigstack,@object
yann@1
    34
...
yann@1
    35
yann@1
    36
and comments (introduced by '#') are recognized by the assembler only after
yann@1
    37
#APP, not after #NO_APP. The workaround is to add '#APP' to the fake section
yann@1
    38
name. The following patch works for me.
yann@1
    39
yann@1
    40
2002-06-02  Bruno Haible  <bruno@clisp.org>
yann@1
    41
yann@1
    42
	* include/libc-symbols.h (__as_app_line): New macro.
yann@1
    43
	(link_warning): Emit #APP line to turn comment recognition on.
yann@1
    44
yann@1
    45
*** glibc-2.2.5/include/libc-symbols.h.bak	2001-08-04 01:02:52.000000000 +0200
yann@1
    46
--- glibc-2.2.5/include/libc-symbols.h	2002-06-02 16:22:15.000000000 +0200
yann@1
    47
***************
yann@1
    48
*** 207,224 ****
yann@1
    49
  #   define __make_section_unallocated(section_string)
yann@1
    50
  #  endif
yann@1
    51
  
yann@1
    52
! /* Tacking on "\n\t#" to the section name makes gcc put it's bogus
yann@1
    53
!    section attributes on what looks like a comment to the assembler.  */
yann@1
    54
  #  ifdef HAVE_SECTION_QUOTES
yann@1
    55
  #   define link_warning(symbol, msg) \
yann@1
    56
    __make_section_unallocated (".gnu.warning." #symbol) \
yann@1
    57
!   static const char __evoke_link_warning_##symbol[]	\
yann@1
    58
!     __attribute__ ((section (".gnu.warning." #symbol "\"\n\t#\""))) = msg;
yann@1
    59
  #  else
yann@1
    60
  #   define link_warning(symbol, msg) \
yann@1
    61
    __make_section_unallocated (".gnu.warning." #symbol) \
yann@1
    62
!   static const char __evoke_link_warning_##symbol[]	\
yann@1
    63
!     __attribute__ ((section (".gnu.warning." #symbol "\n\t#"))) = msg;
yann@1
    64
  #  endif
yann@1
    65
  # else /* Not ELF: a.out */
yann@1
    66
  #  ifdef HAVE_XCOFF
yann@1
    67
--- 207,235 ----
yann@1
    68
  #   define __make_section_unallocated(section_string)
yann@1
    69
  #  endif
yann@1
    70
  
yann@1
    71
! /* Tacking on "\n\t#" to the section name makes gcc put its bogus
yann@1
    72
!    section attributes on what looks like a comment to the assembler.
yann@1
    73
!    Furthermore, with gas, we need to add a "#APP" line so the comment
yann@1
    74
!    is recognized as such.  */
yann@1
    75
! #  ifdef HAVE_GNU_AS
yann@1
    76
! #   define __as_app_line "#APP\n"
yann@1
    77
! #  else
yann@1
    78
! #   define __as_app_line ""
yann@1
    79
! #  endif
yann@1
    80
  #  ifdef HAVE_SECTION_QUOTES
yann@1
    81
  #   define link_warning(symbol, msg) \
yann@1
    82
    __make_section_unallocated (".gnu.warning." #symbol) \
yann@1
    83
!   static const char __evoke_link_warning_##symbol[]			 \
yann@1
    84
!     __attribute__							 \
yann@1
    85
!       ((section (".gnu.warning." #symbol "\"\n" __as_app_line "\t#\""))) \
yann@1
    86
!     = msg;
yann@1
    87
  #  else
yann@1
    88
  #   define link_warning(symbol, msg) \
yann@1
    89
    __make_section_unallocated (".gnu.warning." #symbol) \
yann@1
    90
!   static const char __evoke_link_warning_##symbol[]			\
yann@1
    91
!     __attribute__							\
yann@1
    92
!       ((section (".gnu.warning." #symbol "\n" __as_app_line "\t#")))	\
yann@1
    93
!     = msg;
yann@1
    94
  #  endif
yann@1
    95
  # else /* Not ELF: a.out */
yann@1
    96
  #  ifdef HAVE_XCOFF
yann@1
    97