patches/gcc/3.4.0/pr15647-fix.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 Received: (qmail 11693 invoked from network); 26 May 2004 03:17:41 -0000
     2 Received: from unknown (HELO r-rr.iij4u.or.jp) (210.130.0.76)
     3   by sourceware dot org with SMTP; 26 May 2004 03:17:41 -0000
     4 Received: from localhost (frgw.3in.ne.jp [210.251.121.226])
     5 	by r-rr dot iij4u dot or dot jp (8 dot 11 dot 6+IIJ/8 dot 11 dot 6) with ESMTP id i4Q3HbJ21421;
     6 	Wed, 26 May 2004 12:17:37 +0900 (JST)
     7 Date: Wed, 26 May 2004 12:13:58 +0900 (JST)
     8 Message-Id: <20040526.121358.39460214.kkojima@rr.iij4u.or.jp>
     9 To: gcc-patches at gcc dot gnu dot org
    10 Cc: Mark Mitchell <mark at codesourcery dot com>
    11 Subject: [PATCH] Fix PR target/15647 for sh-linux
    12 From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
    13 Mime-Version: 1.0
    14 Content-Type: Text/Plain; charset=us-ascii
    15 Content-Transfer-Encoding: 7bit
    16 
    17 Hi,
    18 
    19 The appended patch is to fix PR target/15647
    20   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15647
    21 for linux.
    22 __udivsi3 is exported from libgcc_s.so.1 and gcc generates the code
    23 which assumes r1 will be not clobbered when calling __udivsi3 in SH3
    24 case.  This is bad because r1 is clobbered by PLT.
    25 The another functions listed in the standard libgcc-std.ver which
    26 possively have similar problem are __ashlsi3, __ashrsi3 and __lshrsi3,
    27 though these are used only by SH1/2.
    28 The patch below simply uses an SH specific libgcc-std.ver which drops
    29 these functions.  SH linux uses a linker script libgcc_s.so having
    30 libgcc.a as a suppementary library, so these functions given by
    31 libgcc.a when needed in the link time.
    32 Although mainline has one failure in bulding zlib which can be avoided
    33 with -fno-reorder-blocks for sh3-unknown-linux-gnu target, x86 cross
    34 to sh3-unknown-linux-gnu can be build successfully on mainline with
    35 this patch except the above failure.  3.4-branch successfully bootstraps
    36 with it and there are no new failures on the native sh4-unknown-linux-gnu.
    37 The patch is highly sh-linux specific and seems to be safe.  I'll check
    38 it into mainline.
    39 The original PR is also for sh3 netbsd.  I'd like to leave it for the
    40 netbsd experts.
    41 
    42 I think that it's too late for 3.3.4.  Mark, is it also late for
    43 3.4.1?
    44 
    45 Regards,
    46 	kaz
    47 --
    48 2004-05-26  Kaz Kojima  <kkojima@gcc.gnu.org>
    49 
    50 	* config/sh/t-linux (SHLIB_MAPFILES): Use sh specific
    51 	libgcc-std.ver.
    52 	* config/sh/libgcc-std.ver: New file.
    53 
    54 diff -u3prN ORIG-gcc/gcc/config/sh/t-linux LOCAL-gcc/gcc/config/sh/t-linux
    55 --- ORIG-gcc/gcc/config/sh/t-linux	Mon Feb 16 20:13:25 2004
    56 +++ LOCAL-gcc/gcc/config/sh/t-linux	Tue May 25 18:25:48 2004
    57 @@ -11,8 +11,11 @@ MULTILIB_EXCEPTIONS=
    58  EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
    59  
    60  # Override t-slibgcc-elf-ver to export some libgcc symbols with
    61 -# the symbol versions that glibc used.
    62 -SHLIB_MAPFILES =  $(srcdir)/libgcc-std.ver $(srcdir)/config/sh/libgcc-glibc.ver
    63 +# the symbol versions that glibc used.  Also use an sh specific
    64 +# libgcc-std.ver to avoid to export some lib1func routines which
    65 +# should not be called via PLT.
    66 +SHLIB_MAPFILES =  $(srcdir)/config/sh/libgcc-std.ver \
    67 +	$(srcdir)/config/sh/libgcc-glibc.ver
    68  
    69  # Override SHLIB_LINK and SHLIB_INSTALL to use linker script
    70  # libgcc_s.so.
    71 diff -u3prN ORIG-gcc/gcc/config/sh/libgcc-std.ver LOCAL-gcc/gcc/config/sh/libgcc-std.ver
    72 --- ORIG-gcc/gcc/config/sh/libgcc-std.ver	Thu Jan  1 09:00:00 1970
    73 +++ LOCAL-gcc/gcc/config/sh/libgcc-std.ver	Tue May 25 18:50:54 2004
    74 @@ -0,0 +1,213 @@
    75 +GCC_3.0 {
    76 +  # libgcc1 integer symbols
    77 +  __absvsi2
    78 +  __addvsi3
    79 +  # __ashlsi3
    80 +  # __ashrsi3
    81 +  __divsi3
    82 +  # __lshrsi3
    83 +  __modsi3
    84 +  __mulsi3
    85 +  __mulvsi3
    86 +  __negvsi2
    87 +  __subvsi3
    88 +  # __udivsi3
    89 +  __umodsi3
    90 +
    91 +  # libgcc1 floating point symbols
    92 +  __addsf3
    93 +  __adddf3
    94 +  __addxf3
    95 +  __addtf3
    96 +  __divsf3
    97 +  __divdf3
    98 +  __divxf3
    99 +  __divtf3
   100 +  __eqsf2
   101 +  __eqdf2
   102 +  __eqxf2
   103 +  __eqtf2
   104 +  __extenddfxf2
   105 +  __extenddftf2
   106 +  __extendsfdf2
   107 +  __extendsfxf2
   108 +  __extendsftf2
   109 +  __fixsfsi
   110 +  __fixdfsi
   111 +  __fixxfsi
   112 +  __fixtfsi
   113 +  __floatsisf
   114 +  __floatsidf
   115 +  __floatsixf
   116 +  __floatsitf
   117 +  __gesf2
   118 +  __gedf2
   119 +  __gexf2
   120 +  __getf2
   121 +  __gtsf2
   122 +  __gtdf2
   123 +  __gtxf2
   124 +  __gttf2
   125 +  __lesf2
   126 +  __ledf2
   127 +  __lexf2
   128 +  __letf2
   129 +  __ltsf2
   130 +  __ltdf2
   131 +  __ltxf2
   132 +  __lttf2
   133 +  __mulsf3
   134 +  __muldf3
   135 +  __mulxf3
   136 +  __multf3
   137 +  __negsf2
   138 +  __negdf2
   139 +  __negxf2
   140 +  __negtf2
   141 +  __nesf2
   142 +  __nedf2
   143 +  __nexf2
   144 +  __netf2
   145 +  __subsf3
   146 +  __subdf3
   147 +  __subxf3
   148 +  __subtf3
   149 +  __truncdfsf2
   150 +  __truncxfsf2
   151 +  __trunctfsf2
   152 +  __truncxfdf2
   153 +  __trunctfdf2
   154 +
   155 +  # libgcc2 DImode arithmetic (for 32-bit targets).
   156 +  __absvdi2
   157 +  __addvdi3
   158 +  __ashldi3
   159 +  __ashrdi3
   160 +  __cmpdi2
   161 +  __divdi3
   162 +  __ffsdi2
   163 +  __fixdfdi
   164 +  __fixsfdi
   165 +  __fixtfdi
   166 +  __fixxfdi
   167 +  __fixunsdfdi
   168 +  __fixunsdfsi
   169 +  __fixunssfsi
   170 +  __fixunssfdi
   171 +  __fixunstfdi
   172 +  __fixunstfsi
   173 +  __fixunsxfdi
   174 +  __fixunsxfsi
   175 +  __floatdidf
   176 +  __floatdisf
   177 +  __floatdixf
   178 +  __floatditf
   179 +  __lshrdi3
   180 +  __moddi3
   181 +  __muldi3
   182 +  __mulvdi3
   183 +  __negdi2
   184 +  __negvdi2
   185 +  __subvdi3
   186 +  __ucmpdi2
   187 +  __udivdi3
   188 +  __udivmoddi4
   189 +  __umoddi3
   190 +
   191 +  # libgcc2 TImode arithmetic (for 64-bit targets).
   192 +  __ashlti3
   193 +  __ashrti3
   194 +  __cmpti2
   195 +  __divti3
   196 +  __ffsti2
   197 +  __fixdfti
   198 +  __fixsfti
   199 +  __fixtfti
   200 +  __fixxfti
   201 +  __lshrti3
   202 +  __modti3
   203 +  __multi3
   204 +  __negti2
   205 +  __ucmpti2
   206 +  __udivmodti4
   207 +  __udivti3
   208 +  __umodti3
   209 +  __fixunsdfti
   210 +  __fixunssfti
   211 +  __fixunstfti
   212 +  __fixunsxfti
   213 +  __floattidf
   214 +  __floattisf
   215 +  __floattixf
   216 +  __floattitf
   217 +
   218 +  # Used to deal with trampoline initialization on some platforms
   219 +  __clear_cache
   220 +
   221 +  # EH symbols
   222 +  _Unwind_DeleteException
   223 +  _Unwind_Find_FDE
   224 +  _Unwind_ForcedUnwind
   225 +  _Unwind_GetGR
   226 +  _Unwind_GetIP
   227 +  _Unwind_GetLanguageSpecificData
   228 +  _Unwind_GetRegionStart
   229 +  _Unwind_GetTextRelBase
   230 +  _Unwind_GetDataRelBase
   231 +  _Unwind_RaiseException
   232 +  _Unwind_Resume
   233 +  _Unwind_SetGR
   234 +  _Unwind_SetIP
   235 +  __deregister_frame
   236 +  __deregister_frame_info
   237 +  __deregister_frame_info_bases
   238 +  __register_frame
   239 +  __register_frame_info
   240 +  __register_frame_info_bases
   241 +  __register_frame_info_table
   242 +  __register_frame_info_table_bases
   243 +  __register_frame_table
   244 +
   245 +  # SjLj EH symbols
   246 +  _Unwind_SjLj_Register
   247 +  _Unwind_SjLj_Unregister
   248 +  _Unwind_SjLj_RaiseException
   249 +  _Unwind_SjLj_ForcedUnwind
   250 +  _Unwind_SjLj_Resume
   251 +}
   252 +
   253 +%inherit GCC_3.3 GCC_3.0
   254 +GCC_3.3 {
   255 +  _Unwind_FindEnclosingFunction
   256 +  _Unwind_GetCFA
   257 +  _Unwind_Backtrace
   258 +  _Unwind_Resume_or_Rethrow
   259 +  _Unwind_SjLj_Resume_or_Rethrow
   260 +}
   261 +
   262 +%inherit GCC_3.3.1 GCC_3.3
   263 +GCC_3.3.1 {
   264 +  __gcc_personality_sj0
   265 +  __gcc_personality_v0
   266 +}
   267 +
   268 +%inherit GCC_3.3.2 GCC_3.3.1
   269 +GCC_3.3.2 {
   270 +}
   271 +
   272 +%inherit GCC_3.4 GCC_3.3.2
   273 +GCC_3.4 {
   274 +  # bit scanning and counting built-ins
   275 +  __clzsi2
   276 +  __clzdi2
   277 +  __clzti2
   278 +  __ctzsi2
   279 +  __ctzdi2
   280 +  __ctzti2
   281 +  __popcountsi2
   282 +  __popcountdi2
   283 +  __popcountti2
   284 +  __paritysi2
   285 +  __paritydi2
   286 +  __parityti2
   287 +}
   288