Use "$CT_CC}" instead of "gcc" when calling target compilers.
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>
14 Content-Type: Text/Plain; charset=us-ascii
15 Content-Transfer-Encoding: 7bit
19 The appended patch is to fix PR target/15647
20 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15647
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
39 The original PR is also for sh3 netbsd. I'd like to leave it for the
42 I think that it's too late for 3.3.4. Mark, is it also late for
48 2004-05-26 Kaz Kojima <kkojima@gcc.gnu.org>
50 * config/sh/t-linux (SHLIB_MAPFILES): Use sh specific
52 * config/sh/libgcc-std.ver: New file.
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
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
69 # Override SHLIB_LINK and SHLIB_INSTALL to use linker script
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
76 + # libgcc1 integer symbols
91 + # libgcc1 floating point symbols
155 + # libgcc2 DImode arithmetic (for 32-bit targets).
191 + # libgcc2 TImode arithmetic (for 64-bit targets).
218 + # Used to deal with trampoline initialization on some platforms
222 + _Unwind_DeleteException
224 + _Unwind_ForcedUnwind
227 + _Unwind_GetLanguageSpecificData
228 + _Unwind_GetRegionStart
229 + _Unwind_GetTextRelBase
230 + _Unwind_GetDataRelBase
231 + _Unwind_RaiseException
236 + __deregister_frame_info
237 + __deregister_frame_info_bases
239 + __register_frame_info
240 + __register_frame_info_bases
241 + __register_frame_info_table
242 + __register_frame_info_table_bases
243 + __register_frame_table
246 + _Unwind_SjLj_Register
247 + _Unwind_SjLj_Unregister
248 + _Unwind_SjLj_RaiseException
249 + _Unwind_SjLj_ForcedUnwind
250 + _Unwind_SjLj_Resume
253 +%inherit GCC_3.3 GCC_3.0
255 + _Unwind_FindEnclosingFunction
258 + _Unwind_Resume_or_Rethrow
259 + _Unwind_SjLj_Resume_or_Rethrow
262 +%inherit GCC_3.3.1 GCC_3.3
264 + __gcc_personality_sj0
265 + __gcc_personality_v0
268 +%inherit GCC_3.3.2 GCC_3.3.1
272 +%inherit GCC_3.4 GCC_3.3.2
274 + # bit scanning and counting built-ins