Patchwork serious libgcc regression added recently

login
register
mail settings
Submitter David Miller
Date Nov. 3, 2011, 3:41 a.m.
Message ID <20111102.234108.1387588897366667364.davem@davemloft.net>
Download mbox | patch
Permalink /patch/123392/
State New
Headers show

Comments

David Miller - Nov. 3, 2011, 3:41 a.m.
From: "Joseph S. Myers" <joseph@codesourcery.com>
Date: Thu, 3 Nov 2011 01:21:35 +0000 (UTC)

> What is new is that you can now put tests in libgcc/configure.ac
> such as the "Check 32bit or 64bit for x86." one, and select t-*
> files based on those tests - whereas in the gcc/ directory there is
> no possibility at all for the choice of t-* files to depend on the
> multilib.

That works for me, I'm bootstrapping the following:

--------------------
[PATCH] Fix multilib build of libgcc on Linux/sparc.

	* configure.ac: Set host_address on sparc too.
	* configure: Regenerate.
	* config.host: Add sparc/t-linux64 and sparc/t-softmul conditionally
	based upon host_address.
	* config/sparc/t-linux64: Set CRTSTUFF_T_CFLAGS unconditionally.
---
 libgcc/ChangeLog              |    8 ++++++++
 libgcc/config.host            |   17 ++++++++++++++---
 libgcc/config/sparc/t-linux64 |    3 +--
 libgcc/configure              |    7 ++++---
 libgcc/configure.ac           |    7 ++++---
 5 files changed, 31 insertions(+), 11 deletions(-)
Paolo Bonzini - Nov. 3, 2011, 8:18 a.m.
On 11/03/2011 04:41 AM, David Miller wrote:
> From: "Joseph S. Myers"<joseph@codesourcery.com>
> Date: Thu, 3 Nov 2011 01:21:35 +0000 (UTC)
>
>> What is new is that you can now put tests in libgcc/configure.ac
>> such as the "Check 32bit or 64bit for x86." one, and select t-*
>> files based on those tests - whereas in the gcc/ directory there is
>> no possibility at all for the choice of t-* files to depend on the
>> multilib.
>
> That works for me, I'm bootstrapping the following:

Ok, though you probably do not need approval.

Paolo
Jakub Jelinek - Nov. 3, 2011, 8:22 a.m.
On Wed, Nov 02, 2011 at 11:41:08PM -0400, David Miller wrote:
> --- a/libgcc/configure.ac
> +++ b/libgcc/configure.ac
> @@ -255,11 +255,12 @@ AC_CACHE_CHECK([whether assembler supports CFI directives], [libgcc_cv_cfi],
>    [libgcc_cv_cfi=yes],
>    [libgcc_cv_cfi=no])])
>  
> -# Check 32bit or 64bit for x86.
> +# Check 32bit or 64bit for x86 and sparc.
>  case ${host} in
> -i?86*-*-* | x86_64*-*-*)
> +i?86*-*-* | x86_64*-*-* | sparc*-*-*)
>    cat > conftest.c <<EOF
> -#ifdef __x86_64__
> +#if defined(__x86_64__) || \
> +    (defined(__sparc__) && defined(__arch64__))
>  host_address=64
>  #else
>  host_address=32

I think much better would be to handle sparc*/s390*/powerpc* differently
here, just using #ifdef __LP64__ test.  i?86/x86_64 is different because
of the third weirdo multilib option.

	Jakub
David Miller - Nov. 4, 2011, 6:43 a.m.
From: Jakub Jelinek <jakub@redhat.com>
Date: Thu, 3 Nov 2011 09:22:51 +0100

> On Wed, Nov 02, 2011 at 11:41:08PM -0400, David Miller wrote:
>> --- a/libgcc/configure.ac
>> +++ b/libgcc/configure.ac
>> @@ -255,11 +255,12 @@ AC_CACHE_CHECK([whether assembler supports CFI directives], [libgcc_cv_cfi],
>>    [libgcc_cv_cfi=yes],
>>    [libgcc_cv_cfi=no])])
>>  
>> -# Check 32bit or 64bit for x86.
>> +# Check 32bit or 64bit for x86 and sparc.
>>  case ${host} in
>> -i?86*-*-* | x86_64*-*-*)
>> +i?86*-*-* | x86_64*-*-* | sparc*-*-*)
>>    cat > conftest.c <<EOF
>> -#ifdef __x86_64__
>> +#if defined(__x86_64__) || \
>> +    (defined(__sparc__) && defined(__arch64__))
>>  host_address=64
>>  #else
>>  host_address=32
> 
> I think much better would be to handle sparc*/s390*/powerpc* differently
> here, just using #ifdef __LP64__ test.  i?86/x86_64 is different because
> of the third weirdo multilib option.

Yes, using __LP64__ for non-x86 is much better.  Then we can completely
remove the ${host} conditional and nobody will have to hack on this
piece of configure code ever again.

I'll try to find time ot hack this together if nobody beats me to it.

Patch

diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 1bbe29a..3944193 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,11 @@ 
+2011-11-02  David S. Miller  <davem@davemloft.net>
+
+	* configure.ac: Set host_address on sparc too.
+	* configure: Regenerate.
+	* config.host: Add sparc/t-linux64 and sparc/t-softmul conditionally
+	based upon host_address.
+	* config/sparc/t-linux64: Set CRTSTUFF_T_CFLAGS unconditionally.
+
 2011-11-02  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
 	* gthr-single.h, gthr.h: New files.
diff --git a/libgcc/config.host b/libgcc/config.host
index 05f084b..647c6a1 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -1008,7 +1008,10 @@  sparc-*-elf*)
 	extra_parts="$extra_parts crti.o crtn.o crtfastmath.o"
 	;;
 sparc-*-linux*)		# SPARC's running GNU/Linux, libc6
-	tmake_file="${tmake_file} t-crtfm sparc/t-linux64"
+	tmake_file="${tmake_file} t-crtfm"
+	if test "${host_address}" = 64; then
+  		tmake_file="$tmake_file sparc/t-linux64"
+	fi
 	case ${host} in
 	*-leon*)
 		tmake_file="${tmake_file} t-fdpbit"
@@ -1021,7 +1024,9 @@  sparc-*-linux*)		# SPARC's running GNU/Linux, libc6
 	*-leon[3-9]*)
 		;;
 	*)
-	  	tmake_file="$tmake_file sparc/t-softmul"
+		if test "${host_address}" = 32; then
+	  		tmake_file="$tmake_file sparc/t-softmul"
+		fi
 	  	;;
 	esac
 	extra_parts="$extra_parts crtfastmath.o"
@@ -1052,7 +1057,13 @@  sparc64-*-freebsd*|ultrasparc-*-freebsd*)
 	;;
 sparc64-*-linux*)		# 64-bit SPARC's running GNU/Linux
 	extra_parts="$extra_parts crtfastmath.o"
-	tmake_file="${tmake_file} t-crtfm sparc/t-linux sparc/t-linux64"
+	tmake_file="${tmake_file} t-crtfm sparc/t-linux"
+	if test "${host_address}" = 64; then
+		tmake_file="${tmake_file} sparc/t-linux64"
+	fi
+	if test "${host_address}" = 32; then
+		tmake_file="${tmake_file} sparc/t-softmul"
+	fi
 	md_unwind_header=sparc/linux-unwind.h
 	;;
 sparc64-*-netbsd*)
diff --git a/libgcc/config/sparc/t-linux64 b/libgcc/config/sparc/t-linux64
index ca4a892..6583fe2 100644
--- a/libgcc/config/sparc/t-linux64
+++ b/libgcc/config/sparc/t-linux64
@@ -1,2 +1 @@ 
-CRTSTUFF_T_CFLAGS = `if test x$$($(CC) -print-multi-os-directory) \
-			= x../lib64; then echo -mcmodel=medany; fi`
+CRTSTUFF_T_CFLAGS = -mcmodel=medany
diff --git a/libgcc/configure b/libgcc/configure
index 0d91645..0f18037 100644
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -4609,11 +4609,12 @@  fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_cfi" >&5
 $as_echo "$libgcc_cv_cfi" >&6; }
 
-# Check 32bit or 64bit for x86.
+# Check 32bit or 64bit for x86 and sparc.
 case ${host} in
-i?86*-*-* | x86_64*-*-*)
+i?86*-*-* | x86_64*-*-* | sparc*-*-*)
   cat > conftest.c <<EOF
-#ifdef __x86_64__
+#if defined(__x86_64__) || \
+    (defined(__sparc__) && defined(__arch64__))
 host_address=64
 #else
 host_address=32
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
index a505257..5250be3 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -255,11 +255,12 @@  AC_CACHE_CHECK([whether assembler supports CFI directives], [libgcc_cv_cfi],
   [libgcc_cv_cfi=yes],
   [libgcc_cv_cfi=no])])
 
-# Check 32bit or 64bit for x86.
+# Check 32bit or 64bit for x86 and sparc.
 case ${host} in
-i?86*-*-* | x86_64*-*-*)
+i?86*-*-* | x86_64*-*-* | sparc*-*-*)
   cat > conftest.c <<EOF
-#ifdef __x86_64__
+#if defined(__x86_64__) || \
+    (defined(__sparc__) && defined(__arch64__))
 host_address=64
 #else
 host_address=32