www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2013/01/11/11:52:15

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
Message-ID: <50F0432D.3060108@iki.fi>
Date: Fri, 11 Jan 2013 18:51:57 +0200
From: Andris Pavenis <andris DOT pavenis AT iki DOT fi>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: gcc-4.8.0 and DJGPP time.h
Reply-To: djgpp-workers AT delorie DOT com

GCC-4.8.0 now defines macro _rdtsc which actually maps to __builtin_ia32_rdtsc().
Macro is defined in file ia32intrin.h (gcc/config/i386/ia32intrin.h in sources,
would go to directory lib/gcc/djgpp/4.80/include for DJGPP). This file must however
be included indirectly through x86intrin.h

The result is a conflict when building libstdc++-v3 and most likely when using it.

I would suggest to include x86intrin.h from time.h instead of defining _rdtsc
there. All symbols defined by ia32intrin.h are prefixed with one or two '_',
so there should hopefully be no namespace pollution.

It would look like

#if ((__GNUC__==4 && __GNUC_MINOR__>=8) || (__GNUC__>4))
#include <x86intrin.h>
#else

current definitions of _rdtsc goes here

#endif

Does such approach look OK?

Andris

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019