http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51059

--- Comment #8 from Iain Sandoe <iains at gcc dot gnu.org> 2011-11-11 20:37:39 
UTC ---
and ... to answer Nathan's question:

Darwin's weak works the way you expect -- however the symbol does have to be
present at link time.

So - one would construct a dylib:

foo.dylib:
extern __inline int Foo ();
__inline int Foo ()
{
  return 0; /* count(-) */
}

build that:
gcc ../tests/foo-dylib.c -dynamiclib  -o foo.dylib

link with it...

gcc ../tests/call-foo-main.c foo.dylib -o cf

then the dylib is removed .. 
rm foo.dylib

and ./cf behaves as you would expect (it refers to foo.dylib - but is happy for
it to be omitted).

... however, that's a bit long-winded for this case.

Reply via email to