[Bug libfortran/54097] New: configure: error: GNU Fortran is not working (CPU you selected does not support x86-64 instruction set)

2012-07-25 Thread pentium4borg at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54097

 Bug #: 54097
   Summary: configure: error: GNU Fortran is not working (CPU you
selected does not support x86-64 instruction set)
Classification: Unclassified
   Product: gcc
   Version: 4.5.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libfortran
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: pentium4b...@gmail.com


Created attachment 27875
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27875
config.log

I'm trying to build a 64-bit gcc-4.3.2-r2 in a 32-bit crossdev environment on
Gentoo. The CPU and host system are 64-bit. The root Gentoo system is itself a
32-bit chroot, and within this chroot I am trying to cross-compile a 64-bit
environment from the 32-bit system. This has worked many times in the past, but
gcc is now is failing to build.

When configure for libgfortran runs, it fails with the following:


configure:14588: checking whether the GNU Fortran compiler is working
configure:14601:
/var/tmp/portage/cross-x86_64-pc-linux-gnu/gcc-4.5.3-r2/work/build/./gcc/gfortran
-B/var/tmp/portage/cross-x86_64-pc-linux-gnu/gcc-4.5.3-r2/work/build/./gcc/
-B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem
/usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include 
  -c -O2 -march=i686 -pipe  conftest.f >&5
f951: error: CPU you selected does not support x86-64 instruction set  
   
 
configure:14601: $? = 1
configure: failed program was: 
   
  |
   
   
|  
program foo
   
  |
  real, parameter :: bar = sin (12.34 / 2.5)
|   end program foo
   
 
configure:14605: result: no
   
 
configure:14607: error: GNU Fortran is not working; please report a bug in
http://gcc.gnu.org/bugzilla, attaching
/var/tmp/portage/cross-x86_64-pc-linux-gnu/gcc-4.5.3-r2/work/build/x86_64-pc-linux-gnu/libgfortran/config.log


If I copy the command and test program, and run it with -m32, that test program
compiles fine. Since the target arch is i686, why does the compiler have to
deliberately be told to generate 32-bit code? Is there a fix for gcc's
configure or Makefiles?

(Full config.log is attached.)

Thanks!


[Bug libfortran/54097] configure: error: GNU Fortran is not working (CPU you selected does not support x86-64 instruction set)

2012-07-25 Thread pentium4borg at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54097

pentium4borg at gmail dot com changed:

   What|Removed |Added

 CC||pentium4borg at gmail dot
   ||com

--- Comment #2 from pentium4borg at gmail dot com 2012-07-25 23:02:28 UTC ---
(In reply to comment #1)
> Simple answer don't use "-march=i686" in any of the *C*FLAGS env variables.

Why is that? I thought -march=i686 was supposed to produce i686 compatible code
(i.e., 32-bit).