Bug 456886

Summary: fortran.m4: sh architecture specific option treamtment.
Product: [Fedora] Fedora Reporter: CHIKAMA Masaki <masaki.chikama>
Component: autoconfAssignee: Karsten Hopp <karsten>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: sh4   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-10-28 19:20:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.