Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: Paul Pluzhnikov <ppluzhnikov@earthlink.net>
Subject: Re: Strange ld behavior in versions 4.0F and above
Date: Sun, 14 Apr 2002 05:38:44 GMT	[thread overview]
Message-ID: <m3k7ra51si.fsf@salmon.parasoft.com> (raw)
In-Reply-To: 3CB75DF0.773FA9FB@Mnetcabo.pt

Fernando Nunes <fernando.nunesNOSP@Mnetcabo.pt> 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,


  reply	other threads:[~2002-04-14  5:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-12 22:21 Strange ld behavior in versions 4.0F and above Fernando Nunes
2002-04-14  5:38 ` Paul Pluzhnikov [this message]
2002-04-16 22:33 ` Joe Mario
2002-04-21  0:07   ` Paul Pluzhnikov
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox