Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Apr 1995 03:14:47 -0700
From:      asami@cs.berkeley.edu (Satoshi Asami | =?ISO-2022-JP?B?GyRCQHUbKEI=?= =?ISO-2022-JP?B?GyRCOCsbKEIgGyRCOC0bKEI=?=)
To:        jmacd@freefall.cdrom.com
Cc:        ports@FreeBSD.org, jmacd@freefall.cdrom.com
Subject:   Re: g77 port
Message-ID:  <199504281014.DAA16253@silvia.HIP.Berkeley.EDU>
In-Reply-To: <199504280940.CAA05709@freefall.cdrom.com> (message from Joshua Peck Macdonald on Fri, 28 Apr 1995 02:40:11 -0700)

next in thread | previous in thread | raw e-mail | index | archive | help
 * g77 test.f -lf2c
 * 
 * this shouldn't be neccesary.  and I'm not sure how to fix it.

This is true.  I looked into the gcc sources but couldn't figure out
where they are attaching the libraries.  If you take a look at
/usr/src/gnu/usr.bin/cc/f77, they sure are going through a whole lot
of trouble to decide what to do with the library.

The g77 driver is essentially a modified gcc driver (they create it by 
patching gcc.c), maybe we need to do a little more.

=====
>> f77 -v test.f

 cc -v test.f -lf2c -lm
gcc version 2.6.3
 /usr/bin/f2c test.f -o /e/tmp/cc011626.c
test.f:
   MAIN:
 /usr/libexec/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=6 -Dunix -Di386 -D__FreeBSD__=2 -D__unix__ -D__i386__ -D__FreeBSD__=2 -D__unix -D__i386 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386) /e/tmp/cc011626.c /e/tmp/cc011626.i
GNU CPP version 2.6.3 (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 /usr/include
End of search list.
 /usr/libexec/cc1 /e/tmp/cc011626.i -quiet -dumpbase test.c -version -o /e/tmp/cc011626.s
GNU C version 2.6.3 (80386, BSD syntax) compiled by GNU C version 2.6.3.
 /usr/bin/as -o /e/tmp/cc0116261.o /e/tmp/cc011626.s
 /usr/bin/ld -e start -dc -dp /usr/lib/crt0.o /e/tmp/cc0116261.o -lf2c -lm /usr/lib/libgcc.a -lc /usr/lib/libgcc.a

>> g77 -v test.f

gcc version 2.6.3
 /usr/bin/f2c test.f -o /e/tmp/cc011736.c
test.f:
   MAIN:
 /usr/libexec/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=6 -Dunix -Di386 -D__FreeBSD__=2 -D__unix__ -D__i386__ -D__FreeBSD__=2 -D__unix -D__i386 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386) /e/tmp/cc011736.c /e/tmp/cc011736.i
GNU CPP version 2.6.3 (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 /usr/include
End of search list.
 /usr/libexec/cc1 /e/tmp/cc011736.i -quiet -dumpbase test.c -version -o /e/tmp/cc011736.s
GNU C version 2.6.3 (80386, BSD syntax) compiled by GNU C version 2.6.3.
 /usr/bin/as -o /e/tmp/cc0117361.o /e/tmp/cc011736.s
 /usr/bin/ld -e start -dc -dp /usr/lib/crt0.o /e/tmp/cc0117361.o /usr/lib/libgcc.a -lc /usr/lib/libgcc.a
/usr/lib/crt0.o: Undefined symbol `_main' referenced from text segment
/e/tmp/cc0117361.o: Undefined symbol `_s_wsle' referenced from text segment
/e/tmp/cc0117361.o: Undefined symbol `_do_lio' referenced from text segment
/e/tmp/cc0117361.o: Undefined symbol `_e_wsle' referenced from text segment

>> gcc -v test.f

gcc version 2.6.3
 /usr/bin/f2c test.f -o /e/tmp/cc011786.c
test.f:
   MAIN:
 /usr/libexec/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=6 -Dunix -Di386 -D__FreeBSD__=2 -D__unix__ -D__i386__ -D__FreeBSD__=2 -D__unix -D__i386 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386) /e/tmp/cc011786.c /e/tmp/cc011786.i
GNU CPP version 2.6.3 (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 /usr/include
End of search list.
 /usr/libexec/cc1 /e/tmp/cc011786.i -quiet -dumpbase test.c -version -o /e/tmp/cc011786.s
GNU C version 2.6.3 (80386, BSD syntax) compiled by GNU C version 2.6.3.
 /usr/bin/as -o /e/tmp/cc0117861.o /e/tmp/cc011786.s
 /usr/bin/ld -e start -dc -dp /usr/lib/crt0.o /e/tmp/cc0117861.o /usr/lib/libgcc.a -lc /usr/lib/libgcc.a
/usr/lib/crt0.o: Undefined symbol `_main' referenced from text segment
/e/tmp/cc0117861.o: Undefined symbol `_s_wsle' referenced from text segment
/e/tmp/cc0117861.o: Undefined symbol `_do_lio' referenced from text segment
/e/tmp/cc0117861.o: Undefined symbol `_e_wsle' referenced from text segment

>> mv test.f test.F

>> g77 -v test.F

gcc version 2.6.3
 /usr/libexec/cpp -lang-c -P -v -undef -D__GNUC__=2 -D__unix__ -D__i386__ -D__FreeBSD__=2 -D__unix -D__i386 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386) -D_LANGUAGE_FORTRAN -traditional test.F /e/tmp/cc011771.i
GNU CPP version 2.6.3 (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 /usr/include
End of search list.
 /usr/libexec/f771 /e/tmp/cc011771.i -quiet -dumpbase test.F -version -fversion -o /e/tmp/cc011771.s
GNU F77 version 2.6.3 (80386, BSD syntax) compiled by GNU C version 2.6.3.
GNU Fortran Front End version 0.5.13 compiled: Apr 28 1995 00:51:13
 /usr/bin/as -o /e/tmp/cc0117711.o /e/tmp/cc011771.s
 /usr/bin/ld -e start -dc -dp /usr/lib/crt0.o /e/tmp/cc0117711.o /usr/lib/libgcc.a -lc /usr/lib/libgcc.a
/usr/lib/crt0.o: Undefined symbol `_main' referenced from text segment
/e/tmp/cc0117711.o: Undefined symbol `_s_wsle' referenced from text segment
/e/tmp/cc0117711.o: Undefined symbol `_do_lio' referenced from text segment
/e/tmp/cc0117711.o: Undefined symbol `_e_wsle' referenced from text segment
/e/tmp/cc0117711.o: Undefined symbol `_s_stop' referenced from text segment
=====

By the way, as you can see above, if you call the file "test.f", it's
not even calling f771! ;) You need to name it "test.F" to let it use
the new frontend....

 * 								  I think
 * a good install rule would rm /usr/bin/f77 rm /usr/bin/f2c and install
 * g77 there, linking f77, by the way, but that's not a good rule.

You are kidding here, right?  What does this have to do with the
problem in hand anyway? :)

Satoshi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199504281014.DAA16253>