Patchwork [committed] Fix PR target/44531

login
register
mail settings
Submitter Kaz Kojima
Date July 4, 2010, 10:08 p.m.
Message ID <20100705.070835.215034573.kkojima@rr.iij4u.or.jp>
Download mbox | patch
Permalink /patch/57855/
State New
Headers show

Comments

Kaz Kojima - July 4, 2010, 10:08 p.m.
On SH, we use sed for processing multilibs configuration in
config.gcc.  PR target/44531 is a 4.5/4.6 regression reported
for darwin hosts which have a non-gnu sed.  The 'i' modifier
of the 's' command of sed looks a gnu extension which darwin's
sed doesn't support.  The attached patch uses explicit regular
expressions instead of the 'i' modifier.  It's tested on native
sh4-unknown-linux-gnu, cross combined tree setting on powerpc-
apple-darwin9.8.0 and i686-pc-linux-gnu.  For native sh-linux,
I'm using an unrevied patch in
http://gcc.gnu.org/ml/gcc-patches/2010-06/msg02420.html
to avoid bootstrap issue on that target.
Applied on trunk.  I'll apply it to 4.5-branch latter.

Regards,
	kaz
--
2010-07-04  Kaz Kojima  <kkojima@gcc.gnu.org>

	PR target/44531
	* config.gcc (sh*-*-*): Use regular expressions instead of
	the 'i' modifier for sed substitutions.

Patch

--- ORIG/trunk/gcc/config.gcc	2010-06-13 10:27:51.000000000 +0900
+++ trunk/gcc/config.gcc	2010-06-21 07:28:15.000000000 +0900
@@ -2335,7 +2335,7 @@  sh-*-symbianelf* | sh[12346l]*-*-symbian
 	target_cpu_default=SELECT_`echo ${sh_cpu_default}|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`
 	tm_defines=${tm_defines}' SH_MULTILIB_CPU_DEFAULT=\"'`echo $sh_cpu_default|sed s/sh/m/`'\"'
 	tm_defines="$tm_defines SUPPORT_`echo $sh_cpu_default | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
-	sh_multilibs=`echo $sh_multilibs | sed -e 's/,/ /g' -e 's/^sh/m/i' -e 's/ sh/ m/gi' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz-`
+	sh_multilibs=`echo $sh_multilibs | sed -e 's/,/ /g' -e 's/^[Ss][Hh]/m/' -e 's/ [Ss][Hh]/ m/g' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz-`
 	for sh_multilib in ${sh_multilibs}; do
 		case ${sh_multilib} in
 		m1 | m2 | m2e | m3 | m3e | \