g77 (egcs-1.1.2): warning: multiple common of ...

Toon Moene toon@moene.indiv.nluug.nl
Sun Oct 31 23:03:00 GMT 1999


Harald Harders wrote:

> first of all the data of my system:
> Compiler: g77 version egcs-2.91.66 19990314 (egcs-1.1.2 release) (from
>           FSF-g77 version 0.5.24-19981002)
> Computer: i686
> OS:       SuSE Linux 6.1

> Detailed output:
> $ g77 -v --save-temps -Wall -o two_files two_files.f sub.f
> g77 version egcs-2.91.66 19990314 (egcs-1.1.2 release) (from FSF-g77
> version 0.5.24-19981002)
> Driving: g77 -v -save-temps -Wall -o two_files two_files.f sub.f -lg2c -lm
> Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/specs
> gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
>  /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/f771 two_files.f -quiet
> -dumpbase two_files.f -Wall -version -fversion -o two_files.s
> GNU F77 version egcs-2.91.66 19990314 (egcs-1.1.2 release) (i486-linux)
> compiled by GNU C version egcs-2.91.66 19990314 (egcs-1.1.2 release).
> GNU Fortran Front End version 0.5.24-19981002
>  /usr/i486-linux/bin/as -V -Qy -o two_files.o two_files.s
> GNU assembler version 2.9.1 (i486-linux), using BFD version 2.9.1.0.22
>  /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/f771 sub.f -quiet -dumpbase
> sub.f -Wall -version -fversion -o sub.s
> GNU F77 version egcs-2.91.66 19990314 (egcs-1.1.2 release) (i486-linux)
> compiled by GNU C version egcs-2.91.66 19990314 (egcs-1.1.2 release).
> GNU Fortran Front End version 0.5.24-19981002
>  /usr/i486-linux/bin/as -V -Qy -o sub.o sub.s
> GNU assembler version 2.9.1 (i486-linux), using BFD version 2.9.1.0.22
>  /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/collect2 -m elf_i386
> -dynamic-linker /lib/ld-linux.so.2 -o two_files /usr/lib/crt1.o
> /usr/lib/crti.o /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/crtbegin.o
> -L/home/fk7b/usr/local/qt-2.00/lib
> -L/usr/lib/gcc-lib/i486-linux/egcs-2.91.66 -L/usr/i486-linux/lib
> two_files.o sub.o -lg2c -lm -lgcc -warn-common -lc -lgcc
> /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/crtend.o /usr/lib/crtn.o
> sub.o: warning: multiple common of `asdf_'
> two_files.o: warning: previous common is here

I can reproduce this if I link the objects like this on my Red Hat 5.2
system (i.e. passing the -warn-common option to the linking phase):

$ g77 -v -Wl,-warn-common 1.o 2.o
g77 version 2.95.2 19990906 (prerelease) (from FSF-g77 version 0.5.25
19990906 (prerelease))
Driving: g77 -v -Wl,-warn-common 1.o 2.o -lg2c -lm
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19990906 (prerelease)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/collect2 -m elf_i386
-dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/crtbegin.o
-L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2
-L/usr/local/i686-pc-linux-gnu/lib -L/usr/local/lib -warn-common 1.o 2.o
-lg2c -lm -lgcc -lc -lgcc
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/crtend.o /usr/lib/crtn.o
2.o: warning: multiple common of `abc_'
1.o: warning: previous common is here

So apparently SuSE thought it a bright idea to make -warn-common a
default option when linking.  Perhaps it's good for something, but not
for the unwary Fortran programmer.

Several SuSE engineers are on this list - what's the reason for
including -warn-common in the default option list for collect2 ?

-- 
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://gcc.gnu.org/onlinedocs/g77_news.html



More information about the Gcc-bugs mailing list