diff options
author | Matt Turner <mattst88@gentoo.org> | 2011-07-31 16:12:40 +0000 |
---|---|---|
committer | Matt Turner <mattst88@gentoo.org> | 2011-07-31 16:12:40 +0000 |
commit | af18b5be0b6a1c1f3cfa25a5f00ab23f5b82296d (patch) | |
tree | 385a954529047b2099c8c13ea37bf8ad0493d74a /sys-apps/cpuid | |
parent | Move libxml2 from RDEPEND to DEPEND, Bug 376015. (diff) | |
download | gentoo-2-af18b5be0b6a1c1f3cfa25a5f00ab23f5b82296d.tar.gz gentoo-2-af18b5be0b6a1c1f3cfa25a5f00ab23f5b82296d.tar.bz2 gentoo-2-af18b5be0b6a1c1f3cfa25a5f00ab23f5b82296d.zip |
Fix compilation on x86/hardened (-fPIC flag), bug 376245.
(Portage version: 2.1.10.3/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/cpuid')
-rw-r--r-- | sys-apps/cpuid/cpuid-20110305.ebuild | 3 | ||||
-rw-r--r-- | sys-apps/cpuid/files/cpuid-20110305-fPIC.patch | 24 |
2 files changed, 26 insertions, 1 deletions
diff --git a/sys-apps/cpuid/cpuid-20110305.ebuild b/sys-apps/cpuid/cpuid-20110305.ebuild index 317bfcf2d095..76204bc93588 100644 --- a/sys-apps/cpuid/cpuid-20110305.ebuild +++ b/sys-apps/cpuid/cpuid-20110305.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/cpuid/cpuid-20110305.ebuild,v 1.2 2011/07/23 15:28:56 tomka Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/cpuid/cpuid-20110305.ebuild,v 1.3 2011/07/31 16:12:40 mattst88 Exp $ EAPI="4" @@ -18,6 +18,7 @@ IUSE="" src_prepare() { epatch "${FILESDIR}"/${P}-Makefile.patch + epatch "${FILESDIR}"/${P}-fPIC.patch #376245 } src_compile() { diff --git a/sys-apps/cpuid/files/cpuid-20110305-fPIC.patch b/sys-apps/cpuid/files/cpuid-20110305-fPIC.patch new file mode 100644 index 000000000000..80cc6774a188 --- /dev/null +++ b/sys-apps/cpuid/files/cpuid-20110305-fPIC.patch @@ -0,0 +1,24 @@ +diff -u cpuid-20110305.orig//cpuid.c cpuid-20110305/cpuid.c +--- cpuid-20110305.orig//cpuid.c 2011-03-04 13:25:16.000000000 -0500 ++++ cpuid-20110305/cpuid.c 2011-07-31 01:53:39.647437813 -0400 +@@ -5319,9 +5319,20 @@ + boolean quiet) + { + if (cpuid_fd == USE_INSTRUCTION) { ++#if defined(__i386__) && defined(__PIC__) ++ asm("push %%ebx\n" ++ "cpuid\n" ++ "movl %%ebx, %1\n" ++ "pop %%ebx\n" ++#else + asm("cpuid" ++#endif + : "=a" (words[WORD_EAX]), ++#if defined(__i386__) && defined(__PIC__) ++ "=r" (words[WORD_EBX]), ++#else + "=b" (words[WORD_EBX]), ++#endif + "=c" (words[WORD_ECX]), + "=d" (words[WORD_EDX]) + : "a" (reg), |