🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs.4bsd
Article #1623

Re: Nasty 4.3 change to cc(1)

#1623
From: Steve Summit
Date: Thu, 07 Aug 1986 02:38
54 lines
2853 bytes
In article <377@curly.ucla-cs.ARPA>, David Smallberg writes:
> Under 4.3,
> 	cc -c -o blah blah.c
> 	  produces one object file, named blah, not blah.o!!!!
> 
> Obviously, someone decided that -o should mean "If there's a single obvious
> output file, -o should rename it," I think the change is a mistake, since it
> breaks existing software and there's no compelling reason I can see to
> prefer the new meaning of -o over the old.  Justifications?

And in article <2743@umcp-cs.UUCP>, Chris Torek writes:
> I have no real idea why the change was installed; most likely
> Berkeley got a request for it and saw no good reason *not* to
> implement it.  I remember a few years ago being surprised that
> `cc -c -o x.o c.c' did not work this way.

I'm sorry about the broken Makefiles, but I'm happy to see this
change, as it can be extremely useful.  (I've been using cc
drivers with this change for about a year now.)

Currently, I am doing software development on a Sequent Balance
8000, but I also want to build Vax versions of my programs, using
a cross-compiler.  My Makefiles can do things like:

	.SUFFIXES: .ovax

	.c.ovax:
		vaxcc $(CFLAGS) -c $*.c -o $*.ovax

This lets me keep sources, native object (.o) files, and Vax
object (.ovax) files in the same directory.  Without a working -o
switch on cc -c, you have to do things like

	.c.ovax:
		cp $*.c tmp.c
		vaxcc $(CFLAGS) -c tmp.c
		mv tmp.o $*.ovax

Besides littering your directory with files called tmp.c, this
method does not work if you try to do a "parallel make," making
use of the Balance 8000's multi-processor architecture to do
several compilations at once.  (Yes, there are slightly more
clever ways to name the tmp files so that they do not step on
each other.)

I'd vote for keeping the new feature and fixing the broken
Makefiles.  Perhaps it would help if cc -c -o generated a
warning when given more than one input file, rather than silently
ignoring the -o.  (That might warn you that something was amiss,
if you had an old-fashioned Makefile that used -c and -o but
expected the -o not to make any difference.)

                                         Steve Summit
                                         tektronix!copper!stevesu
Technical Details
Message-ID: <525@copper.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!sri-spam!parcvax!hplabs!tektronix!teklds!copper!stevesu
References: <377@curly.ucla-cs.ARPA> <2743@umcp-cs.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!sri-spam!parcvax!hplabs!tektronix!teklds!copper!stevesu
From: stevesu@copper.UUCP (Steve Summit)
Newsgroups: net.bugs.4bsd
Subject: Re: Nasty 4.3 change to cc(1)
Message-ID: <525@copper.UUCP>
Date: Wed, 6-Aug-86 22:38:18 EDT
Article-I.D.: copper.525
Posted: Wed Aug  6 22:38:18 1986
Date-Received: Sat, 9-Aug-86 04:26:37 EDT
References: <377@curly.ucla-cs.ARPA> <2743@umcp-cs.UUCP>
Organization: Tektronix, Inc., Beaverton, OR
Lines: 54
Summary: cc -c -o useful for cross-compilation