Subject: Re: under cygwin, zsh cannot run when built against ncurses9-5.7-13
From: "A.R. Burgers" <[email-masked]>
To: [email-masked]
Date: Mon, 16 Mar 2009 19:58:18 +0100
Newsgroups: gmane.os.cygwin
List-Id: <cygwin.cygwin.com>

Any special reason for specifying -lm and -lc when building d3.dll?
Without them, pow is mentioned only once in the objdump output. However 
on 1.5 pow is mentioned only once, even if -lm and -lc
are specified.

The exact same problem as with zsh, I also run into with fltk's 
fluid.exe (from current 1.3 svn) on cygwin 1.7 and gcc 3.4.4.
fltk btw does not link to curses libraries.

Teun

Peter A. Castro schreef:

> On Sun, 15 Mar 2009, Dave Korn wrote:
> 
> Hi Dave!
> 
>> Peter A. Castro wrote:
>>
>>>   Using the Dependency Walker tool that Chuck pointed out (thanks
>>> Chuck!)
>>
>>  No problem, Basil!
> 
> "Basil!"  I love it! (you know I was just kidding! :-)
> 
>>> Could this really be a linker problem?
>>
>>  If it's not a linker problem, it has to be a faulty import library.  
>> I can't
>> think of any other option that would explain how that import table got 
>> munged
>> like that.  I'll see if I can reproduce it.
> 
> I've been extracting modules from the import libs and dumping
> import/export symbols from the two libncurses DLLs, but I can't seem to
> find anything that looks wrong.
> 
> However... this I find strange:
> 
> file d3.c:
> ----------------------------------------------------------------
> #include <math.h>
> 
> double my_pow( double d1, double d2 )
> {
>   double d;
>   d = pow(d1,d2);
>   return d;
> }
> ----------------------------------------------------------------
> 
> $ gcc -g -shared -o d3.dll d3.c -lm -lc
> $ objdump -x d3.dll
> 
> ...
> There is an import table in .idata at 0x10004000
> 
> The Import Tables (interpreted .idata section contents)
>  vma:            Hint    Time      Forward  DLL       First
>                  Table   Stamp     Chain    Name      Thunk
>  00004000       00004050 00000000 00000000 0000416c 00004084
> 
>         DLL Name: cygwin1.dll
>         vma:  Hint/Ord Member-Name Bound-To
>         40b8      351  _impure_ptr
>         40c8      720  calloc
>         40d4      779  cygwin_detach_dll
>         40e8      781  cygwin_internal
>         40fc      802  dll_dllcrt0
>         410c      917  free
>         4114     1186  malloc
>         4120     1395  realloc
>         412c     1285  pow
> 
>  00004014       00004070 00000000 00000000 0000416c 000040a4
> 
>         DLL Name: cygwin1.dll
>         vma:  Hint/Ord Member-Name Bound-To
>         412c     1285  pow
> 
>  00004028       0000407c 00000000 00000000 0000417c 000040b0
> 
>         DLL Name: KERNEL32.dll
>         vma:  Hint/Ord Member-Name Bound-To
>         4134      337  GetModuleHandleA
> 
>  0000403c       00000000 00000000 00000000 00000000 00000000
> ...
> 
> 
> Why is 'pow' being pulled in twice?  Maybe it's really the math lib stuff
> that's tickling the linker?  This is kinda looking more like some linker
> bug.  Again, I'm not sure where to go next.  It's been a while since I
> dug into gcc...
> 
>>    cheers,
>>      DaveK
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/