From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,942afaf287eebe84 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2002-04-13 22:38:46 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!sn-xit-01!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Sender: paul@salmon.parasoft.com Newsgroups: comp.unix.tru64 Subject: Re: Strange ld behavior in versions 4.0F and above References: <3CB75DF0.773FA9FB@Mnetcabo.pt> From: Paul Pluzhnikov User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence) Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 14 Apr 2002 05:38:44 GMT NNTP-Posting-Host: 24.205.81.188 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1018762724 24.205.81.188 (Sat, 13 Apr 2002 22:38:44 PDT) NNTP-Posting-Date: Sat, 13 Apr 2002 22:38:44 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.unix.tru64:7278 Fernando Nunes writes: > cc -o test test.c > > You'll get an obviously message from the linker saying that there are > unresolved symbols. > > The point is you'll have a "test" file (without execution permission) > hanging around. > This has a nasty effect if you're using the make utility because if by > mistake you repeat the make process it will skip the "test" compilation > because the file will be there (although it's completly useless). > > Does this have a logical explanation? Is there any compilation/linker > flag that will avoid this? Is it some kind of bug? I do not know if there is an explanation for this, but I have seen more than one system with such 'ld' behaviour ... I think Irix ld does this as well. Presumably 'ld' designers thought the "half-cooked" ld output is good for something. It probably *is* good for debugging 'ld' itself ... The Makefile workarounds I have often encountered: $(EXE): $(OBJS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) || $(RM) $@ or $(EXE): $(OBJS) $(CC) $(CFLAGS) -o tmp.$@ $(OBJS) $(LIBS) && $(MV) tmp.$@ $@ Cheers,