From: | "Matt Turner (mattst88)" <mattst88@g.o> |
---|---|
To: | gentoo-commits@l.g.o |
Subject: | [gentoo-commits] gentoo-x86 commit in sys-apps/cpuid/files: cpuid-20110305-fPIC.patch |
Date: | Sun, 31 Jul 2011 16:12:51 |
Message-Id: | 20110731161240.D90712004B@flycatcher.gentoo.org |
1 | mattst88 11/07/31 16:12:40 |
2 | |
3 | Added: cpuid-20110305-fPIC.patch |
4 | Log: |
5 | Fix compilation on x86/hardened (-fPIC flag), bug 376245. |
6 | |
7 | (Portage version: 2.1.10.3/cvs/Linux x86_64) |
8 | |
9 | Revision Changes Path |
10 | 1.1 sys-apps/cpuid/files/cpuid-20110305-fPIC.patch |
11 | |
12 | file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/cpuid/files/cpuid-20110305-fPIC.patch?rev=1.1&view=markup |
13 | plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/cpuid/files/cpuid-20110305-fPIC.patch?rev=1.1&content-type=text/plain |
14 | |
15 | Index: cpuid-20110305-fPIC.patch |
16 | =================================================================== |
17 | diff -u cpuid-20110305.orig//cpuid.c cpuid-20110305/cpuid.c |
18 | --- cpuid-20110305.orig//cpuid.c 2011-03-04 13:25:16.000000000 -0500 |
19 | +++ cpuid-20110305/cpuid.c 2011-07-31 01:53:39.647437813 -0400 |
20 | @@ -5319,9 +5319,20 @@ |
21 | boolean quiet) |
22 | { |
23 | if (cpuid_fd == USE_INSTRUCTION) { |
24 | +#if defined(__i386__) && defined(__PIC__) |
25 | + asm("push %%ebx\n" |
26 | + "cpuid\n" |
27 | + "movl %%ebx, %1\n" |
28 | + "pop %%ebx\n" |
29 | +#else |
30 | asm("cpuid" |
31 | +#endif |
32 | : "=a" (words[WORD_EAX]), |
33 | +#if defined(__i386__) && defined(__PIC__) |
34 | + "=r" (words[WORD_EBX]), |
35 | +#else |
36 | "=b" (words[WORD_EBX]), |
37 | +#endif |
38 | "=c" (words[WORD_ECX]), |
39 | "=d" (words[WORD_EDX]) |
40 | : "a" (reg), |