From owner-freebsd-current Mon Jun 24 00:50:51 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id AAA02255 for current-outgoing; Mon, 24 Jun 1996 00:50:51 -0700 (PDT) Received: from diablo.ppp.de (diablo.ppp.de [193.141.101.34]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id AAA02248 for ; Mon, 24 Jun 1996 00:50:43 -0700 (PDT) Received: from allegro.lemis.de by diablo.ppp.de with smtp (Smail3.1.28.1 #1) id m0uY6PY-000Qb0C; Mon, 24 Jun 96 09:50 MET DST From: grog@lemis.de (Greg Lehey) Organisation: LEMIS, Schellnhausen 2, 36325 Feldatal, Germany Phone: +49-6637-919123 Fax: +49-6637-919122 Received: (grog@localhost) by allegro.lemis.de (8.6.9/8.6.9) id JAA29452; Mon, 24 Jun 1996 09:48:14 +0200 Message-Id: <199606240748.JAA29452@allegro.lemis.de> Subject: Re: make fails To: terry@lambert.org (Terry Lambert) Date: Mon, 24 Jun 1996 09:48:14 +0200 (MET DST) Cc: FreeBSD-current@FreeBSD.ORG (FreeBSD current users) In-Reply-To: <199606240657.XAA27332@phaeton.artisoft.com> from "Terry Lambert" at Jun 23, 96 11:57:05 pm X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Terry Lambert writes: > >>> cc -O -c /usr/src/usr.bin/lex/lib/libmain.c -o libmain.o >>> ld: invalid command option `-O' >>> *** Error code 1 >> >> Fascinating. For some non-evident reason, cc has decided to invoke >> the loader instead of the compiler. I can't see any good reason for >> that, but why not expiriment: change to directory lib, and issue the >> command manually. In particular, I'd like to see the output of: >> >> cc -v -O -c /usr/src/usr.bin/lex/lib/libmain.c -o libmain.o >> >> and >> >> cc -v -O -c /usr/src/usr.bin/lex/lib/libmain.c >> >> The -v option prints out exact information about the passes that cc >> starts, and the -o libmain.o is superfluous (though I suspect it has >> something to do with this problem). > > I thought this was expected behaviour for a single .c file without a -C? Which example is expected behaviour? The command *should* compile libmain.c and create an object file libmain.o, omitting the linker step, with or without the -o libmain.o. Some flavours of cc (specifically System V) reserve the -o for the name of the final executable, thus giving rise to messages like "would overwrite libmain.o". I was suspecting that the cc wasn't quite kosher. I since heard from the original correspondent that he "fixed" it by installing a new version of ld. Since ld shouldn't be involved, I'm not convinced that anything's "fixed". Greg