This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Does 'ar' work with native MS Windows libs?

On Tue, Oct 03, 2006 at 07:54:22AM -0700, Coatimundi wrote:
>Christopher Faylor wrote:
>>On Tue, Oct 03, 2006 at 07:10:50AM -0700, Coatimundi wrote:
>>>Christopher Faylor wrote:
>>>>On Mon, Oct 02, 2006 at 07:27:50PM -0700, Coatimundi wrote:
>>>>>I need to break open a library I created with Visual Studio and insert 
>>>>>some objects also compiled with Visual Studio.
>>>>>Will Cygwin's ar command work for this task?
>>>>Here's an idea: How about just *trying* it?
>>>Well, that's a good idea.  I did that before posting and found different 
>>>degrees of success with different libs.  Rather than potentially waste a 
>>>lot of good people's time, I asked for and received a quick up/down 
>>>indicator.  Thanks.
>>By not including the above information in your initial message and not
>>expounding on what is meant by "different degrees of success" you have
>>ended up not getting informed responses.
>>'ar' should operate on .lib files correctly.  If you have specific
>>problems then providing details would help you get non-speculative
>Thanks for your offer.  I've received several replies (mostly not to the 
>list).  Your second post in this thread is the first indication that 
>'ar' should work for lib files.  This is an encouraging development.
>The particulars may depend on code which I cannot distribute.  I hope 
>that is not the case, but I can try to cook up a clean example if 
>needed.  First, I should note that I just installed Cygwin on this box, 
>which happens to be an Opteron, so 'ar' should be up to date.
>The thing I noticed first was that 'ar vt libfoo.a' did not always list 
>all of the member names.  Some were present, some were missing. 
>(Linking with the lib unambiguously confirms that they're all there. 
>The total number of routines is about 20 in this small lib.)  So far I 
>have seen this effect only with libs compiled with debugging 
>information.  I have not noticed this problem with libs compiled without 
>debugging info.  This observation is anecdotal but enough to make me wonder.
>So I decided to extract a single object from the (non-debug-info) 
>libfoo.a with both Cygwin's ar and Microsoft's LIB.EXE.  The resulting 
>objects differed in byte-count, which I took (perhaps wrongly) as a 
>strong clue that I was headed in the wrong direction.
>I suppose it's possible that the format for individual objects might be 
>tool-dependent as long as each tool generates the same archive format. 
>So perhaps a better test would be to disassemble lib.a with one tool and 
>reassemble it with the other tool.
>I appreciate your thoughts on any of this.  Thanks for your time.

Sorry but without the actual libraries to inspect or some way of
duplicating the problem there really isn't much that can be done.
I guess that means you should stick with 'lib'.


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]