http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49178

           Summary: Space between linker option and library in gfortran
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: jay.veeram...@nrlssc.navy.mil


/scratch> gfortran -v helloworld.f90 
Driving: gfortran -v helloworld.f90 -l gfortran -l m -shared-libgcc 
Using built-in specs. 
COLLECT_GCC=gfortran 
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.6.0/lto-wrapper 
Target: x86_64-redhat-linux 
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilladhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --ble-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id
--enable-languages=c,c+bjc,obj-c++,java,fortran,ada,go,lto --enable-plugin
--enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile
--enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
isable-libjava-multilib --with-ppl --with-cloog --with-tune=generic
--with-arch_32=i686 --build=x86_64-redhat-linux 
Thread model: posix 
gcc version 4.6.0 20110509 (Red Hat 4.6.0-7) (GCC) 

The issue is with the space between "-l" and "gfortran" as well as "-l" and "m"
in the first line of output. It becomes an issue when libtool uses the
"gfortran -v" command to get the order for linking the fortran libraries and
appends it to the postdeps variable. I get:

----------------------
~/gfortran64bit/src> tail -10 libtool
predep_objects=""
postdep_objects="/usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../lib64/cr
ti.o /usr/lib/gcc/x86_64-redhat-linux/4.6.0/crtbeginS.o
/usr/lib/gcc/x86_64-redhat-linux/4.6.0/crtendS.o
/usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../lib64/crtn.o"
predeps=""
postdeps="-L/home/veeramon/opt/gnu/1.4.3/lib -lmpi_f90 -lmpi_f77 -lmpi
-lopen-rte -lopen-pal -ldl -lnsl -lutil -l -lm -ldl -l -l
-L/home/veeramon/opt/gnu/1.4.3/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.6.0
-L/usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../..
-lmpi_f90 -lmpi_f77 -lmpi -lopen-rte -lopen-pal -ldl -lnsl -lutil -lgfortran
-lm -ldl -lgfortran -lm -lgcc_s -lquadmath -lm -lgcc_s -lpthread -lc
-lgcc_s"

# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=""

# ### END LIBTOOL TAG CONFIG: FC
------------------------

The postdeps variable has "-l" with nothing  after them that cause the
compilation to abort.

Reply via email to