public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: x11-apps/igt-gpu-tools/files/, x11-apps/igt-gpu-tools/
@ 2023-03-13 20:07 Matt Turner
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Turner @ 2023-03-13 20:07 UTC (permalink / raw
  To: gentoo-commits

commit:     51d1ceb3f71b0b618c1246af594bba3e1a5e0f45
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 13 19:46:32 2023 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Mon Mar 13 20:07:14 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51d1ceb3

x11-apps/igt-gpu-tools: Drop old versions

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 x11-apps/igt-gpu-tools/Manifest                    |   1 -
 ....26-lib-meson-build-Fix-underscorify-call.patch |  36 -------
 .../igt-gpu-tools/igt-gpu-tools-1.26-r2.ebuild     | 108 ---------------------
 3 files changed, 145 deletions(-)

diff --git a/x11-apps/igt-gpu-tools/Manifest b/x11-apps/igt-gpu-tools/Manifest
index b20e76beee7c..20bbf7eaf35c 100644
--- a/x11-apps/igt-gpu-tools/Manifest
+++ b/x11-apps/igt-gpu-tools/Manifest
@@ -1,2 +1 @@
-DIST igt-gpu-tools-1.26.tar.xz 1573468 BLAKE2B 31fa9cd61fd9a120c72e78cb5ecbc686477ae82572c702bdd6bbc11ba49dc052b7cf52fa486b93e51c87389d73f892577c1d22ebe71d6f50b1565f32355021d1 SHA512 6eb67f68da1c79fac61e5abd57433ef51dbeb2b6f0923dc84aefb81d7059fbc94378fadcd7321a8f059edd9bac640032bf53c3aa058cf570fe5c31924396af8f
 DIST igt-gpu-tools-1.27.1.tar.xz 2321940 BLAKE2B b6c4fee31c97cd5005c1f2cd5c18c181582adfb27e92444a8e78d1c105acb78a424bd4e4af8d13333776c81531fbfd24dc4b7db0da9858f5b803f64962d6269d SHA512 20923505e9afe6e5064bf8f4056e027ff0321cd29d8982157a608369aea6fbef24c93756de96ef6296e09d539957fc6cdad4097cbab5af33f8828f762da0d8c0

diff --git a/x11-apps/igt-gpu-tools/files/igt-gpu-tools-1.26-lib-meson-build-Fix-underscorify-call.patch b/x11-apps/igt-gpu-tools/files/igt-gpu-tools-1.26-lib-meson-build-Fix-underscorify-call.patch
deleted file mode 100644
index 142e2fa44fb6..000000000000
--- a/x11-apps/igt-gpu-tools/files/igt-gpu-tools-1.26-lib-meson-build-Fix-underscorify-call.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 963917a3565466832a3b2fc22e9285d34a0bf944 Mon Sep 17 00:00:00 2001
-From: Petri Latvala <petri.latvala@intel.com>
-Date: Thu, 28 Oct 2021 11:05:31 +0300
-Subject: [PATCH] lib/meson.build: Fix underscorify call
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-f.underscorify() is correct, f.underscorify(f) is an error that later
-meson versions don't like at all.
-
-Closes: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/107
-Fixes: 588555f77909 ("lib/i915: Extract helpers for determining scheduler capabilities")
-Cc: Arkadiusz Hiler <arek@hiler.eu>
-Signed-off-by: Petri Latvala <petri.latvala@intel.com>
-Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
----
- lib/meson.build | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/meson.build b/lib/meson.build
-index c3080fc8..297b0ad2 100644
---- a/lib/meson.build
-+++ b/lib/meson.build
-@@ -155,7 +155,7 @@ lib_version = vcs_tag(input : 'version.h.in', output : 'version.h',
- 
- lib_intermediates = []
- foreach f: lib_sources
--    name = f.underscorify(f)
-+    name = f.underscorify()
-     lib = static_library('igt-' + name,
- 	[ f, lib_version ],
- 	include_directories: inc,
--- 
-GitLab
-

diff --git a/x11-apps/igt-gpu-tools/igt-gpu-tools-1.26-r2.ebuild b/x11-apps/igt-gpu-tools/igt-gpu-tools-1.26-r2.ebuild
deleted file mode 100644
index 5f1ba04b2bc5..000000000000
--- a/x11-apps/igt-gpu-tools/igt-gpu-tools-1.26-r2.ebuild
+++ /dev/null
@@ -1,108 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-EGIT_REPO_URI="https://gitlab.freedesktop.org/drm/${PN}.git"
-if [[ ${PV} = *9999* ]]; then
-	GIT_ECLASS="git-r3"
-fi
-
-PYTHON_COMPAT=( python3_{9..10} )
-inherit ${GIT_ECLASS} meson python-any-r1
-
-DESCRIPTION="Intel GPU userland tools"
-
-HOMEPAGE="https://01.org/linuxgraphics https://gitlab.freedesktop.org/drm/igt-gpu-tools"
-if [[ ${PV} = *9999* ]]; then
-	SRC_URI=""
-else
-	KEYWORDS="~amd64 ~x86"
-	SRC_URI="https://www.x.org/releases/individual/app/${P}.tar.xz"
-fi
-LICENSE="MIT"
-SLOT="0"
-IUSE="chamelium doc man overlay runner tests unwind valgrind video_cards_amdgpu video_cards_intel video_cards_nouveau X xv"
-REQUIRED_USE="
-	|| ( video_cards_amdgpu video_cards_intel video_cards_nouveau )
-	overlay? (
-		video_cards_intel
-		|| ( X xv )
-	)
-	doc? ( tests )
-"
-RESTRICT="test"
-
-RDEPEND="
-	dev-libs/elfutils
-	dev-libs/glib:2
-	sys-apps/kmod:=
-	sys-libs/zlib:=
-	sys-process/procps:=
-	virtual/libudev:=
-	>=x11-libs/cairo-1.12.0[X?]
-	>=x11-libs/libdrm-2.4.82[video_cards_amdgpu?,video_cards_intel?,video_cards_nouveau?]
-	>=x11-libs/libpciaccess-0.10
-	x11-libs/pixman
-	chamelium? (
-		dev-libs/xmlrpc-c:=[curl]
-		sci-libs/gsl:=
-		media-libs/alsa-lib:=
-	)
-	overlay? (
-		>=x11-libs/libXrandr-1.3
-		xv? (
-			x11-libs/libX11
-			x11-libs/libXext
-			x11-libs/libXv
-		)
-	)
-	runner? ( dev-libs/json-c:= )
-	unwind? ( sys-libs/libunwind:= )
-	valgrind? ( dev-util/valgrind )
-	"
-DEPEND="${RDEPEND}
-	doc? ( >=dev-util/gtk-doc-1.25-r1 )
-	man? ( dev-python/docutils )
-	overlay? (
-		>=dev-util/peg-0.1.18
-		x11-base/xorg-proto
-	)
-	video_cards_intel? (
-		sys-devel/bison
-		sys-devel/flex
-	)
-"
-BDEPEND="${PYTHON_DEPS}"
-
-src_prepare() {
-	sed -e "s/find_program('rst2man-3'/find_program('rst2man.py', 'rst2man-3'/" -i man/meson.build
-	local PATCHES=(
-		"${FILESDIR}"/igt-gpu-tools-1.26-lib-meson-build-Fix-underscorify-call.patch
-	)
-	default_src_prepare
-}
-
-src_configure() {
-	local gpus=""
-	use video_cards_amdgpu  && gpus+="amdgpu,"
-	use video_cards_intel   && gpus+="intel,"
-	use video_cards_nouveau && gpus+="nouveau,"
-
-	local overlay_backends=""
-	use overlay && use xv && overlay_backends+="xv,"
-	use overlay && use X && overlay_backends+="x,"
-
-	local emesonargs=(
-		$(meson_feature chamelium)
-		$(meson_feature doc docs)
-		$(meson_feature man)
-		$(meson_feature overlay)
-		$(meson_feature runner)
-		$(meson_feature tests)
-		$(meson_feature valgrind)
-		$(meson_feature unwind libunwind)
-		-Doverlay_backends=${overlay_backends%?}
-		-Dlibdrm_drivers=${gpus%?}
-	)
-	meson_src_configure
-}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-apps/igt-gpu-tools/files/, x11-apps/igt-gpu-tools/
@ 2024-03-26 18:02 Matt Turner
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Turner @ 2024-03-26 18:02 UTC (permalink / raw
  To: gentoo-commits

commit:     c8103902549d8f730352acdfa341cfd04eed1b80
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 26 17:59:15 2024 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Tue Mar 26 18:01:58 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c8103902

x11-apps/igt-gpu-tools: Add patch to work with -Wl,-z,now

Closes: https://bugs.gentoo.org/788625
Closes: https://bugs.gentoo.org/925348
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 ...ine-igt_x86_features-into-ifunc-resolvers.patch | 354 +++++++++++++++++++++
 ...ls-1.28.ebuild => igt-gpu-tools-1.28-r1.ebuild} |   4 +
 2 files changed, 358 insertions(+)

diff --git a/x11-apps/igt-gpu-tools/files/1.28-lib-Inline-igt_x86_features-into-ifunc-resolvers.patch b/x11-apps/igt-gpu-tools/files/1.28-lib-Inline-igt_x86_features-into-ifunc-resolvers.patch
new file mode 100644
index 000000000000..e1239ff11a2c
--- /dev/null
+++ b/x11-apps/igt-gpu-tools/files/1.28-lib-Inline-igt_x86_features-into-ifunc-resolvers.patch
@@ -0,0 +1,354 @@
+From cdf2915c810e77e1b77071e46acd6d9c696c4473 Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Thu, 21 Mar 2024 14:41:50 -0400
+Subject: [PATCH] lib: Inline igt_x86_features() into ifunc resolvers
+
+Quoting https://sourceware.org/glibc/wiki/GNU_IFUNC
+
+> When LD_BIND_NOW=1 or -Wl,z,now is in effect symbols must be
+> immediately resolved at startup. In cases where an external function
+> call depends needs to be made that may fail if such a call has not
+> been initialized yet (PLT-based relocation which is processed later).
+> For example calling strlen in an IFUNC resolver built with -Wl,z,now
+> may lead to a segfault because the PLT is not yet resolved.
+
+We cannot rely on function calls through the PLT in ifunc resolvers as
+the PLT may not have been initialized yet.
+
+In practice, this causes crashes when igt is linked with -Wl,-z,now or
+when linked with the mold linker.
+
+To avoid this problem, we do two things:
+    1. move igt_x86_features() to igt_x86.h so its definition is
+       available to compilation units that call the function.
+    2. mark the ifunc resolvers with __attribute__((flatten)) to ensure
+       igt_x86_features() is inlined. Since this function is only called
+       from a few places it does not significantly increase binary size
+       to inline it.
+
+Linux distros (at least Fedora since v23, Gentoo/Hardened, soon standard
+Gentoo) use `-Wl,-z now` to improve security. By binding upfront, the
+loader can mark the GOT as read-only for a security enhancement. See
+https://wiki.gentoo.org/wiki/Hardened/Toolchain for more details.
+
+[Fixed whitespaces (Kamil)]
+Bug: https://bugs.gentoo.org/788625
+Bug: https://bugs.gentoo.org/925348
+Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
+Signed-off-by: Matt Turner <mattst88@gmail.com>
+---
+ lib/igt_halffloat.c |   8 +++
+ lib/igt_x86.c       | 119 ++------------------------------------------
+ lib/igt_x86.h       | 118 ++++++++++++++++++++++++++++++++++++++++++-
+ 3 files changed, 129 insertions(+), 116 deletions(-)
+
+diff --git a/lib/igt_halffloat.c b/lib/igt_halffloat.c
+index 5dbe08e01..560952d20 100644
+--- a/lib/igt_halffloat.c
++++ b/lib/igt_halffloat.c
+@@ -194,6 +194,10 @@ static void half_to_float(const uint16_t *h, float *f, unsigned int num)
+ 		f[i] = _half_to_float(h[i]);
+ }
+ 
++/* The PLT is not initialized when ifunc resolvers run, so all external
++ * functions must be inlined with __attribute__((flatten)).
++ */
++__attribute__((flatten))
+ static void (*resolve_float_to_half(void))(const float *f, uint16_t *h, unsigned int num)
+ {
+ 	if (igt_x86_features() & F16C)
+@@ -205,6 +209,10 @@ static void (*resolve_float_to_half(void))(const float *f, uint16_t *h, unsigned
+ void igt_float_to_half(const float *f, uint16_t *h, unsigned int num)
+ 	__attribute__((ifunc("resolve_float_to_half")));
+ 
++/* The PLT is not initialized when ifunc resolvers run, so all external
++ * functions must be inlined with __attribute__((flatten)).
++ */
++__attribute__((flatten))
+ static void (*resolve_half_to_float(void))(const uint16_t *h, float *f, unsigned int num)
+ {
+ 	if (igt_x86_features() & F16C)
+diff --git a/lib/igt_x86.c b/lib/igt_x86.c
+index 8c102fd13..4842164e9 100644
+--- a/lib/igt_x86.c
++++ b/lib/igt_x86.c
+@@ -27,14 +27,6 @@
+ 
+ #include "config.h"
+ 
+-#ifdef HAVE_CPUID_H
+-#include <cpuid.h>
+-#else
+-#define __get_cpuid_max(x, y) 0
+-#define __cpuid(level, a, b, c, d) a = b = c = d = 0
+-#define __cpuid_count(level, count, a, b, c, d) a = b = c = d = 0
+-#endif
+-
+ #include "igt_x86.h"
+ #include "igt_aux.h"
+ 
+@@ -49,114 +41,7 @@
+  * @include: igt_x86.h
+  */
+ 
+-#define BASIC_CPUID 0x0
+-#define EXTENDED_CPUID 0x80000000
+-
+-#ifndef bit_MMX
+-#define bit_MMX		(1 << 23)
+-#endif
+-
+-#ifndef bit_SSE
+-#define bit_SSE		(1 << 25)
+-#endif
+-
+-#ifndef bit_SSE2
+-#define bit_SSE2	(1 << 26)
+-#endif
+-
+-#ifndef bit_SSE3
+-#define bit_SSE3	(1 << 0)
+-#endif
+-
+-#ifndef bit_SSSE3
+-#define bit_SSSE3	(1 << 9)
+-#endif
+-
+-#ifndef bit_SSE4_1
+-#define bit_SSE4_1	(1 << 19)
+-#endif
+-
+-#ifndef bit_SSE4_2
+-#define bit_SSE4_2	(1 << 20)
+-#endif
+-
+-#ifndef bit_OSXSAVE
+-#define bit_OSXSAVE	(1 << 27)
+-#endif
+-
+-#ifndef bit_AVX
+-#define bit_AVX		(1 << 28)
+-#endif
+-
+-#ifndef bit_F16C
+-#define bit_F16C	(1 << 29)
+-#endif
+-
+-#ifndef bit_AVX2
+-#define bit_AVX2	(1<<5)
+-#endif
+-
+-#define xgetbv(index,eax,edx) \
+-	__asm__ ("xgetbv" : "=a"(eax), "=d"(edx) : "c" (index))
+-
+-#define has_YMM 0x1
+-
+ #if defined(__x86_64__) || defined(__i386__)
+-unsigned igt_x86_features(void)
+-{
+-	unsigned max = __get_cpuid_max(BASIC_CPUID, 0);
+-	unsigned eax, ebx, ecx, edx;
+-	unsigned features = 0;
+-	unsigned extra = 0;
+-
+-	if (max >= 1) {
+-		__cpuid(1, eax, ebx, ecx, edx);
+-
+-		if (ecx & bit_SSE3)
+-			features |= SSE3;
+-
+-		if (ecx & bit_SSSE3)
+-			features |= SSSE3;
+-
+-		if (ecx & bit_SSE4_1)
+-			features |= SSE4_1;
+-
+-		if (ecx & bit_SSE4_2)
+-			features |= SSE4_2;
+-
+-		if (ecx & bit_OSXSAVE) {
+-			unsigned int bv_eax, bv_ecx;
+-			xgetbv(0, bv_eax, bv_ecx);
+-			if ((bv_eax & 6) == 6)
+-				extra |= has_YMM;
+-		}
+-
+-		if ((extra & has_YMM) && (ecx & bit_AVX))
+-			features |= AVX;
+-
+-		if (edx & bit_MMX)
+-			features |= MMX;
+-
+-		if (edx & bit_SSE)
+-			features |= SSE;
+-
+-		if (edx & bit_SSE2)
+-			features |= SSE2;
+-
+-		if (ecx & bit_F16C)
+-			features |= F16C;
+-	}
+-
+-	if (max >= 7) {
+-		__cpuid_count(7, 0, eax, ebx, ecx, edx);
+-
+-		if ((extra & has_YMM) && (ebx & bit_AVX2))
+-			features |= AVX2;
+-	}
+-
+-	return features;
+-}
+-
+ char *igt_x86_features_to_string(unsigned features, char *line)
+ {
+ 	char *ret = line;
+@@ -284,6 +169,10 @@ static void memcpy_from_wc(void *dst, const void *src, unsigned long len)
+ 	memcpy(dst, src, len);
+ }
+ 
++/* The PLT is not initialized when ifunc resolvers run, so all external
++ * functions must be inlined with __attribute__((flatten)).
++ */
++__attribute__((flatten))
+ static void (*resolve_memcpy_from_wc(void))(void *, const void *, unsigned long)
+ {
+ 	if (igt_x86_features() & SSE4_1)
+diff --git a/lib/igt_x86.h b/lib/igt_x86.h
+index c7b84dec2..f1df4c1a9 100644
+--- a/lib/igt_x86.h
++++ b/lib/igt_x86.h
+@@ -30,6 +30,14 @@
+ #ifndef IGT_X86_H
+ #define IGT_X86_H
+ 
++#ifdef HAVE_CPUID_H
++#include <cpuid.h>
++#else
++#define __get_cpuid_max(x, y) 0
++#define __cpuid(level, a, b, c, d) a = b = c = d = 0
++#define __cpuid_count(level, count, a, b, c, d) a = b = c = d = 0
++#endif
++
+ #define MMX	0x1
+ #define SSE	0x2
+ #define SSE2	0x4
+@@ -42,7 +50,115 @@
+ #define F16C	0x200
+ 
+ #if defined(__x86_64__) || defined(__i386__)
+-unsigned igt_x86_features(void);
++
++#define BASIC_CPUID 0x0
++#define EXTENDED_CPUID 0x80000000
++
++#ifndef bit_MMX
++#define bit_MMX		(1 << 23)
++#endif
++
++#ifndef bit_SSE
++#define bit_SSE		(1 << 25)
++#endif
++
++#ifndef bit_SSE2
++#define bit_SSE2	(1 << 26)
++#endif
++
++#ifndef bit_SSE3
++#define bit_SSE3	(1 << 0)
++#endif
++
++#ifndef bit_SSSE3
++#define bit_SSSE3	(1 << 9)
++#endif
++
++#ifndef bit_SSE4_1
++#define bit_SSE4_1	(1 << 19)
++#endif
++
++#ifndef bit_SSE4_2
++#define bit_SSE4_2	(1 << 20)
++#endif
++
++#ifndef bit_OSXSAVE
++#define bit_OSXSAVE	(1 << 27)
++#endif
++
++#ifndef bit_AVX
++#define bit_AVX		(1 << 28)
++#endif
++
++#ifndef bit_F16C
++#define bit_F16C	(1 << 29)
++#endif
++
++#ifndef bit_AVX2
++#define bit_AVX2	(1<<5)
++#endif
++
++#define xgetbv(index, eax, edx) \
++	__asm__ ("xgetbv" : "=a"(eax), "=d"(edx) : "c" (index))
++
++#define has_YMM 0x1
++
++static inline unsigned igt_x86_features(void)
++{
++	unsigned max = __get_cpuid_max(BASIC_CPUID, 0);
++	unsigned eax, ebx, ecx, edx;
++	unsigned features = 0;
++	unsigned extra = 0;
++
++	if (max >= 1) {
++		__cpuid(1, eax, ebx, ecx, edx);
++
++		if (ecx & bit_SSE3)
++			features |= SSE3;
++
++		if (ecx & bit_SSSE3)
++			features |= SSSE3;
++
++		if (ecx & bit_SSE4_1)
++			features |= SSE4_1;
++
++		if (ecx & bit_SSE4_2)
++			features |= SSE4_2;
++
++		if (ecx & bit_OSXSAVE) {
++			unsigned int bv_eax, bv_ecx;
++
++			xgetbv(0, bv_eax, bv_ecx);
++			if ((bv_eax & 6) == 6)
++				extra |= has_YMM;
++		}
++
++		if ((extra & has_YMM) && (ecx & bit_AVX))
++			features |= AVX;
++
++		if (edx & bit_MMX)
++			features |= MMX;
++
++		if (edx & bit_SSE)
++			features |= SSE;
++
++		if (edx & bit_SSE2)
++			features |= SSE2;
++
++		if (ecx & bit_F16C)
++			features |= F16C;
++	}
++
++	if (max >= 7) {
++		__cpuid_count(7, 0, eax, ebx, ecx, edx);
++
++		if ((extra & has_YMM) && (ebx & bit_AVX2))
++			features |= AVX2;
++	}
++
++	return features;
++}
++
+ char *igt_x86_features_to_string(unsigned features, char *line);
+ #else
+ static inline unsigned igt_x86_features(void)
+-- 
+2.43.2
+

diff --git a/x11-apps/igt-gpu-tools/igt-gpu-tools-1.28.ebuild b/x11-apps/igt-gpu-tools/igt-gpu-tools-1.28-r1.ebuild
similarity index 96%
rename from x11-apps/igt-gpu-tools/igt-gpu-tools-1.28.ebuild
rename to x11-apps/igt-gpu-tools/igt-gpu-tools-1.28-r1.ebuild
index 1f80a8afe9ad..1970fac8edf8 100644
--- a/x11-apps/igt-gpu-tools/igt-gpu-tools-1.28.ebuild
+++ b/x11-apps/igt-gpu-tools/igt-gpu-tools-1.28-r1.ebuild
@@ -73,6 +73,10 @@ DEPEND="${RDEPEND}
 "
 BDEPEND="${PYTHON_DEPS}"
 
+PATCHES=(
+	"${FILESDIR}"/${PV}-lib-Inline-igt_x86_features-into-ifunc-resolvers.patch
+)
+
 src_prepare() {
 	sed -e "s/find_program('rst2man-3'/find_program('rst2man.py', 'rst2man-3'/" -i man/meson.build
 	default_src_prepare


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-apps/igt-gpu-tools/files/, x11-apps/igt-gpu-tools/
@ 2024-09-17  2:49 Matt Turner
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Turner @ 2024-09-17  2:49 UTC (permalink / raw
  To: gentoo-commits

commit:     b67b6461e623f354d29d539e724c4e1328fb0a9c
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 17 02:46:17 2024 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Tue Sep 17 02:48:33 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b67b6461

x11-apps/igt-gpu-tools: Drop old versions

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 x11-apps/igt-gpu-tools/Manifest                    |   1 -
 ...ine-igt_x86_features-into-ifunc-resolvers.patch | 354 ---------------------
 .../igt-gpu-tools/igt-gpu-tools-1.28-r1.ebuild     | 111 -------
 3 files changed, 466 deletions(-)

diff --git a/x11-apps/igt-gpu-tools/Manifest b/x11-apps/igt-gpu-tools/Manifest
index 95352e6ad6d9..f69cc606fd4e 100644
--- a/x11-apps/igt-gpu-tools/Manifest
+++ b/x11-apps/igt-gpu-tools/Manifest
@@ -1,2 +1 @@
-DIST igt-gpu-tools-1.28.tar.xz 2597284 BLAKE2B c15a5b0142f2bf54d0b002b5a17ca705b9cc33662b902edb18e0860c8a1d66c911a082f1c60b3b41f184bd72d7f568554a11d69f9b70978d176eef2cdd1f4e38 SHA512 b0bed7fce28a309f5e5b1f044952abf06ede806ef691b4ddbd52ee437bc9c3701822d65c761c69a8ae5b40695d121193f30aa772cdfaf9ab16c800d7fbcd0abc
 DIST igt-gpu-tools-1.29.tar.xz 2944444 BLAKE2B 8d34a2b1a9dfc6d8a23be6d2a45436f531e98f0aa8b05346d5a4f2232d4904fc12cb7a986ee335b2a9a31760de10cfed0d92b7de6052ed75baeadc190c5ebee9 SHA512 1bce6cc916b79bee3562cdee945444bfe925efac37c0df61f8adc17b1aade752cb2e31a05c0dc5de5f2c54256f3319cab7ee45014d5d910e16cca50accd2d1ed

diff --git a/x11-apps/igt-gpu-tools/files/1.28-lib-Inline-igt_x86_features-into-ifunc-resolvers.patch b/x11-apps/igt-gpu-tools/files/1.28-lib-Inline-igt_x86_features-into-ifunc-resolvers.patch
deleted file mode 100644
index e1239ff11a2c..000000000000
--- a/x11-apps/igt-gpu-tools/files/1.28-lib-Inline-igt_x86_features-into-ifunc-resolvers.patch
+++ /dev/null
@@ -1,354 +0,0 @@
-From cdf2915c810e77e1b77071e46acd6d9c696c4473 Mon Sep 17 00:00:00 2001
-From: Matt Turner <mattst88@gmail.com>
-Date: Thu, 21 Mar 2024 14:41:50 -0400
-Subject: [PATCH] lib: Inline igt_x86_features() into ifunc resolvers
-
-Quoting https://sourceware.org/glibc/wiki/GNU_IFUNC
-
-> When LD_BIND_NOW=1 or -Wl,z,now is in effect symbols must be
-> immediately resolved at startup. In cases where an external function
-> call depends needs to be made that may fail if such a call has not
-> been initialized yet (PLT-based relocation which is processed later).
-> For example calling strlen in an IFUNC resolver built with -Wl,z,now
-> may lead to a segfault because the PLT is not yet resolved.
-
-We cannot rely on function calls through the PLT in ifunc resolvers as
-the PLT may not have been initialized yet.
-
-In practice, this causes crashes when igt is linked with -Wl,-z,now or
-when linked with the mold linker.
-
-To avoid this problem, we do two things:
-    1. move igt_x86_features() to igt_x86.h so its definition is
-       available to compilation units that call the function.
-    2. mark the ifunc resolvers with __attribute__((flatten)) to ensure
-       igt_x86_features() is inlined. Since this function is only called
-       from a few places it does not significantly increase binary size
-       to inline it.
-
-Linux distros (at least Fedora since v23, Gentoo/Hardened, soon standard
-Gentoo) use `-Wl,-z now` to improve security. By binding upfront, the
-loader can mark the GOT as read-only for a security enhancement. See
-https://wiki.gentoo.org/wiki/Hardened/Toolchain for more details.
-
-[Fixed whitespaces (Kamil)]
-Bug: https://bugs.gentoo.org/788625
-Bug: https://bugs.gentoo.org/925348
-Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
-Signed-off-by: Matt Turner <mattst88@gmail.com>
----
- lib/igt_halffloat.c |   8 +++
- lib/igt_x86.c       | 119 ++------------------------------------------
- lib/igt_x86.h       | 118 ++++++++++++++++++++++++++++++++++++++++++-
- 3 files changed, 129 insertions(+), 116 deletions(-)
-
-diff --git a/lib/igt_halffloat.c b/lib/igt_halffloat.c
-index 5dbe08e01..560952d20 100644
---- a/lib/igt_halffloat.c
-+++ b/lib/igt_halffloat.c
-@@ -194,6 +194,10 @@ static void half_to_float(const uint16_t *h, float *f, unsigned int num)
- 		f[i] = _half_to_float(h[i]);
- }
- 
-+/* The PLT is not initialized when ifunc resolvers run, so all external
-+ * functions must be inlined with __attribute__((flatten)).
-+ */
-+__attribute__((flatten))
- static void (*resolve_float_to_half(void))(const float *f, uint16_t *h, unsigned int num)
- {
- 	if (igt_x86_features() & F16C)
-@@ -205,6 +209,10 @@ static void (*resolve_float_to_half(void))(const float *f, uint16_t *h, unsigned
- void igt_float_to_half(const float *f, uint16_t *h, unsigned int num)
- 	__attribute__((ifunc("resolve_float_to_half")));
- 
-+/* The PLT is not initialized when ifunc resolvers run, so all external
-+ * functions must be inlined with __attribute__((flatten)).
-+ */
-+__attribute__((flatten))
- static void (*resolve_half_to_float(void))(const uint16_t *h, float *f, unsigned int num)
- {
- 	if (igt_x86_features() & F16C)
-diff --git a/lib/igt_x86.c b/lib/igt_x86.c
-index 8c102fd13..4842164e9 100644
---- a/lib/igt_x86.c
-+++ b/lib/igt_x86.c
-@@ -27,14 +27,6 @@
- 
- #include "config.h"
- 
--#ifdef HAVE_CPUID_H
--#include <cpuid.h>
--#else
--#define __get_cpuid_max(x, y) 0
--#define __cpuid(level, a, b, c, d) a = b = c = d = 0
--#define __cpuid_count(level, count, a, b, c, d) a = b = c = d = 0
--#endif
--
- #include "igt_x86.h"
- #include "igt_aux.h"
- 
-@@ -49,114 +41,7 @@
-  * @include: igt_x86.h
-  */
- 
--#define BASIC_CPUID 0x0
--#define EXTENDED_CPUID 0x80000000
--
--#ifndef bit_MMX
--#define bit_MMX		(1 << 23)
--#endif
--
--#ifndef bit_SSE
--#define bit_SSE		(1 << 25)
--#endif
--
--#ifndef bit_SSE2
--#define bit_SSE2	(1 << 26)
--#endif
--
--#ifndef bit_SSE3
--#define bit_SSE3	(1 << 0)
--#endif
--
--#ifndef bit_SSSE3
--#define bit_SSSE3	(1 << 9)
--#endif
--
--#ifndef bit_SSE4_1
--#define bit_SSE4_1	(1 << 19)
--#endif
--
--#ifndef bit_SSE4_2
--#define bit_SSE4_2	(1 << 20)
--#endif
--
--#ifndef bit_OSXSAVE
--#define bit_OSXSAVE	(1 << 27)
--#endif
--
--#ifndef bit_AVX
--#define bit_AVX		(1 << 28)
--#endif
--
--#ifndef bit_F16C
--#define bit_F16C	(1 << 29)
--#endif
--
--#ifndef bit_AVX2
--#define bit_AVX2	(1<<5)
--#endif
--
--#define xgetbv(index,eax,edx) \
--	__asm__ ("xgetbv" : "=a"(eax), "=d"(edx) : "c" (index))
--
--#define has_YMM 0x1
--
- #if defined(__x86_64__) || defined(__i386__)
--unsigned igt_x86_features(void)
--{
--	unsigned max = __get_cpuid_max(BASIC_CPUID, 0);
--	unsigned eax, ebx, ecx, edx;
--	unsigned features = 0;
--	unsigned extra = 0;
--
--	if (max >= 1) {
--		__cpuid(1, eax, ebx, ecx, edx);
--
--		if (ecx & bit_SSE3)
--			features |= SSE3;
--
--		if (ecx & bit_SSSE3)
--			features |= SSSE3;
--
--		if (ecx & bit_SSE4_1)
--			features |= SSE4_1;
--
--		if (ecx & bit_SSE4_2)
--			features |= SSE4_2;
--
--		if (ecx & bit_OSXSAVE) {
--			unsigned int bv_eax, bv_ecx;
--			xgetbv(0, bv_eax, bv_ecx);
--			if ((bv_eax & 6) == 6)
--				extra |= has_YMM;
--		}
--
--		if ((extra & has_YMM) && (ecx & bit_AVX))
--			features |= AVX;
--
--		if (edx & bit_MMX)
--			features |= MMX;
--
--		if (edx & bit_SSE)
--			features |= SSE;
--
--		if (edx & bit_SSE2)
--			features |= SSE2;
--
--		if (ecx & bit_F16C)
--			features |= F16C;
--	}
--
--	if (max >= 7) {
--		__cpuid_count(7, 0, eax, ebx, ecx, edx);
--
--		if ((extra & has_YMM) && (ebx & bit_AVX2))
--			features |= AVX2;
--	}
--
--	return features;
--}
--
- char *igt_x86_features_to_string(unsigned features, char *line)
- {
- 	char *ret = line;
-@@ -284,6 +169,10 @@ static void memcpy_from_wc(void *dst, const void *src, unsigned long len)
- 	memcpy(dst, src, len);
- }
- 
-+/* The PLT is not initialized when ifunc resolvers run, so all external
-+ * functions must be inlined with __attribute__((flatten)).
-+ */
-+__attribute__((flatten))
- static void (*resolve_memcpy_from_wc(void))(void *, const void *, unsigned long)
- {
- 	if (igt_x86_features() & SSE4_1)
-diff --git a/lib/igt_x86.h b/lib/igt_x86.h
-index c7b84dec2..f1df4c1a9 100644
---- a/lib/igt_x86.h
-+++ b/lib/igt_x86.h
-@@ -30,6 +30,14 @@
- #ifndef IGT_X86_H
- #define IGT_X86_H
- 
-+#ifdef HAVE_CPUID_H
-+#include <cpuid.h>
-+#else
-+#define __get_cpuid_max(x, y) 0
-+#define __cpuid(level, a, b, c, d) a = b = c = d = 0
-+#define __cpuid_count(level, count, a, b, c, d) a = b = c = d = 0
-+#endif
-+
- #define MMX	0x1
- #define SSE	0x2
- #define SSE2	0x4
-@@ -42,7 +50,115 @@
- #define F16C	0x200
- 
- #if defined(__x86_64__) || defined(__i386__)
--unsigned igt_x86_features(void);
-+
-+#define BASIC_CPUID 0x0
-+#define EXTENDED_CPUID 0x80000000
-+
-+#ifndef bit_MMX
-+#define bit_MMX		(1 << 23)
-+#endif
-+
-+#ifndef bit_SSE
-+#define bit_SSE		(1 << 25)
-+#endif
-+
-+#ifndef bit_SSE2
-+#define bit_SSE2	(1 << 26)
-+#endif
-+
-+#ifndef bit_SSE3
-+#define bit_SSE3	(1 << 0)
-+#endif
-+
-+#ifndef bit_SSSE3
-+#define bit_SSSE3	(1 << 9)
-+#endif
-+
-+#ifndef bit_SSE4_1
-+#define bit_SSE4_1	(1 << 19)
-+#endif
-+
-+#ifndef bit_SSE4_2
-+#define bit_SSE4_2	(1 << 20)
-+#endif
-+
-+#ifndef bit_OSXSAVE
-+#define bit_OSXSAVE	(1 << 27)
-+#endif
-+
-+#ifndef bit_AVX
-+#define bit_AVX		(1 << 28)
-+#endif
-+
-+#ifndef bit_F16C
-+#define bit_F16C	(1 << 29)
-+#endif
-+
-+#ifndef bit_AVX2
-+#define bit_AVX2	(1<<5)
-+#endif
-+
-+#define xgetbv(index, eax, edx) \
-+	__asm__ ("xgetbv" : "=a"(eax), "=d"(edx) : "c" (index))
-+
-+#define has_YMM 0x1
-+
-+static inline unsigned igt_x86_features(void)
-+{
-+	unsigned max = __get_cpuid_max(BASIC_CPUID, 0);
-+	unsigned eax, ebx, ecx, edx;
-+	unsigned features = 0;
-+	unsigned extra = 0;
-+
-+	if (max >= 1) {
-+		__cpuid(1, eax, ebx, ecx, edx);
-+
-+		if (ecx & bit_SSE3)
-+			features |= SSE3;
-+
-+		if (ecx & bit_SSSE3)
-+			features |= SSSE3;
-+
-+		if (ecx & bit_SSE4_1)
-+			features |= SSE4_1;
-+
-+		if (ecx & bit_SSE4_2)
-+			features |= SSE4_2;
-+
-+		if (ecx & bit_OSXSAVE) {
-+			unsigned int bv_eax, bv_ecx;
-+
-+			xgetbv(0, bv_eax, bv_ecx);
-+			if ((bv_eax & 6) == 6)
-+				extra |= has_YMM;
-+		}
-+
-+		if ((extra & has_YMM) && (ecx & bit_AVX))
-+			features |= AVX;
-+
-+		if (edx & bit_MMX)
-+			features |= MMX;
-+
-+		if (edx & bit_SSE)
-+			features |= SSE;
-+
-+		if (edx & bit_SSE2)
-+			features |= SSE2;
-+
-+		if (ecx & bit_F16C)
-+			features |= F16C;
-+	}
-+
-+	if (max >= 7) {
-+		__cpuid_count(7, 0, eax, ebx, ecx, edx);
-+
-+		if ((extra & has_YMM) && (ebx & bit_AVX2))
-+			features |= AVX2;
-+	}
-+
-+	return features;
-+}
-+
- char *igt_x86_features_to_string(unsigned features, char *line);
- #else
- static inline unsigned igt_x86_features(void)
--- 
-2.43.2
-

diff --git a/x11-apps/igt-gpu-tools/igt-gpu-tools-1.28-r1.ebuild b/x11-apps/igt-gpu-tools/igt-gpu-tools-1.28-r1.ebuild
deleted file mode 100644
index 1970fac8edf8..000000000000
--- a/x11-apps/igt-gpu-tools/igt-gpu-tools-1.28-r1.ebuild
+++ /dev/null
@@ -1,111 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-EGIT_REPO_URI="https://gitlab.freedesktop.org/drm/${PN}.git"
-if [[ ${PV} = *9999* ]]; then
-	GIT_ECLASS="git-r3"
-fi
-
-PYTHON_COMPAT=( python3_{10..12} )
-inherit ${GIT_ECLASS} meson python-any-r1
-
-DESCRIPTION="Intel GPU userland tools"
-
-HOMEPAGE="https://gitlab.freedesktop.org/drm/igt-gpu-tools"
-if [[ ${PV} != *9999* ]]; then
-	KEYWORDS="~amd64 ~x86"
-	SRC_URI="https://www.x.org/releases/individual/app/${P}.tar.xz"
-fi
-LICENSE="MIT"
-SLOT="0"
-IUSE="chamelium doc man overlay runner tests unwind valgrind video_cards_amdgpu video_cards_intel video_cards_nouveau X xv"
-REQUIRED_USE="
-	|| ( video_cards_amdgpu video_cards_intel video_cards_nouveau )
-	overlay? (
-		video_cards_intel
-		|| ( X xv )
-	)
-	doc? ( tests )
-	runner? ( tests )
-"
-RESTRICT="test"
-
-RDEPEND="
-	dev-libs/elfutils
-	dev-libs/glib:2
-	sys-apps/kmod
-	sys-libs/zlib:=
-	sys-process/procps:=
-	virtual/libudev:=
-	>=x11-libs/cairo-1.12.0[X?]
-	>=x11-libs/libdrm-2.4.82[video_cards_amdgpu?,video_cards_intel?,video_cards_nouveau?]
-	>=x11-libs/libpciaccess-0.10
-	x11-libs/pixman
-	chamelium? (
-		dev-libs/xmlrpc-c:=[curl]
-		sci-libs/gsl:=
-		media-libs/alsa-lib
-	)
-	overlay? (
-		>=x11-libs/libXrandr-1.3
-		xv? (
-			x11-libs/libX11
-			x11-libs/libXext
-			x11-libs/libXv
-		)
-	)
-	runner? ( dev-libs/json-c:= )
-	unwind? ( sys-libs/libunwind:= )
-	valgrind? ( dev-debug/valgrind )
-	"
-DEPEND="${RDEPEND}
-	doc? ( >=dev-util/gtk-doc-1.25-r1 )
-	man? ( dev-python/docutils )
-	overlay? (
-		>=dev-util/peg-0.1.18
-		x11-base/xorg-proto
-	)
-	video_cards_intel? (
-		app-alternatives/yacc
-		app-alternatives/lex
-	)
-"
-BDEPEND="${PYTHON_DEPS}"
-
-PATCHES=(
-	"${FILESDIR}"/${PV}-lib-Inline-igt_x86_features-into-ifunc-resolvers.patch
-)
-
-src_prepare() {
-	sed -e "s/find_program('rst2man-3'/find_program('rst2man.py', 'rst2man-3'/" -i man/meson.build
-	default_src_prepare
-}
-
-src_configure() {
-	local gpus=""
-	use video_cards_amdgpu  && gpus+="amdgpu,"
-	use video_cards_intel   && gpus+="intel,"
-	use video_cards_nouveau && gpus+="nouveau,"
-
-	local overlay_backends=""
-	use overlay && use xv && overlay_backends+="xv,"
-	use overlay && use X && overlay_backends+="x,"
-
-	local emesonargs=(
-		$(meson_feature overlay)
-		-Doverlay_backends=${overlay_backends%?}
-		$(meson_feature chamelium)
-		$(meson_feature valgrind)
-		$(meson_feature man)
-		-Dtestplan=disabled
-		-Dsphinx=disabled
-		$(meson_feature doc docs)
-		$(meson_feature tests)
-		-Dxe_driver=disabled
-		-Dlibdrm_drivers=${gpus%?}
-		$(meson_feature unwind libunwind)
-		$(meson_feature runner)
-	)
-	meson_src_configure
-}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-17  2:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-13 20:07 [gentoo-commits] repo/gentoo:master commit in: x11-apps/igt-gpu-tools/files/, x11-apps/igt-gpu-tools/ Matt Turner
  -- strict thread matches above, loose matches on Subject: below --
2024-03-26 18:02 Matt Turner
2024-09-17  2:49 Matt Turner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox