Subject: Re: Gcc configure bug
To: Martin Husemann <martin@duskware.de>
From: Richard Earnshaw <rearnsha@netbsd.org>
List: tech-toolchain
Date: 11/17/2005 13:45:19
On Thu, 2005-11-17 at 09:17, Martin Husemann wrote:
> Ok, after some comments from Nick I looked at it again.
> 
> With the current state of config.gcc there is no good way to get what
> we want with $target_cpu_default for sparc*. Since this is a lost battle
> and we hopefully will get a newer compiler (that does this all different)
> sometime soon, how about this patch? It should fix the problem and keep
> command line semantics.
> 
> Martin
> 
> Index: configure.in
> ===================================================================
> RCS file: /cvsroot/src/gnu/dist/gcc/gcc/configure.in,v
> retrieving revision 1.4
> diff -u -r1.4 configure.in
> --- configure.in	10 Feb 2004 12:56:21 -0000	1.4
> +++ configure.in	17 Nov 2005 09:13:45 -0000
> @@ -880,8 +880,10 @@
>  # For the host machine, we save the xm_file variable as host_xm_file;
>  # then we decode the target machine and forget everything else
>  # that came from the host machine.
> +arg_with_cpu="$with_cpu"
>  for machine in $build $host $target; do
>  	. ${srcdir}/config.gcc
> +	with_cpu="$arg_with_cpu"
>  done
>  
>  extra_objs="${host_extra_objs} ${extra_objs}"

with_cpu is a property of the target.  Since that's the last pass to run
it should be able to set the final value of with_cpu.  So I think your
reassignment should appear at the top of each pass.  Something like

 # For the host machine, we save the xm_file variable as host_xm_file;
 # then we decode the target machine and forget everything else
 # that came from the host machine.
+arg_with_cpu="$with_cpu"
 for machine in $build $host $target; do
+       with_cpu="$arg_with_cpu"
        . ${srcdir}/config.gcc
 done
 
 extra_objs="${host_extra_objs} ${extra_objs}"


R.