summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/x86info')
-rw-r--r--sys-apps/x86info/Manifest1
-rw-r--r--sys-apps/x86info/files/1.21-pic.patch15
-rw-r--r--sys-apps/x86info/files/x86info-1.24-pic.patch33
-rw-r--r--sys-apps/x86info/files/x86info-1.29-parallel-make-cleanup.patch13
-rw-r--r--sys-apps/x86info/files/x86info-modules.conf-rc9
-rw-r--r--sys-apps/x86info/metadata.xml8
-rw-r--r--sys-apps/x86info/x86info-1.30.ebuild62
7 files changed, 141 insertions, 0 deletions
diff --git a/sys-apps/x86info/Manifest b/sys-apps/x86info/Manifest
new file mode 100644
index 000000000000..e138b652a433
--- /dev/null
+++ b/sys-apps/x86info/Manifest
@@ -0,0 +1 @@
+DIST x86info-1.30.tgz 95727 RMD160 38a5502d4364b45fcf610bbbdf7ac4e0d05cf498 SHA1 a5c63b1f4b2bf70db0919316198f6871d940fc0c SHA256 fe3009850e93a9c5fa38ed6bf74d72686043329fead8f1b2be4b5943d4fc9428
diff --git a/sys-apps/x86info/files/1.21-pic.patch b/sys-apps/x86info/files/1.21-pic.patch
new file mode 100644
index 000000000000..ddf24b293e14
--- /dev/null
+++ b/sys-apps/x86info/files/1.21-pic.patch
@@ -0,0 +1,15 @@
+diff -Nuar x86info-1.21.orig/bench/benchmarks.c x86info-1.21/bench/benchmarks.c
+--- x86info-1.21.orig/bench/benchmarks.c 2007-11-26 17:53:58.278467889 -0800
++++ x86info-1.21/bench/benchmarks.c 2007-11-26 17:54:32.014318066 -0800
+@@ -19,7 +19,10 @@
+ #ifdef __linux__
+ TIME(asm volatile("int $0x80" :"=a" (tmp) :"0" (__NR_getppid)), "int 0x80");
+ #endif
+- TIME(asm volatile("cpuid": : :"ax", "dx", "cx", "bx"), "cpuid");
++ TIME(asm volatile("movl %%ebx,%%edi\n"
++ "cpuid\n"
++ "movl %%edi,%%ebx\n"
++ : : :"%eax", "%edx", "%ecx", "%edi"), "cpuid");
+
+ TIME(asm volatile("addl $1,0(%esp)"), "addl");
+ TIME(asm volatile("lock ; addl $1,0(%esp)"), "locked add");
diff --git a/sys-apps/x86info/files/x86info-1.24-pic.patch b/sys-apps/x86info/files/x86info-1.24-pic.patch
new file mode 100644
index 000000000000..5cbd3a586f8e
--- /dev/null
+++ b/sys-apps/x86info/files/x86info-1.24-pic.patch
@@ -0,0 +1,33 @@
+http://bugs.gentoo.org/270388
+
+--- cpuid.c
++++ cpuid.c
+@@ -62,12 +62,28 @@
+ sched_setaffinity(getpid(), sizeof(set), &set);
+ }
+
++#ifdef __PIC__
++ /* GCC on i386 bitches if you clobber ebx. So hide it behind
++ * gcc's back. */
++ asm(
++ "movl %%ebx,%%edi\n"
++ "cpuid\n"
++ "movl %%ebx,%1\n"
++ "movl %%edi,%%ebx\n"
++ : "=a" (a),
++ "=m" (b),
++ "+c" (c),
++ "=d" (d)
++ : "0" ((unsigned int)idx)
++ : "edi");
++#else
+ asm("cpuid"
+ : "=a" (a),
+ "=b" (b),
+ "+c" (c),
+ "=d" (d)
+ : "0" ((unsigned int)idx));
++#endif
+
+ if (eax!=NULL)
+ *eax = a;
diff --git a/sys-apps/x86info/files/x86info-1.29-parallel-make-cleanup.patch b/sys-apps/x86info/files/x86info-1.29-parallel-make-cleanup.patch
new file mode 100644
index 000000000000..54208cab0843
--- /dev/null
+++ b/sys-apps/x86info/files/x86info-1.29-parallel-make-cleanup.patch
@@ -0,0 +1,13 @@
+diff -Nuar x86info-1.29.orig/Makefile x86info-1.29/Makefile
+--- x86info-1.29.orig/Makefile 2011-04-05 22:54:04.000000000 +0000
++++ x86info-1.29/Makefile 2011-05-15 18:19:42.204228978 +0000
+@@ -12,7 +12,8 @@
+ LSMSR_TMP_HEADERS=AMD/k8.h AMD/fam10h.h AMD/fam11h.h generic_msr.h
+
+ %.h: %.regs scripts/createheader.py
+- python scripts/createheader.py $< `basename $< .regs` >$@
++ python scripts/createheader.py $< `basename $< .regs` >$@.tmp ; \
++ mv $@.tmp $@
+
+ LSMSR_SRC = \
+ lsmsr.c \
diff --git a/sys-apps/x86info/files/x86info-modules.conf-rc b/sys-apps/x86info/files/x86info-modules.conf-rc
new file mode 100644
index 000000000000..58f112007202
--- /dev/null
+++ b/sys-apps/x86info/files/x86info-modules.conf-rc
@@ -0,0 +1,9 @@
+# $Id$
+#
+# Aliases needed for x86info to probe data
+# these are so the modules auto-load as needed
+#
+alias char-major-202 msr
+alias char-major-203 cpuid
+alias /dev/cpu/*/msr msr
+alias /dev/cpu/*/cpuid cpuid
diff --git a/sys-apps/x86info/metadata.xml b/sys-apps/x86info/metadata.xml
new file mode 100644
index 000000000000..e2a0d741c0f6
--- /dev/null
+++ b/sys-apps/x86info/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <maintainer>
+ <email>robbat2@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/x86info/x86info-1.30.ebuild b/sys-apps/x86info/x86info-1.30.ebuild
new file mode 100644
index 000000000000..15eb5d9c3909
--- /dev/null
+++ b/sys-apps/x86info/x86info-1.30.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit eutils flag-o-matic linux-info toolchain-funcs
+
+DESCRIPTION="Dave Jones' handy, informative x86 CPU diagnostic utility"
+HOMEPAGE="http://www.codemonkey.org.uk/projects/x86info/"
+SRC_URI="http://www.codemonkey.org.uk/projects/x86info/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE=""
+
+RDEPEND="sys-apps/pciutils"
+DEPEND="${RDEPEND}"
+
+CONFIG_CHECK="~MTRR ~X86_CPUID"
+
+src_prepare() {
+ epatch "${FILESDIR}"/1.21-pic.patch
+ epatch "${FILESDIR}"/${PN}-1.24-pic.patch #270388
+ epatch "${FILESDIR}"/${PN}-1.29-parallel-make-cleanup.patch
+}
+
+src_compile() {
+ # These flags taken from the 1.29 ebuild
+ append-flags -Wall -Wshadow -Wextra -Wmissing-declarations -Wdeclaration-after-statement -Wredundant-decls
+ append-ldflags -Wl,-z,relro,-z,now
+ emake x86info lsmsr \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS} ${CPPFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ || die "emake failed"
+}
+
+src_install() {
+ dobin x86info lsmsr || die
+
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/x86info-modules.conf-rc x86info.conf
+
+ dodoc TODO README
+ doman x86info.1 lsmsr.8
+ insinto /usr/share/doc/${PF}
+ doins -r results
+ prepalldocs
+}
+
+pkg_preinst() {
+ if [ -a "${ROOT}"/etc/modules.d/x86info ] && [ ! -a "${ROOT}"/etc/modprobe.d/x86info ] ; then
+ elog "Moving x86info from /etc/modules.d/ to /etc/modprobe.d/"
+ mv "${ROOT}"/etc/{modules,modprobe}.d/x86info
+ fi
+ if [ -a "${ROOT}"/etc/modprobe.d/x86info ] && [ ! -a "${ROOT}"/etc/modprobe.d/x86info.conf ] ; then
+ elog "Adding .conf suffix to x86info in /etc/modprobe.d/"
+ mv "${ROOT}"/etc/modprobe.d/x86info{,.conf}
+ fi
+}