This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Update default arch for x86
On Fri, Feb 26, 2010 at 06:14:51PM -0800, H.J. Lu wrote:
> On Fri, Feb 26, 2010 at 5:29 PM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
> > On Fri, Feb 26, 2010 at 05:06:00PM -0500, Jason Merrill wrote:
> >> On 02/26/2010 03:56 PM, H.J. Lu wrote:
> >>> Here is the updated patch to replace arch_fpmath_pentium4 with
> >>> arch_without_sse2. ?OK to install?
> >>
> >> OK.
> >>
> >> Jason
> >
> > ? The current gcc trunk no longer allows darwin10 to build with the
> > configuration...
> >
> > ../gcc-4.5-20100226/configure --prefix=/sw --prefix=/sw/lib/gcc4.5 --mandir=/sw/share/man --infodir=/sw/share/info --enable-languages=c,c++,fortran,objc,obj-c++,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-mpc=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --disable-libjava-multilib --build=i686-apple-darwin10 --host=i686-apple-darwin10 --target=i686-apple-darwin10
> >
> > The build hangs in the x86_64 libgcc multilib subdirectory with the config.log errors there of...
> >
>
> That will happen for all i[34567]86-*-* targets which also require 64bit ISA.
> This patch avoids setting the default arch if 64bit ISA is required and
> i[34567]86-*-* targets don't support 64bit ISA.
>
>
> --
> H.J.
> 2010-02-26 H.J. Lu <hongjiu.lu@intel.com>
>
> * config.gcc: Don't set the default arch if 64bit ISA is required
> and i[34567]86-*-* targets don't support 64bit ISA.
>
> diff --git a/gcc/config.gcc b/gcc/config.gcc
> index a189400..610ff2a 100644
> --- a/gcc/config.gcc
> +++ b/gcc/config.gcc
> @@ -199,6 +199,7 @@ gnu_ld="$gnu_ld_flag"
> default_use_cxa_atexit=no
> target_gtfiles=
> need_64bit_hwint=
> +need_64bit_isa=
>
> # Don't carry these over build->host->target. Please.
> xm_file=
> @@ -1083,6 +1084,7 @@ hppa[12]*-*-hpux11*)
> ;;
> i[34567]86-*-darwin*)
> need_64bit_hwint=yes
> + need_64bit_isa=yes
>
> # This is so that '.../configure && make' doesn't fail due to
> # config.guess deciding that the configuration is i386-*-darwin* and
> @@ -1148,6 +1150,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
> tm_defines="${tm_defines} TARGET_BI_ARCH=1"
> tmake_file="${tmake_file} i386/t-linux64"
> need_64bit_hwint=yes
> + need_64bit_isa=yes
> case X"${with_cpu}" in
> Xgeneric|Xatom|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3)
> ;;
> @@ -1266,6 +1269,7 @@ i[34567]86-*-solaris2*)
> # depends on a runtime test and is thus performed in
> # libgcc/configure.ac instead.
> need_64bit_hwint=yes
> + need_64bit_isa=yes
> use_gcc_stdint=wrap
> case X"${with_cpu}" in
> Xgeneric|Xatom|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3)
> @@ -1335,6 +1339,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
> case ${target} in
> x86_64-*-* | *-w64-*)
> need_64bit_hwint=yes
> + need_64bit_isa=yes
> ;;
> *)
> ;;
> @@ -2626,19 +2631,23 @@ esac
> arch=
> cpu=
> arch_without_sse2=no
> +arch_without_64bit=no
> case ${target} in
> i386-*-*)
> arch=i386
> cpu=i386
> arch_without_sse2=yes
> + arch_without_64bit=yes
> ;;
> i486-*-*)
> arch=i486
> cpu=i486
> arch_without_sse2=yes
> + arch_without_64bit=yes
> ;;
> i586-*-*)
> arch_without_sse2=yes
> + arch_without_64bit=yes
> case ${target_noncanonical} in
> k6_2-*)
> arch=k6-2
> @@ -2680,6 +2689,7 @@ case ${target} in
> arch=athlon-4
> cpu=athlon-4
> arch_without_sse2=yes
> + arch_without_64bit=yes
> ;;
> athlon_tbird-*|athlon-*)
> arch=athlon
> @@ -2848,21 +2858,28 @@ if test x$with_arch = x ; then
> case ${target} in
> i[34567]86-*-darwin*)
> # SSE math is enabled for Darwin, which sets the default ISA to
> - # SSE2. The minimum ISA supported Darwin is SSE3, which is the
> - # same as Prescott.
> - if test $arch_without_sse2 = no; then
> + # SSE2. The minimum ISA supported Darwin is SSE3 and Darwin also
> + # needs 64bit ISA, which is the same as Nocona.
> + if test $arch_without_sse2$arch_without_64bit = nono; then
> with_arch=$arch
> else
> - with_arch=prescott
> + with_arch=nocona
> fi
> ;;
> i[34567]86-*-*)
> # --with-fpmath sets the default ISA to SSE2, which is the same
> - # ISA supported by Pentium 4.
> - if test x$with_fpmath = x || test $arch_without_sse2 = no; then
> - with_arch=$arch
> + # ISA supported by Pentium 4. If 64bit ISA is required, we don't
> + # set with_arch if arch_without_64bit is yes.
> + if test $need_64bit_isa = yes; then
> + if test $arch_without_64bit != yes; then
> + with_arch=$arch
> + fi
> else
> - with_arch=pentium4
> + if test x$with_fpmath = x || test $arch_without_sse2 = no; then
> + with_arch=$arch
> + else
> + with_arch=pentium4
> + fi
> fi
> ;;
> x86_64-*-*)
HJ,
Thanks. I can confirm that this solves the bootstrap problem for
the i686-apple-darwin10 build/host/target.
Jack