trw@aplcen.apl.jhu.edu (Weil timothy) (06/07/90)
After several days of going nowhere with compile command lines such as * gcc -ansi -B -c -o file.o file.c OR, * gcc -ansi -B -o file file.c OR, * gcc -ansi -B file.c I mostly ran into the following error message - "ld: malformed input file (not rel or archive) file.o SO, like most good experimenters I stumbled onto a Makefile which resulted in - * gcc -O -c file.c * cc file.o -o file and THIS ONE WORKED! (and I've got no idea why). "If at first you dont succeed, try try again. Then give up. No sense being a fool about it". - William Claude Dunkenfield (aka W.C. Fields)
steve@robobar.co.uk (Steve Bleazard) (06/08/90)
In article <5637@aplcen.apl.jhu.edu> trw@aplcen.apl.jhu.edu (Weil timothy) writes: >After several days of going nowhere with compile command >lines such as > * gcc -ansi -B -c -o file.o file.c >OR, * gcc -ansi -B -o file file.c >OR, * gcc -ansi -B file.c > >I mostly ran into the following error message - > "ld: malformed input file (not rel or archive) file.o > >SO, like most good experimenters I stumbled onto a Makefile >which resulted in - > * gcc -O -c file.c > * cc file.o -o file > >and THIS ONE WORKED! (and I've got no idea why). > From your earlier postings I got the impression that you were using a binary only distribution of gcc (ie you didn't compile gcc yourself) is this the case? If it is then there's a very good chance you are running my Xenix port of GCC / GAS, in which case the .o files are in OMF format. I must admit to being puzzled by the fact cc manages to link the file - does it invoke a more intelligent linker ie one that understands OMF? it is possible that your standard ld (the one invoked by gcc) does not. If this is the case, ln(C)-ing the more intelligent ld to /usr/local/lib/gcc-ld will allow gcc to link as well. Steve. -- Steve.Bleazard@RoboBar.Co.Uk | Phone: +44 81 991 1142 x153 Snr Software Engineer, Robobar Ltd. | Fax: +44 81 998 8343 (G3) 22 Wadsworth Road, Perivale. | Middx., UB6 7JD ENGLAND. | ...!ukc!robobar!steve