minires-0.95 - a new package ready for review

Nicholas Wourms nwourms@netscape.net
Wed Nov 19 23:31:00 GMT 2003


Pierre Humblet wrote:

> 
> Nicholas Wourms wrote:
> 
> 
>>>I am not sure if this addresses the problem at hand.
>>>There IS and include file with #define foo __foo
>>>but configure runs in a problem when it calls foo() without including
>>>said include file. Thus we would like to have both __foo and foo.
>>
>>Noooooo, you have to do it in the library source file, not the header,
>>that way the symbol is properly generated in the library dll.  This is
>>quite similar to the way cygwin.din maps some symbols to underscore
>>aliases (or visa-versa).
> 
> 
> Yep, but the bind people have already done it in the header.
> (not sure why).
> I could simply add #ifdef __CYGWIN__  to remove that feature.
> But then I will loose binary compatibility between versions.
> Is there a perfect solution?

Pierre,

Sorry for the noise, I was wrong.  I had a brainfart and forgot that ld 
doesn't actually export the #define'd symbols in sourcefiles to dlls.

Ironically, this will compile:

int __foo {
   printf("foo\r\n");
   return 0;
}
int foo __attribute__ ((alias("__foo"));

and produce a dll exporting both `__foo` and `foo`.

Unfortunately, however, any exe compiled against it will auto-import 
_foo and segfault in crt0 when run :-(.  Oh well...

Cheers,
Nicholas



More information about the Cygwin-apps mailing list