From 7001c6d388093cfb1f1630fc9aef007569c9b5e8 Mon Sep 17 00:00:00 2001 From: weidai Date: Mon, 5 Jul 2004 21:49:50 +0000 Subject: [PATCH] fix for -fPIC --- integer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/integer.cpp b/integer.cpp index 79214a24..503ba268 100644 --- a/integer.cpp +++ b/integer.cpp @@ -876,8 +876,9 @@ static void CpuId(word32 input, word32 *output) #ifdef __GNUC__ __asm__ ( - "cpuid" - : "=a" (output[0]), "=b" (output[1]), "=c" (output[2]), "=d" (output[3]) + // save ebx in case -fPIC is being used + "push %%ebx; cpuid; mov %%ebx, %%edi; pop %%ebx" + : "=a" (output[0]), "=D" (output[1]), "=c" (output[2]), "=d" (output[3]) : "a" (input) ); #else