diff options
author | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-05-02 06:48:07 (GMT) |
---|---|---|
committer | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-05-02 06:48:07 (GMT) |
commit | 315f7c42a1e9196e642cb46879b19ef16e449e2f (patch) | |
tree | fde9de00707597cae4b3e8f87beef3c2f0c7c465 /unix/tclUnixCompat.c | |
parent | 8bf5fdf9e1d9dc7f24b23a35f5a63633a376b8b7 (diff) | |
parent | c8d0757b584e31a9034fed03c3f0fae6e7d4b21a (diff) | |
download | tcl-315f7c42a1e9196e642cb46879b19ef16e449e2f.zip tcl-315f7c42a1e9196e642cb46879b19ef16e449e2f.tar.gz tcl-315f7c42a1e9196e642cb46879b19ef16e449e2f.tar.bz2 |
TclWinCPUID now respects -fPIC compilation on 32-bit Linux
Diffstat (limited to 'unix/tclUnixCompat.c')
-rw-r--r-- | unix/tclUnixCompat.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index 22573e4..09c8691 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -821,8 +821,13 @@ TclWinCPUID( int status = TCL_ERROR; #ifdef HAVE_CPUID - __asm__ __volatile__ ("cpuid":\ - "=a" (regsPtr[0]), "=b" (regsPtr[1]), "=c" (regsPtr[2]), "=d" (regsPtr[3]) : "a" (index)); + __asm__ __volatile__("pushl %%ebx \n\t" /* save %ebx */ + "cpuid \n\t" + "movl %%ebx, %1 \n\t" /* save what cpuid just put in %ebx */ + "popl %%ebx \n\t" /* restore the old %ebx */ + : "=a"(regsPtr[0]), "=r"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) + : "a"(index) + : "cc"); status = TCL_OK; #endif return status; |