Bug 456886 - fortran.m4: sh architecture specific option treamtment.
fortran.m4: sh architecture specific option treamtment.
Product: Fedora
Classification: Fedora
Component: autoconf (Show other bugs)
sh4 Linux
low Severity low
: ---
: ---
Assigned To: Karsten Hopp
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-07-28 09:30 EDT by CHIKAMA Masaki
Modified: 2008-10-28 15:20 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-10-28 15:20:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description CHIKAMA Masaki 2008-07-28 09:30:05 EDT
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/../../.. -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
--enable-languages=c,c++,objc,obj-c++,java,fortran --enable-java-awt=gtk
--disable-dssi --enable-plugin
--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
-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
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/../../.. -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:*)
           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):
Comment 2 Christopher D. Stover 2008-10-28 15:20:44 EDT
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.