X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Coatimundi Subject: Re: Does 'ar' work with native MS Windows libs? Date: Tue, 03 Oct 2006 07:54:22 -0700 Lines: 54 Message-ID: References: <20061003110319 DOT GA27817 AT trixie DOT casa DOT cgf DOT cx> <20061003142402 DOT GA31259 AT trixie DOT casa DOT cgf DOT cx> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) In-Reply-To: <20061003142402.GA31259@trixie.casa.cgf.cx> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk 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 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 > responses. > > cgf > 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. -- 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/