Patchwork [committed] config.gcc: Add newlib-stdint.h for sh64* when newlib enabled

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

Comments

Kaz Kojima - Nov. 3, 2010, 10:08 p.m.
I've noticed that config.gcc missed to newlib-stdint.h to tm_file
for sh64-elf and it causes many testsuite failures.  Tested for
cross sh64-elf and native i686-pc-linux-gnu.  Applied on trunk.

Regards,
	kaz
--
2010-11-03  Kaz Kojima  <kkojima@gcc.gnu.org>

	* config.gcc (sh64*) <tm_file>: Add newlib-stdint.h for
	newlib targets.
Ralf Corsepius - Nov. 4, 2010, 1:05 a.m.
On 11/03/2010 11:08 PM, Kaz Kojima wrote:
> I've noticed that config.gcc missed to newlib-stdint.h to tm_file
> for sh64-elf and it causes many testsuite failures.  Tested for
> cross sh64-elf and native i686-pc-linux-gnu.  Applied on trunk.
>
> Regards,
> 	kaz
> --
> 2010-11-03  Kaz Kojima<kkojima@gcc.gnu.org>
>
> 	* config.gcc (sh64*)<tm_file>: Add newlib-stdint.h for
> 	newlib targets.
>
> --- ORIG/trunk/gcc/config.gcc	2010-10-15 10:11:34.000000000 +0900
> +++ trunk/gcc/config.gcc	2010-11-01 23:36:23.000000000 +0900
> @@ -2328,6 +2328,9 @@ sh-*-symbianelf* | sh[12346l]*-*-symbian
>   	sh64*)
>   		tmake_file="${tmake_file} sh/t-sh64"
>   		tm_file="${tm_file} sh/sh64.h"
> +		if test x$with_newlib = xyes; then
> +			tm_file="${tm_file} newlib-stdint.h"
> +		fi
>   		extra_headers="shmedia.h ushmedia.h sshmedia.h"
>   		;;
>   	*-*-symbianelf*)

This patch doesn't seem right to me, for 2 reasons:

a) The fact a target is using newlib is independent of the architecture 
(here sh64).


b) It is wrong to key using "newlib-stdint.h" to $with_newlib, because 
its possible to build recent gccs with --with-newlib, but without using
newlib-stdint.h with a couple of tweaks to newlib (remove its stdint.h) 
and config.gcc (use use_gcc_stdint=provide).

RTEMS is likely going to apply this approach in near future (I am 
working on it).

Ralf
Kaz Kojima - Nov. 4, 2010, 2:39 a.m.
Ralf Corsepius <ralf.corsepius@rtems.org> wrote:
> This patch doesn't seem right to me, for 2 reasons:
> 
> a) The fact a target is using newlib is independent of the architecture 
> (here sh64).
> 
> b) It is wrong to key using "newlib-stdint.h" to $with_newlib, because 
> its possible to build recent gccs with --with-newlib, but without using
> newlib-stdint.h with a couple of tweaks to newlib (remove its stdint.h) 
> and config.gcc (use use_gcc_stdint=provide).
> 
> RTEMS is likely going to apply this approach in near future (I am 
> working on it).

I agree that my patch isn't best approach in general.  It's simply
a simple fix for sh64-elf testsuite failures.  sh64 isn't a real
target for almost folks and sh64-elf with newlib may be a uniqe
target which is valuable to test.  Of course, your plan looks fine.

Regards,
	kaz

Patch

--- ORIG/trunk/gcc/config.gcc	2010-10-15 10:11:34.000000000 +0900
+++ trunk/gcc/config.gcc	2010-11-01 23:36:23.000000000 +0900
@@ -2328,6 +2328,9 @@  sh-*-symbianelf* | sh[12346l]*-*-symbian
 	sh64*)
 		tmake_file="${tmake_file} sh/t-sh64"
 		tm_file="${tm_file} sh/sh64.h"
+		if test x$with_newlib = xyes; then
+			tm_file="${tm_file} newlib-stdint.h"
+		fi
 		extra_headers="shmedia.h ushmedia.h sshmedia.h"
 		;;
 	*-*-symbianelf*)