Add patch to enable PIC building #61947.
authorMike Frysinger <vapier@gentoo.org>
Mon, 3 Jan 2005 21:19:56 +0000 (21:19 +0000)
committerMike Frysinger <vapier@gentoo.org>
Mon, 3 Jan 2005 21:19:56 +0000 (21:19 +0000)
sys-apps/lshw/ChangeLog
sys-apps/lshw/Manifest
sys-apps/lshw/files/02.00b-cpuid-PIC.patch [new file with mode: 0644]
sys-apps/lshw/lshw-01.08a.ebuild
sys-apps/lshw/lshw-02.00b.ebuild

index 36634158c5a4c8e6c80e7c25e12cb58701276bb3..7698a0810796ed4d2e3346e69be1732f9745b44d 100644 (file)
@@ -1,6 +1,10 @@
 # ChangeLog for sys-apps/lshw
-# Copyright 2000-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/lshw/ChangeLog,v 1.14 2004/12/21 22:15:01 vapier Exp $
+# Copyright 2000-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/lshw/ChangeLog,v 1.15 2005/01/03 21:19:56 vapier Exp $
+
+  03 Jan 2005; Mike Frysinger <vapier@gentoo.org>
+  +files/02.00b-cpuid-PIC.patch, lshw-02.00b.ebuild:
+  Add patch to enable PIC building #61947.
 
   21 Dec 2004; Mike Frysinger <vapier@gentoo.org> +files/02.00b-dev.patch,
   lshw-02.00b.ebuild:
index c6c333e2c7b0e51e6dba5b450c4cb149426e5d69..57cd4d78180d297871b790db5e81b6b549d665ac 100644 (file)
@@ -1,17 +1,18 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-MD5 242921c01b041c560e9ec21b0631e7e8 ChangeLog 1942
+MD5 b7a72c0ae671b5df8b34233e9906878d ChangeLog 2089
 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
-MD5 fea04b0ccf82eff4d91ecbafe47eb94f lshw-02.00b.ebuild 1268
-MD5 55450766dcbdb9c47e7af10fa9f2ae1d lshw-01.08a.ebuild 845
+MD5 5d1af2dc380a1ddeb1bad345975c9b39 lshw-02.00b.ebuild 1317
+MD5 ce540accd76c671a5a31cabfe4b8832a lshw-01.08a.ebuild 845
 MD5 e1b0c289650e6fc413a9001627b004a0 files/02.00b-dev.patch 966
 MD5 078518c848aac3fcee935427f1849647 files/digest-lshw-02.00b 64
 MD5 7c020ad03172a84e510775b8a6b7d3ce files/digest-lshw-01.08a 64
+MD5 555b9015ffbcc8fd484c63ab096069d7 files/02.00b-cpuid-PIC.patch 1098
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.9.10 (GNU/Linux)
 
-iD8DBQFByKCDroRuSHgZdywRAvSgAKCNQ39Wn9no1fY2F0OZVodD7GuSFACePSUw
-TfXuKWx6OxFEBAKjY6J2oxI=
-=YrcT
+iD8DBQFB2bcWroRuSHgZdywRAisfAJ4jEnS/ORGU0nnjWAfF2nIFhEnuLQCeJgg2
+pjhyGo0NYYq5HHn+1Xzffp4=
+=a32T
 -----END PGP SIGNATURE-----
diff --git a/sys-apps/lshw/files/02.00b-cpuid-PIC.patch b/sys-apps/lshw/files/02.00b-cpuid-PIC.patch
new file mode 100644 (file)
index 0000000..1223660
--- /dev/null
@@ -0,0 +1,40 @@
+The 'cpuid' assembly instruction is notorious for hating PIC.
+
+Here we code two different versions of the cpuid instruction ...
+the first will work when dealing with PIC, while the second is 
+slightly faster and can be used with non-PIC.
+
+http://bugs.gentoo.org/show_bug.cgi?id=61947
+
+--- src/core/cpuid.cc.orig     2005-01-03 15:21:57.034862112 -0500
++++ src/core/cpuid.cc  2005-01-03 16:07:00.131928896 -0500
+@@ -68,9 +68,6 @@
+ 
+ #ifdef __i386__
+ 
+-#define cpuid_up(in,a,b,c,d)\
+-  asm("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (in));
+-
+ static void cpuid(int cpunumber,
+                 unsigned long idx,
+                 unsigned long &eax,
+@@ -96,7 +93,18 @@
+     edx = (*(unsigned long *) (buffer + 12));
+   }
+   else
+-    cpuid_up(idx, eax, ebx, ecx, edx);
++    asm(
++#ifdef __PIC__
++        "pushl %%ebx\n"
++        "cpuid\n"
++        "movl %%ebx,%3\n"
++        "popl %%ebx\n"
++        : "=a" (eax), "=c" (ecx), "=d" (edx), "=m" (ebx)
++#else
++        "cpuid\n"
++        : "=a" (eax), "=c" (ecx), "=d" (edx), "=b" (ebx)
++#endif
++        : "a" (idx));
+ }
+ 
+ /* Decode Intel TLB and cache info descriptors */
index 82fa0979622e39d5d14f3fb2629f562047421f1f..7ea3976c156c9e8904e5b4da3b707aae620a6ed1 100644 (file)
@@ -1,6 +1,6 @@
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/lshw/lshw-01.08a.ebuild,v 1.2 2004/12/20 15:44:26 matsuu Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/lshw/lshw-01.08a.ebuild,v 1.3 2005/01/03 21:19:56 vapier Exp $
 
 inherit flag-o-matic
 
index 76cda61f68174634938b27a5e7458b7bfbb6eafe..3f7a339d0f21437be08f0affc696872e7a7c3444 100644 (file)
@@ -1,6 +1,6 @@
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/lshw/lshw-02.00b.ebuild,v 1.2 2004/12/21 22:15:01 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/lshw/lshw-02.00b.ebuild,v 1.3 2005/01/03 21:19:56 vapier Exp $
 
 inherit flag-o-matic eutils toolchain-funcs
 
@@ -34,6 +34,7 @@ src_unpack() {
                || die "sed failed"
 
        epatch ${FILESDIR}/${PV}-dev.patch #75168
+       epatch ${FILESDIR}/${PV}-cpuid-PIC.patch #61947
 
        # cpuid.cc uses inline asm and can not be linked when
        # position independent code is desired.