[Python-Dev] --with-tsc compile fails (original) (raw)

Michael Hudson mwh at python.net
Wed Sep 15 15:51:55 CEST 2004


Jeremy Hylton <jhylton at gmail.com> writes:

I'm feeling pretty out of it :-). I'm very happy to see that the Pentium tsc patch made it into the core; I had missed it. I'm amused that the Pentium tsc patch works for PPC, too.

I did consider changing all the names but couldn't be bothered.

Anyway, I tried to use it this evening and the compilation failed:

../Python/ceval.c:50:21: asm/msr.h: No such file or directory ../Python/ceval.c: In function PyEvalEvalFrame':_ _../Python/ceval.c:575: warning: implicit declaration of function rdtscll' ../Python/ceval.c:572: warning: inst0' might be used uninitialized in_ _this function_ _../Python/ceval.c:572: warning: inst1' might be used uninitialized in this function ../Python/ceval.c:572: warning: loop0' might be used uninitialized in_ _this function_ _../Python/ceval.c:572: warning: loop1' might be used uninitialized in this function It sounds like <asm/msr.h> is for Microsoft platforms, but I'm building on Linux. Perhaps the change to add PPC support screwed up the ifdefs that were detecting a Windows compile?

Well, it failed like that for me both before and after my PPC changes. I'm fairly sure I didn't mess this up. Maybe there's some kernel-headers package that's necessary.

OTOH, I think one could replace the include by

#define rdtscll(val)
asm volatile("rdtsc" : "=A" (val))

if my limited googling is anything to go by. It also seems asm/msr.h is a "kernel internal header with absolutely no stable API properties...." (Redhat bugzilla).

So, now I've written this email , I think we should take out the include and put in the #define.

Anyone who cares about, e.g., Windows can find out how to make their compiler do this.

Cheers, mwh

-- Presumably pronging in the wrong place zogs it. -- Aldabra Stoddart, ucam.chat



More information about the Python-Dev mailing list