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=J6LG9/JWvbQNcDNjVIUnuilx5WpgCoxmDyvydJHzZyc=; b=ANIkSgCQpVQ/mswxWvRbaBHq3JZv73yzogJyzSy94xnZc3rWwjw7dhl5xDLnwBIdJ/ TpCSCAq7pO/ZJuoYlNYIKI84XcT4gh5FrcWRrCQLoKUb4lJBSFnHVgLI1E+Szk6ck5ZF DzuO96eVkh37J/bO6r8HaoRAu196NTIsEEpgs= MIME-Version: 1.0 In-Reply-To: References: <4ce51722-c2fd-4fe0-8cb9-ebae498c3271 AT r1g2000yqm DOT googlegroups DOT com> <83k47tc9u2 DOT fsf AT gnu DOT org> <65da0e3d-29ea-46ae-b23d-ae08652594aa AT a17g2000yqj DOT googlegroups DOT com> <0a80c084-8135-4c4d-a25c-b56f3eb41e36 AT y36g2000yqm DOT googlegroups DOT com> Date: Wed, 26 Oct 2011 16:29:07 +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 p9QDTDM6014729 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 Wed, Oct 26, 2011 at 3:40 PM, RayeR wrote: > I removed the source of error but i tried to simulate it by including > time.h in 2 modules. > The error looked like this: > > gcc -o x264.exe x264.o input/input.o input/timecode.o input/raw.o > input/y4m.o ou > tput/raw.o output/matroska.o output/matroske.o output/flv.o output/ > flv_byte.o fi > lters/filters.o filters/video/video.o filters/video/source.o filters/ > video/inter > nal.o filters/video/resize.o filters/video/cache.o filters/video/ > fix_vfr_.o filt > ers/video/select_e.o filters/video/crop.o filters/video/depth.o extras/ > getopt.o > libx264.a  -lm > libx264.a(macroblo.o):macroblo.c:(.text+0xaf0): multiple definition of > `__rdtsc' > > x264.o:x264.c:(.text+0x7130): first defined here > collect2: ld returned 1 exit status > make.exe: *** [x264.exe] Error 1 The problem is with changed inline semantics. Juan's fix in recent 2.04 is to use EXTERN_INLINE for _rdtsc, with EXTERN_INLINE being defined like: /* Ensure that always traditional GNU extern inline semantics are used (aka -fgnu89-inline) even if ISO C99 semantics have been specified. */ #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) # define _EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__)) #else # define _EXTERN_INLINE extern __inline__ #endif > > But yeah, thanks to Ozkan Sezer when I tried to rebuild this test case > with new djdev 2.04 > package the error disappeared - thanks! BTW why not to upload this > package to /beta or /alpha > on DJ's site? Maintainers should decide and do that > There seems to be some development of djdev but it may > be hidden to other users. > Well, yes... > BTW Ozkan, you're author of new Hexen engine? Good work! > Yep. Thanks. -- O.S.