This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bug: Undefined reference to MAIN__
Alexandre Oliva wrote:
> I wrote:
> > Unfortunately, this patch doesn't solve the problem that one cannot run
> > the Fortran testsuite successfully without installing the compiler -
> > that's a problem I'm going to tackle tomorrow ...
>
> `grep -i library_path gcc/testsuite/lib/g++.exp' for some ideas on how
> to do it, in case you find yourself wondering how to fix it.
Hmmm, yes - and .../lib/g77.exp does this:
proc g77_target_compile { source dest type options } {
...
if ![is_remote host] {
set gccpath "[get_multilibs]"
set libg2c_dir [lookfor_file ${gccpath} libf2c/libg2c.a]
if { $libg2c_dir != "" }
{
set libg2c_link_flags "-L[file dirname ${libg2c_dir}]"
lappend options "additional_flags=${libg2c_link_flags}"
}
}
lappend options "compiler=$G77_UNDER_TEST"
return [target_compile $source $dest $type $options]
}
Unfortunately, it doesn't seem to work, as this is `ld' line from
g77.log:
ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o /tmp/ccNQXKKq
/tmp/ccP357gm.o /usr/lib/crt1.o /usr/lib/crti.o /home/toon/co
mpilers/snapshots/obj/gcc/crtbegin.o
-L/home/toon/compilers/snapshots/obj/gcc -lg2c -lm -lgcc -lc -lgcc
/home/toon/compilers/snap
shots/obj/gcc/crtend.o /usr/lib/crtn.o
and `/home/toon/compilers/snapshots/obj/gcc' certainly is *not* the
place where libg2c.a lives prior to installation. So my conclusion is
that previously, when running the test suite without first installing
the compiler didn't even test libg2c.a - but probably the installed
/usr/local/lib/libg2c.a ...
Alas, I do not understand enough of the above language to repair this
...
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)