X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=/QxibGXZID2Fn2BGqg1hG80mcw35cztu77mI01qVqEg=; b=Z31yoGDQmT+/1SRH53geV0fEitSyXtXKxOcg7E9OZjy+JGgQ5lQYt2Qp2qYI3hd048 2AK7SHNMwrmh1iDD5GsbuNEvLvM0lK4yvbsh5RSAMRdTyO50VEluwhmPcMb+R6/snTZD N5sbv6ZiSjHo/JXG72u8YiagmIS0QvB7v7sDU= MIME-Version: 1.0 In-Reply-To: <4EA6EFEB.2000803@iki.fi> References: <4ce51722-c2fd-4fe0-8cb9-ebae498c3271 AT r1g2000yqm DOT googlegroups DOT com> <83k47tc9u2 DOT fsf AT gnu DOT org> <4EA6EFEB DOT 2000803 AT iki DOT fi> Date: Wed, 26 Oct 2011 00:15:05 +0300 Message-ID: Subject: Re: _rdtsc(void) inline function in time.h - cause problem with multiple definition during linking From: Ozkan Sezer To: djgpp AT delorie DOT com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id p9PLF9JJ005409 Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, Oct 25, 2011 at 8:20 PM, Andris Pavenis wrote: > On 10/25/2011 07:33 PM, Ozkan Sezer wrote: >> >> On Tue, Oct 25, 2011 at 7:30 PM, Eli Zaretskii  wrote: >>>> >>>> From: RayeR >>>> Date: Tue, 25 Oct 2011 04:02:09 -0700 (PDT) >>>> >>>> during compiling large sources I run into troubles with multiple >>>> _rdtsc(void) definition during linking. The problem is caused when in >>>> 1st stage is compiled a library that includes time.h and then in 2nd >>>> stage is compiled main app that also includes time.h Because there is >>>> _rdtsc() code already in library linker got confused what to use. >>>> >>>> Do you think it should be fixed DJGPP time.h header to redefine >>>> >>>> extern __inline__ unsigned long long >>>> _rdtsc(void) >>>> { >>>>   unsigned long long result; >>>>   __asm__ __volatile__ ("rdtsc" : "=A"(result) ); >>>>   return result; >>>> } >>>> >>>> to static? >>> >>> Can you show the error messages you get? >>> >>> It is strange that you should get any errors at all: an inline >>> function is like a macro, it disappears without a trace in the >>> compiled object code, so the linker should not complain, because >>> there's no symbol corresponding to the function for it to see any >>> multiple definitions.  There simply should not be any definition at >>> all. >>> >>> Did you perhaps disable inlining, or compiled with some headers that >>> define away __inline__? >>> >> >> BTW, is the issue with 2.03 or 2.04?  IIRC, 2.04 had fix applied for this. > > Yes. But the fix is newer than the beta version from djgpp/beta/v2 as far as > I remember > > Perhaps it could be good time to release a new beta sometime. > That is a good idea. I've been using the snapshot from 2011-10-02 with success. I can provide packages (cross-built on linux) if required. > Andris > > -- O.S.