Bug 456886 - fortran.m4: sh architecture specific option treamtment.
Summary: fortran.m4: sh architecture specific option treamtment.
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: autoconf
Version: rawhide
Hardware: sh4
OS: Linux
low
low
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-07-28 13:30 UTC by CHIKAMA Masaki
Modified: 2008-10-28 19:20 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-10-28 19:20:44 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description CHIKAMA Masaki 2008-07-28 13:30:05 UTC
Description of problem:
On sh architecture, gcc(gfortran) passes "-little" option to gas when compiling.
This causes the failure of configure script which checking gfortran.
Here is the example when running configure script HDF4.2r2,

checking how to get verbose linking output from gfortran... -v
checking for Fortran 77 libraries of gfortran...  -little
-L/usr/lib/gcc/sh4-redhat-linux/4.1.2
-L/usr/lib/gcc/sh4-redhat-linux/4.1.2/../../.. -lgfortranbegin -lgfortran -lm
checking for dummy main to link with Fortran 77 libraries... unknown
configure: error: linking to Fortran libraries from C fails
See `config.log' for more details.

and config.log .

configure:4729: checking for Fortran 77 libraries of gfortran
configure:4752: gfortran -o conftest -g -O2 -v conftest.f
Using built-in specs.
Target: sh4-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions
--enable-languages=c,c++,objc,obj-c++,java,fortran --enable-java-awt=gtk
--disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --host=sh4-redhat-linux
Thread model: posix
gcc version 4.1.2 20071124 (Red Hat 4.1.2-37.fs5)
 /usr/libexec/gcc/sh4-redhat-linux/4.1.2/f951 conftest.f -ffixed-form -quiet
-dumpbase conftest.f -auxbase conftest -g -O2 -version -I
/usr/lib/gcc/sh4-redhat-linux/4.1.2/finclude -o /tmp/ccmlwvVO.s
GNU F95 version 4.1.2 20071124 (Red Hat 4.1.2-37.fs5) (sh4-redhat-linux)
        compiled by GNU C version 4.1.2 20071124 (Red Hat 4.1.2-37.fs5).
GGC heuristics: --param ggc-min-expand=38 --param ggc-min-heapsize=15811
 as -little -o /tmp/ccvKExwY.o /tmp/ccmlwvVO.s
 /usr/libexec/gcc/sh4-redhat-linux/4.1.2/collect2 --eh-frame-hdr --build-id -m
shlelf_linux -dynamic-linker /lib/ld-linux.so.2 -o conftest
/usr/lib/gcc/sh4-redhat-linux/4.1.2/../../../crt1.o
/usr/lib/gcc/sh4-redhat-linux/4.1.2/../../../crti.o
/usr/lib/gcc/sh4-redhat-linux/4.1.2/crtbegin.o
-L/usr/lib/gcc/sh4-redhat-linux/4.1.2 -L/usr/lib/gcc/sh4-redhat-linux/4.1.2
-L/usr/lib/gcc/sh4-redhat-linux/4.1.2/../../.. /tmp/ccvKExwY.o -lgfortranbegin
-lgfortran -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/lib/gcc/sh4-redhat-linux/4.1.2/crtend.o
/usr/lib/gcc/sh4-redhat-linux/4.1.2/../../../crtn.o
configure:4926: result:  -little -L/usr/lib/gcc/sh4-redhat-linux/4.1.2
-L/usr/lib/gcc/sh4-redhat-linux/4.1.2/../../.. -lgfortranbegin -lgfortran -lm
configure:4943: checking for dummy main to link with Fortran 77 libraries
configure:4987: gcc -o conftest    conftest.c   -little
-L/usr/lib/gcc/sh4-redhat-linux/4.1.2
-L/usr/lib/gcc/sh4-redhat-linux/4.1.2/../../.. -lgfortranbegin -lgfortran -lm >&5
/usr/bin/ld: cannot find -little
collect2: ld returned 1 exit status


The current gas recognize "-little" and "--little" option for LE, but older one
does only "-little".
The current gcc passes "-little" to gas even in gcc trank for compatibility.
Then we have to special treatment for this option.
Here is a proposed patch not to recognize "-little" as library option but
special option to be ignored.
We also need patches which are already generated configure script, but I'll file
as Bugs.

--- lib/autoconf/fortran.m4.org 2008-07-28 22:26:19.000000000 +0900
+++ lib/autoconf/fortran.m4     2008-07-28 22:26:37.000000000 +0900
@@ -666,7 +666,7 @@
              [_AC_LINKER_OPTION([$ac_arg], ac_cv_[]_AC_LANG_ABBREV[]_libs)])
           ;;
           # Ignore these flags.
-        -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -LANG:=* |
-LIST:* | -LNO:*)
+        -little | -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil |
-LANG:=* | -LIST:* | -LNO:*)
           ;;
         -lkernel32)
           test x"$CYGWIN" != xyes &&
ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg"




Version-Release number of selected component (if applicable):
autoconf-2.61-10

Comment 2 Christopher D. Stover 2008-10-28 19:20:44 UTC
Thanks for passing that upstream to get it fixed CHIKAMA.


Note You need to log in before you can comment on or make changes to this bug.