X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-0.9 required=5.0	tests=AWL,BAYES_00,SPF_NEUTRAL
X-Spam-Check-By: sourceware.org
Message-ID: <4E695104.3030104@cs.utoronto.ca>
Date: Thu, 08 Sep 2011 19:34:28 -0400
From: Ryan Johnson <ryan.johnson@cs.utoronto.ca>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: [ANNOUNCEMENT] Updated: stable compiler package gcc4-4.5.3-2
References: <announce.4E60524C.2000401@gmail.com> <CAPw2spgAfEF-vLrWeoFTA28Xtt5WcvYS+mVqq9RUqi4CYk84rQ@mail.gmail.com> <4E68AA10.4070205@cs.utoronto.ca> <CAPw2spgdvGCJSBvcigsKhqoUnOinG2UGmN2jVg3qQxRvZ2uxjA@mail.gmail.com>
In-Reply-To: <CAPw2spgdvGCJSBvcigsKhqoUnOinG2UGmN2jVg3qQxRvZ2uxjA@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 08/09/2011 4:17 PM, Frédéric Bron wrote:
>> In my experience, these sorts of errors arise when there really is something
>> wrong with the code, usually involving sizes of integers (e.g. 'long' in
>> struct's definition and 'int' in another, on a 64-bit machine). However, the
>> linker is poorly-equipped to detect such errors unless the resulting objects
>> have different sizes.
>>
>> So, while I wouldn't rule out miscompilation, I would first check for
>> silently conflicting definitions in different compilation units.
> Does the linker message gives any hint on where to look?
Sort of... the error message mentions Test.o and the section 
`.rdata$_ZTISs'

You also presumably have the linker command line, which should tell you 
what other .o and .a are involved. Invoke `objdump -h' and pass as args 
all those .o/.a and examine the output. Most likely you'll see several 
files containing the offending section, and among those there are 
probably two distinct sizes reported. From there you have to work 
backwards to figure out what was different about #defines and #includes 
in the two source files that might have caused the discrepancy.

Top suspects: custom typedefs or #defines which confuse system headers, 
or including Windows headers which make superficially equivalent 
declarations (but which have completely different and incompatible 
implementations). Given that mingw doesn't complain my money's on the 
latter.

Ryan

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

