Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/x86info/, sys-apps/x86info/files/
Date: Mon, 29 Jun 2020 12:33:27
Message-Id: 1593433982.560917f09c1e92a5f7504ab2b2cb05dba1b111c4.soap@gentoo
1 commit: 560917f09c1e92a5f7504ab2b2cb05dba1b111c4
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 29 12:33:02 2020 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 29 12:33:02 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=560917f0
7
8 sys-apps/x86info: [QA] Fix various issues
9
10 Package-Manager: Portage-2.3.103, Repoman-2.3.23
11 Signed-off-by: David Seifert <soap <AT> gentoo.org>
12
13 sys-apps/x86info/files/x86info-1.30-makefile.patch | 58 ++++++++++++++++++++++
14 sys-apps/x86info/files/x86info-1.30-pic.patch | 31 ++++++++++++
15 sys-apps/x86info/x86info-1.30_p20190617.ebuild | 16 +++---
16 3 files changed, 95 insertions(+), 10 deletions(-)
17
18 diff --git a/sys-apps/x86info/files/x86info-1.30-makefile.patch b/sys-apps/x86info/files/x86info-1.30-makefile.patch
19 new file mode 100644
20 index 00000000000..e1377c572fb
21 --- /dev/null
22 +++ b/sys-apps/x86info/files/x86info-1.30-makefile.patch
23 @@ -0,0 +1,58 @@
24 +--- a/lsmsr/Makefile
25 ++++ b/lsmsr/Makefile
26 +@@ -40,7 +40,8 @@
27 + generic_msr.h
28 +
29 + %.h: %.regs createheader.py
30 +- @python createheader.py $< `basename $< .regs` >$@
31 ++ $(PYTHON) createheader.py $< `basename $< .regs` >$@.tmp ; \
32 ++ mv $@.tmp $@
33 +
34 + LSMSR_SRC = \
35 + lsmsr.c \
36 +--- a/Makefile
37 ++++ b/Makefile
38 +@@ -2,7 +2,7 @@
39 +
40 + CFLAGS = -DVERSION="$(VERSION)"
41 +
42 +-CFLAGS += -Wall -W -g -O2 -D_FORTIFY_SOURCE=2 -I. -Iinclude
43 ++CFLAGS += -Wall -W -I. -Iinclude
44 + ifneq ($(SYSROOT),)
45 + CFLAGS += --sysroot=$(SYSROOT)
46 + endif
47 +@@ -33,14 +33,8 @@
48 + CPP_MAJOR := $(shell $(CPP) -dumpversion 2>&1 | cut -d'.' -f1)
49 + CPP_MINOR := $(shell $(CPP) -dumpversion 2>&1 | cut -d'.' -f2)
50 + DEVEL := $(shell grep VERSION Makefile | head -n1 | grep pre | wc -l)
51 +-CFLAGS += $(shell if [ $(CPP_MAJOR) -eq 6 -a $(CPP_MINOR) -ge 3 -a $(DEVEL) -eq 1 ] ; then echo "-Werror"; else echo ""; fi)
52 +
53 +-LDFLAGS = -Wl,-z,relro,-z,now
54 +-LDFLAGS += $(shell pkg-config --libs libpci)
55 +-
56 +-ifeq ($(CC),"")
57 +-CC = gcc
58 +-endif
59 ++LIBS += $(shell pkg-config --libs libpci)
60 +
61 + ifdef STATIC_LIBPCI
62 + LIBPCI = -Wl,-Bstatic -lpci -Wl,-Bdynamic -lz
63 +@@ -68,15 +62,15 @@
64 + $(sort $(patsubst %.c,%.o,$(wildcard vendors/*/*.c)))
65 +
66 + x86info: $(X86INFO_OBJS) $(X86INFO_HEADERS)
67 +- $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o x86info $(X86INFO_OBJS) \
68 +- $(LIBPCI)
69 ++ $(CC) $(CFLAGS) $(LDFLAGS) -o x86info $(X86INFO_OBJS) \
70 ++ $(LIBPCI) $(LIBS)
71 +
72 + DEPDIR= .deps
73 + -include $(X86INFO_SRC:%.c=$(DEPDIR)/%.d)
74 + df = $(DEPDIR)/$(*D)/$(*F)
75 +
76 + %.o : %.c
77 +- $(QUIET_CC)$(CC) $(CFLAGS) -o $@ -c $<
78 ++ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
79 + @mkdir -p $(DEPDIR)/$(*D)
80 + @$(CC) -MM $(CFLAGS) $*.c > $(df).d
81 + @mv -f $(df).d $(df).d.tmp
82
83 diff --git a/sys-apps/x86info/files/x86info-1.30-pic.patch b/sys-apps/x86info/files/x86info-1.30-pic.patch
84 new file mode 100644
85 index 00000000000..6288846b48b
86 --- /dev/null
87 +++ b/sys-apps/x86info/files/x86info-1.30-pic.patch
88 @@ -0,0 +1,31 @@
89 +--- a/cpuid.c
90 ++++ b/cpuid.c
91 +@@ -25,12 +25,28 @@
92 +
93 + bind_cpu(cpunr);
94 +
95 ++#ifdef __PIC__
96 ++ /* GCC on i386 bitches if you clobber ebx. So hide it behind
97 ++ * gcc's back. */
98 ++ asm(
99 ++ "movl %%ebx,%%edi\n"
100 ++ "cpuid\n"
101 ++ "movl %%ebx,%1\n"
102 ++ "movl %%edi,%%ebx\n"
103 ++ : "=a" (a),
104 ++ "=m" (b),
105 ++ "+c" (c),
106 ++ "=d" (d)
107 ++ : "0" ((unsigned int)idx)
108 ++ : "edi");
109 ++#else
110 + asm("cpuid"
111 + : "=a" (a),
112 + "=b" (b),
113 + "+c" (c),
114 + "=d" (d)
115 + : "0" ((unsigned int)idx));
116 ++#endif
117 +
118 + if (eax!=NULL)
119 + *eax = a;
120
121 diff --git a/sys-apps/x86info/x86info-1.30_p20190617.ebuild b/sys-apps/x86info/x86info-1.30_p20190617.ebuild
122 index d8a3b48dfad..add19ae6a60 100644
123 --- a/sys-apps/x86info/x86info-1.30_p20190617.ebuild
124 +++ b/sys-apps/x86info/x86info-1.30_p20190617.ebuild
125 @@ -1,9 +1,9 @@
126 -# Copyright 1999-2017 Gentoo Foundation
127 +# Copyright 1999-2020 Gentoo Authors
128 # Distributed under the terms of the GNU General Public License v2
129
130 EAPI=7
131
132 -PYTHON_COMPAT=( python2_7 python3_{4..8} )
133 +PYTHON_COMPAT=( python3_{6..8} )
134
135 inherit flag-o-matic linux-info python-any-r1 toolchain-funcs
136
137 @@ -16,21 +16,17 @@ SRC_URI="https://github.com/kernelslacker/x86info/archive/${COMMIT}.tar.gz -> ${
138 LICENSE="GPL-2"
139 SLOT="0"
140 KEYWORDS="-* ~amd64 ~x86"
141 -IUSE=""
142
143 RDEPEND="sys-apps/pciutils:="
144 -DEPEND="
145 - ${PYTHON_DEPS}
146 - ${RDEPEND}"
147 +DEPEND="${RDEPEND}"
148 +BDEPEND="${PYTHON_DEPS}"
149
150 CONFIG_CHECK="~MTRR ~X86_CPUID"
151 S="${WORKDIR}/${PN}-${COMMIT}"
152
153 PATCHES=(
154 - #"${FILESDIR}"/1.21-pic.patch
155 - "${FILESDIR}"/${PN}-1.24-pic.patch #270388
156 - #"${FILESDIR}"/${PN}-1.29-parallel-make-cleanup.patch
157 - #"${FILESDIR}"/${PN}-1.30-fix-build-system.patch
158 + "${FILESDIR}"/${PN}-1.30-pic.patch #270388
159 + "${FILESDIR}"/${PN}-1.30-makefile.patch
160 )
161
162 pkg_setup() {