This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

*.f *.c linking problem - g77 = gcc (options)?


For a very strange reason, somebody whose code on SunSparc I am tryng to
port to linux decided to have fortran routines, but a c main program
wrapper and some c routines. 

So on Sunsparc he was doing something like: 

f77 src/routine1.f -c -o obj/routine1.o
cc src/routine2.c -c -o obj/routine2.o
cc src/wrapper.c -c -o obj/wrapper.o
	-----where wrapper.c contains a main() routine
f77 -o result-binary obj/*.o -llib1 -llib2

This does not work for egcs g77 since libf2c contains main.o also. I was
able to compile the binary by striping main.o from libf2c.a with "ar" (for
a day). I.e. It will compile with a broken libf2c.a in which main.o is
removed.

So I am thinking of keeping a broken version of libf2c.a (called it
"libf2c_broken.a", and do a 

"gcc -lf2c_broken -l...." instead of g77. So what does g77 correponds to,
expanding to gcc lines? 

I think this qualifies as a "bug" of at least a missing desirable quality
of egcs gcc/g77 - if the sun cc/f77 compiler can do it, egcs gcc/g77
should be...





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]