X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=1.2 required=5.0 tests=AWL,BAYES_50,SARE_BAYES_5x8,SARE_BAYES_6x8,TVD_RCVD_IP X-Spam-Check-By: sourceware.org Date: Fri, 20 Mar 2009 22:38:36 -0700 (PDT) From: "Peter A. Castro" To: "A.R. Burgers" cc: Cygwin List Subject: Re: under cygwin, zsh cannot run when built against ncurses9-5.7-13 In-Reply-To: <49BEA14A.6020905@quicknet.nl> Message-ID: References: <20a807210903131414g62e0a53cyefd3938c3fe8af33 AT mail DOT gmail DOT com> <49BADAC1 DOT 80709 AT cwilson DOT fastmail DOT fm> <49BD16E3 DOT 3090506 AT gmail DOT com> <49BEA14A DOT 6020905 AT quicknet DOT nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Mon, 16 Mar 2009, A.R. Burgers wrote: > Any special reason for specifying -lm and -lc when building d3.dll? Umm...because math functions historically come from lib"m" and the normal C runtime historically comes from lib"c". And, anyways, this has always worked, up 'til now, and there was no notice that these libs should not be used anymore? > 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. Yes, which means something is likely wrong with the import libs, but what I'm not sure. And, from followup email from DaveK it seems he's discovered the import libs are incorrect in some strange fashion. > 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. Hmm...well, misery loves company :-) > > 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 >> >> 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/ > -- Peter A. Castro or "Cats are just autistic Dogs" -- Dr. Tony Attwood -- 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/