Skip to contentSkip to conversation

package/igt-gpu-tools: new package

PATCH Superseded Bernd Kuhls 3 participants 3 messages Oct 26, 2023 – Nov 27, 2023

v6 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 package/igt-gpu-tools: new package

From: Gaël PORTAY <[email protected]>

IGT GPU Tools is a collection of tools for development and testing of the DRM drivers

[Bernd: v4
- add myself to DEVELOPERS
- add patches to fix build with musl & uClibc
- add dependencies to locales, mmu, wchar and headers >= 4.11
- rework libunwind dependency
- remove duplicate libglib2 dependency
v5
- added optional dependency to json_c
- remove broken igt_stats binary
v6
- updated patch series after upstream review]

---
Build-tested using this defconfig

BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_PACKAGE_IGT_GPU_TOOLS=y
BR2_PACKAGE_JSON_C=y
BR2_PER_PACKAGE_DIRECTORIES=y

bootlin-xtensa-uclibc [27/45]: FAILED
- build stopped with an error in the cairo package br-mips64-n64-full [33/45]: FAILED
- toolchain dates back to 2020 causing the known static_assert problem with uClibc, this is fixed in newer uClibc versions.

45 builds, 17 skipped, 2 build failed, 0 legal-info failed, 0 show-info failed

 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 ...d-check-that-outb-is-present-in-io.h.patch | 34 +++++++
 ...limits.h-to-fix-build-with-musl-libc.patch | 89 +++++++++++++++++++
 .../0003-lib-igt_aux.h-Fix-musl-build.patch   | 57 ++++++++++++
 ...-lib-igt_x86.c-Fix-musl-uclibc-build.patch | 43 +++++++++
 ...gt_halffloat.c-Fix-musl-uclibc-build.patch | 46 ++++++++++
 ...rks-gem_exec_tracer.c-Fix-musl-build.patch | 46 ++++++++++
 package/igt-gpu-tools/Config.in               | 32 +++++++
 package/igt-gpu-tools/igt-gpu-tools.hash      |  5 ++
 package/igt-gpu-tools/igt-gpu-tools.mk        | 38 ++++++++
 11 files changed, 392 insertions(+)
 create mode 100644 package/igt-gpu-tools/0001-build-check-that-outb-is-present-in-io.h.patch
 create mode 100644 package/igt-gpu-tools/0002-Include-limits.h-to-fix-build-with-musl-libc.patch
 create mode 100644 package/igt-gpu-tools/0003-lib-igt_aux.h-Fix-musl-build.patch
 create mode 100644 package/igt-gpu-tools/0004-lib-igt_x86.c-Fix-musl-uclibc-build.patch
 create mode 100644 package/igt-gpu-tools/0005-lib-igt_halffloat.c-Fix-musl-uclibc-build.patch
 create mode 100644 package/igt-gpu-tools/0006-benchmarks-gem_exec_tracer.c-Fix-musl-build.patch
 create mode 100644 package/igt-gpu-tools/Config.in
 create mode 100644 package/igt-gpu-tools/igt-gpu-tools.hash
 create mode 100644 package/igt-gpu-tools/igt-gpu-tools.mk
DEVELOPERS +1 -0
index 56449b0d5f..a621fd762e 100644
@@ -366,6 +366,7 @@ F:	package/gpsd/
 F:	package/gptfdisk/
 F:	package/hddtemp/
 F:	package/hdparm/
+F:	package/igt-gpu-tools/
 F:	package/intel-gmmlib/
 F:	package/intel-mediadriver/
 F:	package/intel-mediasdk/
package/Config.in +1 -0
index ecd8668ee7..97ec46730e 100644
@@ -318,6 +318,7 @@ comment "Graphic applications"
 	source "package/glmark2/Config.in"
 	source "package/glslsandbox-player/Config.in"
 	source "package/gnuplot/Config.in"
+	source "package/igt-gpu-tools/Config.in"
 	source "package/jhead/Config.in"
 	source "package/kmscube/Config.in"
 	source "package/libva-utils/Config.in"
package/igt-gpu-tools/0001-build-check-that-outb-is-present-in-io.h.patch new file +34 -0
new file mode 100644
index 0000000000..5c0b39ee7d
@@ -0,0 +1,34 @@
+From d5373adea6248c0fe41870d50b24fc4ed36c6490 Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <[email protected]>
+Date: Sat, 21 Oct 2023 16:47:07 +0200
+Subject: [PATCH] build: check that outb is present in io.h
+
+With glibc if io.h exists, inb/outb are always defined.
+However on musl, io.h always exists but it may not define inb/outb.
+
+Thus, igt-gpu-tools builds with musl on non-x86 platforms will fail to
+link. Fix this by checking for both io.h and that outb() is defined.
+
+Upstream: https://lists.freedesktop.org/archives/igt-dev/2023-October/063811.html
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index b35a00faa..cee8a7446 100644
+--- a/meson.build
++++ b/meson.build
+@@ -220,7 +220,7 @@ endif
+ if cc.has_header('libgen.h')
+ 	config.set('HAVE_LIBGEN_H', 1)
+ endif
+-if cc.has_header('sys/io.h')
++if cc.has_header('sys/io.h') and cc.has_function('outb', prefix: '#include <sys/io.h>')
+ 	config.set('HAVE_SYS_IO_H', 1)
+ endif
+ if cc.links('''
+-- 
+2.39.2
+
package/igt-gpu-tools/0002-Include-limits.h-to-fix-build-with-musl-libc.patch new file +89 -0

89 lines not on this page · raw message

package/igt-gpu-tools/0003-lib-igt_aux.h-Fix-musl-build.patch new file +57 -0

57 lines not on this page · raw message

package/igt-gpu-tools/0004-lib-igt_x86.c-Fix-musl-uclibc-build.patch new file +43 -0

43 lines not on this page · raw message

package/igt-gpu-tools/0005-lib-igt_halffloat.c-Fix-musl-uclibc-build.patch new file +46 -0

46 lines not on this page · raw message

package/igt-gpu-tools/0006-benchmarks-gem_exec_tracer.c-Fix-musl-build.patch new file +46 -0

46 lines not on this page · raw message

package/igt-gpu-tools/Config.in new file +32 -0
new file mode 100644
index 0000000000..809c8e28ac
@@ -0,0 +1,32 @@
+config BR2_PACKAGE_IGT_GPU_TOOLS
+	bool "igt-gpu-tools"
+	depends on BR2_USE_MMU # fork()
+	depends on BR2_ENABLE_LOCALE
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_PACKAGE_HAS_UDEV
+	depends on BR2_USE_WCHAR # elfutils
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11 # linux/dma-buf.h
+	select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # procps-ng
+	select BR2_PACKAGE_CAIRO
+	select BR2_PACKAGE_CAIRO_PNG
+	select BR2_PACKAGE_ELFUTILS
+	select BR2_PACKAGE_KMOD
+	select BR2_PACKAGE_LIBDRM
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_LIBPCIACCESS
+	select BR2_PACKAGE_PIXMAN
+	select BR2_PACKAGE_PROCPS_NG
+	select BR2_PACKAGE_ZLIB
+	help
+	  IGT GPU Tools is a collection of tools for development and
+	  testing of the DRM drivers.
+
+	  https://gitlab.freedesktop.org/drm/igt-gpu-tools
+
+comment "igt-gpu-tools needs udev /dev management and toolchain w/ threads, wchar, dynamic library, locale, headers >= 4.11"
+	depends on BR2_USE_MMU
+	depends on !BR2_PACKAGE_HAS_UDEV || BR2_STATIC_LIBS || \
+		!BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR || \
+		!BR2_ENABLE_LOCALE || \
+		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11
package/igt-gpu-tools/igt-gpu-tools.hash new file +5 -0
new file mode 100644
index 0000000000..95cc3a639b
@@ -0,0 +1,5 @@
+# Locally calculated from download
+sha256  6f8b2b12704c0b37c22f32a3751688e7144f850faa715e85b26effdc5209cfd1  igt-gpu-tools-v1.28.tar.bz2
+
+# Hash for license file:
+sha256  1b7e266857b05808660f42369a4a797459d7b7bec7245e378aa28a8db2f213da  COPYING
package/igt-gpu-tools/igt-gpu-tools.mk new file +38 -0
new file mode 100644
index 0000000000..6aecd42429
@@ -0,0 +1,38 @@
+################################################################################
+#
+# igt-gpu-tools
+#
+################################################################################
+
+IGT_GPU_TOOLS_VERSION = 1.28
+IGT_GPU_TOOLS_SOURCE = igt-gpu-tools-v$(IGT_GPU_TOOLS_VERSION).tar.bz2
+IGT_GPU_TOOLS_SITE = https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/archive/v$(IGT_GPU_TOOLS_VERSION)
+IGT_GPU_TOOLS_LICENSE = MIT
+IGT_GPU_TOOLS_LICENSE_FILES = COPYING
+IGT_GPU_TOOLS_INSTALL_STAGING = YES
+IGT_GPU_TOOLS_DEPENDENCIES = host-pkgconf cairo elfutils kmod libdrm libglib2 libpciaccess pixman procps-ng zlib
+
+ifeq ($(BR2_PACKAGE_JSON_C),y)
+IGT_GPU_TOOLS_CONF_OPTS += -Drunner=enabled
+IGT_GPU_TOOLS_DEPENDENCIES += json-c
+else
+IGT_GPU_TOOLS_CONF_OPTS += -Drunner=disabled
+endif
+
+ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
+IGT_GPU_TOOLS_CONF_OPTS += -Dlibunwind=enabled
+IGT_GPU_TOOLS_DEPENDENCIES += libunwind
+else
+IGT_GPU_TOOLS_CONF_OPTS += -Dlibunwind=disabled
+endif
+
+# igt_stats is broken with Relocation link-time protections enabled
+# https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/102
+ifeq ($(BR2_RELRO_NONE),)
+define IGT_GPU_TOOLS_REMOVE_IGT_STATS
+	$(RM) -fr $(TARGET_DIR)/usr/bin/igt_stats
+endef
+IGT_GPU_TOOLS_POST_INSTALL_TARGET_HOOKS += IGT_GPU_TOOLS_REMOVE_IGT_STATS
+endif
+
+$(eval $(meson-package))
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hi Bernd:
can this be merged ?

Quoted 535 lines · 在 2023-10-27 01:25:10,"Bernd Kuhls" <[email protected]> 写道:

From: Gaël PORTAY <[email protected]>

IGT GPU Tools is a collection of tools for development and testing of the DRM drivers

[Bernd: v4
- add myself to DEVELOPERS
- add patches to fix build with musl & uClibc
- add dependencies to locales, mmu, wchar and headers >= 4.11
- rework libunwind dependency
- remove duplicate libglib2 dependency
v5
- added optional dependency to json_c
- remove broken igt_stats binary
v6
- updated patch series after upstream review]

---
Build-tested using this defconfig

BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_PACKAGE_IGT_GPU_TOOLS=y
BR2_PACKAGE_JSON_C=y
BR2_PER_PACKAGE_DIRECTORIES=y

bootlin-xtensa-uclibc [27/45]: FAILED
- build stopped with an error in the cairo package br-mips64-n64-full [33/45]: FAILED
- toolchain dates back to 2020 causing the known static_assert problem with uClibc, this is fixed in newer uClibc versions.

45 builds, 17 skipped, 2 build failed, 0 legal-info failed, 0 show-info failed

DEVELOPERS                                    |  1 +
package/Config.in                             |  1 +
...d-check-that-outb-is-present-in-io.h.patch | 34 +++++++
...limits.h-to-fix-build-with-musl-libc.patch | 89 +++++++++++++++++++
.../0003-lib-igt_aux.h-Fix-musl-build.patch   | 57 ++++++++++++
...-lib-igt_x86.c-Fix-musl-uclibc-build.patch | 43 +++++++++
...gt_halffloat.c-Fix-musl-uclibc-build.patch | 46 ++++++++++
...rks-gem_exec_tracer.c-Fix-musl-build.patch | 46 ++++++++++
package/igt-gpu-tools/Config.in               | 32 +++++++
package/igt-gpu-tools/igt-gpu-tools.hash      |  5 ++
package/igt-gpu-tools/igt-gpu-tools.mk        | 38 ++++++++
11 files changed, 392 insertions(+)

create mode 100644 package/igt-gpu-tools/0001-build-check-that-outb-is-present-in-io.h.patch create mode 100644 package/igt-gpu-tools/0002-Include-limits.h-to-fix-build-with-musl-libc.patch create mode 100644 package/igt-gpu-tools/0003-lib-igt_aux.h-Fix-musl-build.patch create mode 100644 package/igt-gpu-tools/0004-lib-igt_x86.c-Fix-musl-uclibc-build.patch create mode 100644 package/igt-gpu-tools/0005-lib-igt_halffloat.c-Fix-musl-uclibc-build.patch create mode 100644 package/igt-gpu-tools/0006-benchmarks-gem_exec_tracer.c-Fix-musl-build.patch create mode 100644 package/igt-gpu-tools/Config.in
create mode 100644 package/igt-gpu-tools/igt-gpu-tools.hash
create mode 100644 package/igt-gpu-tools/igt-gpu-tools.mk

DEVELOPERS +0 -0
index 56449b0d5f..a621fd762e 100644
@@ -366,6 +366,7 @@ F:	package/gpsd/

F: package/gptfdisk/
F: package/hddtemp/
F: package/hdparm/
+F: package/igt-gpu-tools/
F: package/intel-gmmlib/
F: package/intel-mediadriver/
F: package/intel-mediasdk/

package/Config.in +1 -0
index ecd8668ee7..97ec46730e 100644
@@ -318,6 +318,7 @@ comment "Graphic applications"
 	source "package/glmark2/Config.in"
 	source "package/glslsandbox-player/Config.in"
 	source "package/gnuplot/Config.in"
+	source "package/igt-gpu-tools/Config.in"
 	source "package/jhead/Config.in"
 	source "package/kmscube/Config.in"
 	source "package/libva-utils/Config.in"
package/igt-gpu-tools/0001-build-check-that-outb-is-present-in-io.h.patch new file +34 -0
new file mode 100644
index 0000000000..5c0b39ee7d
@@ -0,0 +1,34 @@
+From d5373adea6248c0fe41870d50b24fc4ed36c6490 Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <[email protected]>
+Date: Sat, 21 Oct 2023 16:47:07 +0200
+Subject: [PATCH] build: check that outb is present in io.h
+
+With glibc if io.h exists, inb/outb are always defined.
+However on musl, io.h always exists but it may not define inb/outb.
+
+Thus, igt-gpu-tools builds with musl on non-x86 platforms will fail to
+link. Fix this by checking for both io.h and that outb() is defined.
+
+Upstream: https://lists.freedesktop.org/archives/igt-dev/2023-October/063811.html
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index b35a00faa..cee8a7446 100644
+--- a/meson.build
++++ b/meson.build
+@@ -220,7 +220,7 @@ endif
+ if cc.has_header('libgen.h')
+ 	config.set('HAVE_LIBGEN_H', 1)
+ endif
+-if cc.has_header('sys/io.h')
++if cc.has_header('sys/io.h') and cc.has_function('outb', prefix: '#include <sys/io.h>')
+ 	config.set('HAVE_SYS_IO_H', 1)
+ endif
+ if cc.links('''
+-- 
+2.39.2
+
package/igt-gpu-tools/0002-Include-limits.h-to-fix-build-with-musl-libc.patch new file +89 -0
new file mode 100644
index 0000000000..303bc4a8bf
@@ -0,0 +1,89 @@
+From fea7a3189a6e42bb625c3742828849d6360f1435 Mon Sep 17 00:00:00 2001
+From: Stefano Ragni <[email protected]>
+Date: Sun, 22 Oct 2023 11:47:39 +0200
+Subject: [PATCH] Include limits.h to fix build with musl libc
+
+Original patch was added to void-linux:
+https://github.com/void-linux/void-packages/commit/ddfc1f66a0c571b420303c33aed29fd38ace4fc7
+
+Bug report with request to split the original patch into some
+functional changes:
+Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138
+
+Upstream: https://lists.freedesktop.org/archives/igt-dev/2023-October/063815.html
+
+Signed-off-by: Stefano Ragni <[email protected]>
+Signed-off-by: Bernd Kuhls <[email protected]>
+[Bernd: alphabetically sorted includes, removed includes not needed
+ anymore, backported to v1.28]
+---
+ lib/igt_aux.c                 | 1 +
+ lib/igt_eld.c                 | 1 +
+ lib/igt_hwmon.c               | 1 +
+ tests/intel/i915_pm_rpm.c     | 1 +
+ tests/kms_sysfs_edid_timing.c | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/lib/igt_aux.c b/lib/igt_aux.c
+index 18edc5ef9..d6aeb876b 100644
+--- a/lib/igt_aux.c
++++ b/lib/igt_aux.c
+@@ -31,6 +31,7 @@
+ #endif
+ #include <stdio.h>
+ #include <fcntl.h>
++#include <limits.h> // PATH_MAX
+ #include <pwd.h>
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
+diff --git a/lib/igt_eld.c b/lib/igt_eld.c
+index ef6625df1..6cec9abdd 100644
+--- a/lib/igt_eld.c
++++ b/lib/igt_eld.c
+@@ -28,6 +28,7 @@
+ #include <dirent.h>
+ #include <errno.h>
+ #include <glob.h>
++#include <limits.h> // PATH_MAX
+ #include <stdint.h>
+ #include <stdio.h>
+ #include <string.h>
+diff --git a/lib/igt_hwmon.c b/lib/igt_hwmon.c
+index 309019d69..6216a1607 100644
+--- a/lib/igt_hwmon.c
++++ b/lib/igt_hwmon.c
+@@ -2,6 +2,7 @@
+ /*
+  * Copyright © 2022 Intel Corporation
+  */
++#include <limits.h> // PATH_MAX
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <dirent.h>
+diff --git a/tests/intel/i915_pm_rpm.c b/tests/intel/i915_pm_rpm.c
+index 17413ffe5..bf0ab4ae7 100644
+--- a/tests/intel/i915_pm_rpm.c
++++ b/tests/intel/i915_pm_rpm.c
+@@ -35,6 +35,7 @@
+ 
+ #include <unistd.h>
+ #include <fcntl.h>
++#include <limits.h> // PATH_MAX
+ #include <dirent.h>
+ #include <sys/ioctl.h>
+ #include <sys/mman.h>
+diff --git a/tests/kms_sysfs_edid_timing.c b/tests/kms_sysfs_edid_timing.c
+index ee47a024e..c371a5e5e 100644
+--- a/tests/kms_sysfs_edid_timing.c
++++ b/tests/kms_sysfs_edid_timing.c
+@@ -24,6 +24,7 @@
+ 
+ #include <dirent.h>
+ #include <fcntl.h>
++#include <limits.h> // PATH_MAX
+ #include <sys/stat.h>
+ /**
+  * TEST: kms sysfs edid timing
+-- 
+2.39.2
+
package/igt-gpu-tools/0003-lib-igt_aux.h-Fix-musl-build.patch new file +57 -0
new file mode 100644
index 0000000000..eb8713a63d
@@ -0,0 +1,57 @@
+From 6695ea970627499d6eb5d5db2edead50ebb2511d Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <[email protected]>
+Date: Sun, 22 Oct 2023 11:57:32 +0200
+Subject: [PATCH] lib/igt_aux.h: Fix musl build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Inspired by https://www.openwall.com/lists/musl/2020/10/28/11
+
+Define sigev_notify_thread_id only when needed, quoting
+https://sourceware.org/bugzilla/show_bug.cgi?id=27417
+Both freebsd and musl actually have this macro defined under <signal.h>
+
+Fixes build error:
+
+../lib/igt_aux.c:191:20: error: ‘struct sigevent’ has no member named ‘_sigev_un’
+  191 |                 sev.sigev_notify_thread_id = __igt_sigiter.tid;
+
+../lib/igt_aux.c:1994:12: error: ‘struct sigevent’ has no member named ‘_sigev_un’
+ 1994 |         sev.sigev_notify_thread_id = gettid();
+
+Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138
+
+Upstream: https://lists.freedesktop.org/archives/igt-dev/2023-October/063814.html
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ lib/igt_aux.h | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/lib/igt_aux.h b/lib/igt_aux.h
+index fb76b0313..55f0aa3b5 100644
+--- a/lib/igt_aux.h
++++ b/lib/igt_aux.h
+@@ -29,6 +29,7 @@
+ #define IGT_AUX_H
+ 
+ #include <inttypes.h>
++#include <signal.h>
+ #include <stdbool.h>
+ #include <stddef.h>
+ #include <sys/time.h>
+@@ -48,7 +49,9 @@
+ # ifndef HAVE_GETTID
+ #  define gettid() (pid_t)(syscall(__NR_gettid))
+ # endif
+-# define sigev_notify_thread_id _sigev_un._tid
++# ifndef sigev_notify_thread_id
++#  define sigev_notify_thread_id _sigev_un._tid
++# endif
+ #endif
+ 
+ /* auxialiary igt helpers from igt_aux.c */
+-- 
+2.39.2
+
package/igt-gpu-tools/0004-lib-igt_x86.c-Fix-musl-uclibc-build.patch new file +43 -0
new file mode 100644
index 0000000000..fdb7e8b786
@@ -0,0 +1,43 @@
+From b47d645b3a1f476688201c23e9ef6fbccc891cec Mon Sep 17 00:00:00 2001
+From: Stefano Ragni <[email protected]>
+Date: Sun, 22 Oct 2023 12:06:01 +0200
+Subject: [PATCH] lib/igt_x86.c: Fix musl/uclibc build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Original patch was added to void-linux:
+https://github.com/void-linux/void-packages/commit/ddfc1f66a0c571b420303c33aed29fd38ace4fc7
+
+Fixes build error:
+../lib/igt_x86.c:295:6: error: ‘ifunc’ is not supported on this target
+  295 | void igt_memcpy_from_wc(void *dst, const void *src, unsigned long len)
+
+Bug report with request to split the original patch into some
+functional changes:
+Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138
+
+Upstream: https://lists.freedesktop.org/archives/igt-dev/2023-October/063813.html
+
+Signed-off-by: Stefano Ragni <[email protected]>
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ lib/igt_x86.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/igt_x86.c b/lib/igt_x86.c
+index 6ac700df0..8c102fd13 100644
+--- a/lib/igt_x86.c
++++ b/lib/igt_x86.c
+@@ -190,7 +190,7 @@ char *igt_x86_features_to_string(unsigned features, char *line)
+ }
+ #endif
+ 
+-#if defined(__x86_64__) && !defined(__clang__)
++#if defined(__x86_64__) && !defined(__clang__) && defined(__GLIBC__) && !defined(__UCLIBC__)
+ #pragma GCC push_options
+ #pragma GCC target("sse4.1")
+ #pragma GCC diagnostic ignored "-Wpointer-arith"
+-- 
+2.39.2
+
package/igt-gpu-tools/0005-lib-igt_halffloat.c-Fix-musl-uclibc-build.patch new file +46 -0
new file mode 100644
index 0000000000..07bdf39731
@@ -0,0 +1,46 @@
+From b81a041f3e07a377db7fa1ea79f83ed2d0183b61 Mon Sep 17 00:00:00 2001
+From: Stefano Ragni <[email protected]>
+Date: Sun, 22 Oct 2023 12:08:54 +0200
+Subject: [PATCH] lib/igt_halffloat.c: Fix musl/uclibc build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Original patch was added to void-linux:
+https://github.com/void-linux/void-packages/commit/ddfc1f66a0c571b420303c33aed29fd38ace4fc7
+
+Fixes build error:
+../lib/igt_halffloat.c:205:6: error: ‘ifunc’ is not supported on this target
+  205 | void igt_float_to_half(const float *f, uint16_t *h, unsigned int num)
+
+../lib/igt_halffloat.c:216:6: error: ‘ifunc’ is not supported on this target
+  216 | void igt_half_to_float(const uint16_t *h, float *f, unsigned int num)
+
+Bug report with request to split the original patch into some
+functional changes:
+Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138
+
+Upstream: https://lists.freedesktop.org/archives/igt-dev/2023-October/063816.html
+
+Signed-off-by: Stefano Ragni <[email protected]>
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ lib/igt_halffloat.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/igt_halffloat.c b/lib/igt_halffloat.c
+index 08ab05fce..5dbe08e01 100644
+--- a/lib/igt_halffloat.c
++++ b/lib/igt_halffloat.c
+@@ -162,7 +162,7 @@ static inline float _half_to_float(uint16_t val)
+ 	return fi.f;
+ }
+ 
+-#if defined(__x86_64__) && !defined(__clang__)
++#if defined(__x86_64__) && !defined(__clang__) && defined(__GLIBC__) && !defined(__UCLIBC__)
+ #pragma GCC push_options
+ #pragma GCC target("f16c")
+ 
+-- 
+2.39.2
+
package/igt-gpu-tools/0006-benchmarks-gem_exec_tracer.c-Fix-musl-build.patch new file +46 -0
new file mode 100644
index 0000000000..1ac7a37bd3
@@ -0,0 +1,46 @@
+From 5d4df590185ca31ebd1a9ce90922907c15658c17 Mon Sep 17 00:00:00 2001
+From: Mohammed Anas <[email protected]>
+Date: Sun, 22 Oct 2023 12:10:23 +0200
+Subject: [PATCH] benchmarks/gem_exec_tracer.c: Fix musl build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Original patch was added to void-linux:
+https://github.com/void-linux/void-packages/commit/111918317d06598fe1459dbe139923404f3f4b9d
+
+Fixes build error:
+../benchmarks/gem_exec_tracer.c:274:1: error: conflicting types for ‘ioctl’; have ‘int(int,  long unsigned int, ...)’
+  274 | ioctl(int fd, unsigned long request, ...)
+
+Bug report with request to split the original patch into some
+functional changes:
+Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138
+
+Upstream: https://lists.freedesktop.org/archives/igt-dev/2023-October/063817.html
+
+Signed-off-by: Mohammed Anas <[email protected]>
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ benchmarks/gem_exec_tracer.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/benchmarks/gem_exec_tracer.c b/benchmarks/gem_exec_tracer.c
+index 7e86473e4..3156dfc23 100644
+--- a/benchmarks/gem_exec_tracer.c
++++ b/benchmarks/gem_exec_tracer.c
+@@ -271,7 +271,11 @@ static int is_i915(int fd)
+ }
+ 
+ int
++#ifdef __GLIBC__
+ ioctl(int fd, unsigned long request, ...)
++#else
++ioctl(int fd, int request, ...)
++#endif
+ {
+ 	struct trace *t, **p;
+ 	va_list args;
+-- 
+2.39.2
+
package/igt-gpu-tools/Config.in new file +32 -0
new file mode 100644
index 0000000000..809c8e28ac
@@ -0,0 +1,32 @@
+config BR2_PACKAGE_IGT_GPU_TOOLS
+	bool "igt-gpu-tools"
+	depends on BR2_USE_MMU # fork()
+	depends on BR2_ENABLE_LOCALE
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_PACKAGE_HAS_UDEV
+	depends on BR2_USE_WCHAR # elfutils
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11 # linux/dma-buf.h
+	select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # procps-ng
+	select BR2_PACKAGE_CAIRO
+	select BR2_PACKAGE_CAIRO_PNG
+	select BR2_PACKAGE_ELFUTILS
+	select BR2_PACKAGE_KMOD
+	select BR2_PACKAGE_LIBDRM
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_LIBPCIACCESS
+	select BR2_PACKAGE_PIXMAN
+	select BR2_PACKAGE_PROCPS_NG
+	select BR2_PACKAGE_ZLIB
+	help
+	  IGT GPU Tools is a collection of tools for development and
+	  testing of the DRM drivers.
+
+	  https://gitlab.freedesktop.org/drm/igt-gpu-tools
+
+comment "igt-gpu-tools needs udev /dev management and toolchain w/ threads, wchar, dynamic library, locale, headers >= 4.11"
+	depends on BR2_USE_MMU
+	depends on !BR2_PACKAGE_HAS_UDEV || BR2_STATIC_LIBS || \
+		!BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR || \
+		!BR2_ENABLE_LOCALE || \
+		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11
package/igt-gpu-tools/igt-gpu-tools.hash new file +5 -0
new file mode 100644
index 0000000000..95cc3a639b
@@ -0,0 +1,5 @@
+# Locally calculated from download
+sha256  6f8b2b12704c0b37c22f32a3751688e7144f850faa715e85b26effdc5209cfd1  igt-gpu-tools-v1.28.tar.bz2
+
+# Hash for license file:
+sha256  1b7e266857b05808660f42369a4a797459d7b7bec7245e378aa28a8db2f213da  COPYING
package/igt-gpu-tools/igt-gpu-tools.mk new file +38 -0
new file mode 100644
index 0000000000..6aecd42429
@@ -0,0 +1,38 @@
+################################################################################
+#
+# igt-gpu-tools
+#
+################################################################################
+
+IGT_GPU_TOOLS_VERSION = 1.28
+IGT_GPU_TOOLS_SOURCE = igt-gpu-tools-v$(IGT_GPU_TOOLS_VERSION).tar.bz2
+IGT_GPU_TOOLS_SITE = https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/archive/v$(IGT_GPU_TOOLS_VERSION)
+IGT_GPU_TOOLS_LICENSE = MIT
+IGT_GPU_TOOLS_LICENSE_FILES = COPYING
+IGT_GPU_TOOLS_INSTALL_STAGING = YES
+IGT_GPU_TOOLS_DEPENDENCIES = host-pkgconf cairo elfutils kmod libdrm libglib2 libpciaccess pixman procps-ng zlib
+
+ifeq ($(BR2_PACKAGE_JSON_C),y)
+IGT_GPU_TOOLS_CONF_OPTS += -Drunner=enabled
+IGT_GPU_TOOLS_DEPENDENCIES += json-c
+else
+IGT_GPU_TOOLS_CONF_OPTS += -Drunner=disabled
+endif
+
+ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
+IGT_GPU_TOOLS_CONF_OPTS += -Dlibunwind=enabled
+IGT_GPU_TOOLS_DEPENDENCIES += libunwind
+else
+IGT_GPU_TOOLS_CONF_OPTS += -Dlibunwind=disabled
+endif
+
+# igt_stats is broken with Relocation link-time protections enabled
+# https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/102
+ifeq ($(BR2_RELRO_NONE),)
+define IGT_GPU_TOOLS_REMOVE_IGT_STATS
+	$(RM) -fr $(TARGET_DIR)/usr/bin/igt_stats
+endef
+IGT_GPU_TOOLS_POST_INSTALL_TARGET_HOOKS += IGT_GPU_TOOLS_REMOVE_IGT_STATS
+endif
+
+$(eval $(meson-package))
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
Quoted 5 lines · Andy Yan

Hi Bernd:
can this be merged ?

Hi,

This configuration creates mostly binaries which are not executable. One workaround is in place for one binary in particular (igt_stats) but this issue concerns most other binaries as well.

The issue is already reported in IGT [1] but there is currently no known solution to build with hardened toolchains. IMHO we should reflect this in the package with the correct RELRO dependency. I will send another version in a few minutes.

[1] https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/102

Francois

Quoted 544 lines · 在 2023-10-27 01:25:10,"Bernd Kuhls" <[email protected]> 写道:
Quoted 531 lines

From: Gaël PORTAY <[email protected]>

IGT GPU Tools is a collection of tools for development and testing of the DRM drivers

[Bernd: v4
- add myself to DEVELOPERS
- add patches to fix build with musl & uClibc
- add dependencies to locales, mmu, wchar and headers >= 4.11
- rework libunwind dependency
- remove duplicate libglib2 dependency
v5
- added optional dependency to json_c
- remove broken igt_stats binary
v6
- updated patch series after upstream review]

---
Build-tested using this defconfig

BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_PACKAGE_IGT_GPU_TOOLS=y
BR2_PACKAGE_JSON_C=y
BR2_PER_PACKAGE_DIRECTORIES=y

bootlin-xtensa-uclibc [27/45]: FAILED
- build stopped with an error in the cairo package br-mips64-n64-full [33/45]: FAILED
- toolchain dates back to 2020 causing the known static_assert problem with uClibc, this is fixed in newer uClibc versions.

45 builds, 17 skipped, 2 build failed, 0 legal-info failed, 0 show-info failed

DEVELOPERS                                    |  1 +
package/Config.in                             |  1 +
...d-check-that-outb-is-present-in-io.h.patch | 34 +++++++
...limits.h-to-fix-build-with-musl-libc.patch | 89 +++++++++++++++++++
.../0003-lib-igt_aux.h-Fix-musl-build.patch   | 57 ++++++++++++
...-lib-igt_x86.c-Fix-musl-uclibc-build.patch | 43 +++++++++
...gt_halffloat.c-Fix-musl-uclibc-build.patch | 46 ++++++++++
...rks-gem_exec_tracer.c-Fix-musl-build.patch | 46 ++++++++++
package/igt-gpu-tools/Config.in               | 32 +++++++
package/igt-gpu-tools/igt-gpu-tools.hash      |  5 ++
package/igt-gpu-tools/igt-gpu-tools.mk        | 38 ++++++++
11 files changed, 392 insertions(+)

create mode 100644 package/igt-gpu-tools/0001-build-check-that-outb-is-present-in-io.h.patch create mode 100644 package/igt-gpu-tools/0002-Include-limits.h-to-fix-build-with-musl-libc.patch create mode 100644 package/igt-gpu-tools/0003-lib-igt_aux.h-Fix-musl-build.patch create mode 100644 package/igt-gpu-tools/0004-lib-igt_x86.c-Fix-musl-uclibc-build.patch create mode 100644 package/igt-gpu-tools/0005-lib-igt_halffloat.c-Fix-musl-uclibc-build.patch create mode 100644 package/igt-gpu-tools/0006-benchmarks-gem_exec_tracer.c-Fix-musl-build.patch create mode 100644 package/igt-gpu-tools/Config.in
create mode 100644 package/igt-gpu-tools/igt-gpu-tools.hash
create mode 100644 package/igt-gpu-tools/igt-gpu-tools.mk

DEVELOPERS +0 -0
index 56449b0d5f..a621fd762e 100644
@@ -366,6 +366,7 @@ F:	package/gpsd/

F: package/gptfdisk/
F: package/hddtemp/
F: package/hdparm/
+F: package/igt-gpu-tools/
F: package/intel-gmmlib/
F: package/intel-mediadriver/
F: package/intel-mediasdk/

package/Config.in +1 -0
index ecd8668ee7..97ec46730e 100644
@@ -318,6 +318,7 @@ comment "Graphic applications"
 	source "package/glmark2/Config.in"
 	source "package/glslsandbox-player/Config.in"
 	source "package/gnuplot/Config.in"
+	source "package/igt-gpu-tools/Config.in"
 	source "package/jhead/Config.in"
 	source "package/kmscube/Config.in"
 	source "package/libva-utils/Config.in"
package/igt-gpu-tools/0001-build-check-that-outb-is-present-in-io.h.patch new file +34 -0
new file mode 100644
index 0000000000..5c0b39ee7d
@@ -0,0 +1,34 @@
+From d5373adea6248c0fe41870d50b24fc4ed36c6490 Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <[email protected]>
+Date: Sat, 21 Oct 2023 16:47:07 +0200
+Subject: [PATCH] build: check that outb is present in io.h
+
+With glibc if io.h exists, inb/outb are always defined.
+However on musl, io.h always exists but it may not define inb/outb.
+
+Thus, igt-gpu-tools builds with musl on non-x86 platforms will fail to
+link. Fix this by checking for both io.h and that outb() is defined.
+
+Upstream: https://lists.freedesktop.org/archives/igt-dev/2023-October/063811.html
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index b35a00faa..cee8a7446 100644
+--- a/meson.build
++++ b/meson.build
+@@ -220,7 +220,7 @@ endif
+ if cc.has_header('libgen.h')
+ 	config.set('HAVE_LIBGEN_H', 1)
+ endif
+-if cc.has_header('sys/io.h')
++if cc.has_header('sys/io.h') and cc.has_function('outb', prefix: '#include <sys/io.h>')
+ 	config.set('HAVE_SYS_IO_H', 1)
+ endif
+ if cc.links('''
+-- 
+2.39.2
+
package/igt-gpu-tools/0002-Include-limits.h-to-fix-build-with-musl-libc.patch new file +89 -0
new file mode 100644
index 0000000000..303bc4a8bf
@@ -0,0 +1,89 @@
+From fea7a3189a6e42bb625c3742828849d6360f1435 Mon Sep 17 00:00:00 2001
+From: Stefano Ragni <[email protected]>
+Date: Sun, 22 Oct 2023 11:47:39 +0200
+Subject: [PATCH] Include limits.h to fix build with musl libc
+
+Original patch was added to void-linux:
+https://github.com/void-linux/void-packages/commit/ddfc1f66a0c571b420303c33aed29fd38ace4fc7
+
+Bug report with request to split the original patch into some
+functional changes:
+Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138
+
+Upstream: https://lists.freedesktop.org/archives/igt-dev/2023-October/063815.html
+
+Signed-off-by: Stefano Ragni <[email protected]>
+Signed-off-by: Bernd Kuhls <[email protected]>
+[Bernd: alphabetically sorted includes, removed includes not needed
+ anymore, backported to v1.28]
+---
+ lib/igt_aux.c                 | 1 +
+ lib/igt_eld.c                 | 1 +
+ lib/igt_hwmon.c               | 1 +
+ tests/intel/i915_pm_rpm.c     | 1 +
+ tests/kms_sysfs_edid_timing.c | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/lib/igt_aux.c b/lib/igt_aux.c
+index 18edc5ef9..d6aeb876b 100644
+--- a/lib/igt_aux.c
++++ b/lib/igt_aux.c
+@@ -31,6 +31,7 @@
+ #endif
+ #include <stdio.h>
+ #include <fcntl.h>
++#include <limits.h> // PATH_MAX
+ #include <pwd.h>
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
+diff --git a/lib/igt_eld.c b/lib/igt_eld.c
+index ef6625df1..6cec9abdd 100644
+--- a/lib/igt_eld.c
++++ b/lib/igt_eld.c
+@@ -28,6 +28,7 @@
+ #include <dirent.h>
+ #include <errno.h>
+ #include <glob.h>
++#include <limits.h> // PATH_MAX
+ #include <stdint.h>
+ #include <stdio.h>
+ #include <string.h>
+diff --git a/lib/igt_hwmon.c b/lib/igt_hwmon.c
+index 309019d69..6216a1607 100644
+--- a/lib/igt_hwmon.c
++++ b/lib/igt_hwmon.c
+@@ -2,6 +2,7 @@
+ /*
+  * Copyright © 2022 Intel Corporation
+  */
++#include <limits.h> // PATH_MAX
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <dirent.h>
+diff --git a/tests/intel/i915_pm_rpm.c b/tests/intel/i915_pm_rpm.c
+index 17413ffe5..bf0ab4ae7 100644
+--- a/tests/intel/i915_pm_rpm.c
++++ b/tests/intel/i915_pm_rpm.c
+@@ -35,6 +35,7 @@
+ 
+ #include <unistd.h>
+ #include <fcntl.h>
++#include <limits.h> // PATH_MAX
+ #include <dirent.h>
+ #include <sys/ioctl.h>
+ #include <sys/mman.h>
+diff --git a/tests/kms_sysfs_edid_timing.c b/tests/kms_sysfs_edid_timing.c
+index ee47a024e..c371a5e5e 100644
+--- a/tests/kms_sysfs_edid_timing.c
++++ b/tests/kms_sysfs_edid_timing.c
+@@ -24,6 +24,7 @@
+ 
+ #include <dirent.h>
+ #include <fcntl.h>
++#include <limits.h> // PATH_MAX
+ #include <sys/stat.h>
+ /**
+  * TEST: kms sysfs edid timing
+-- 
+2.39.2
+
package/igt-gpu-tools/0003-lib-igt_aux.h-Fix-musl-build.patch new file +57 -0
new file mode 100644
index 0000000000..eb8713a63d
@@ -0,0 +1,57 @@
+From 6695ea970627499d6eb5d5db2edead50ebb2511d Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <[email protected]>
+Date: Sun, 22 Oct 2023 11:57:32 +0200
+Subject: [PATCH] lib/igt_aux.h: Fix musl build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Inspired by https://www.openwall.com/lists/musl/2020/10/28/11
+
+Define sigev_notify_thread_id only when needed, quoting
+https://sourceware.org/bugzilla/show_bug.cgi?id=27417
+Both freebsd and musl actually have this macro defined under <signal.h>
+
+Fixes build error:
+
+../lib/igt_aux.c:191:20: error: ‘struct sigevent’ has no member named ‘_sigev_un’
+  191 |                 sev.sigev_notify_thread_id = __igt_sigiter.tid;
+
+../lib/igt_aux.c:1994:12: error: ‘struct sigevent’ has no member named ‘_sigev_un’
+ 1994 |         sev.sigev_notify_thread_id = gettid();
+
+Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138
+
+Upstream: https://lists.freedesktop.org/archives/igt-dev/2023-October/063814.html
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ lib/igt_aux.h | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/lib/igt_aux.h b/lib/igt_aux.h
+index fb76b0313..55f0aa3b5 100644
+--- a/lib/igt_aux.h
++++ b/lib/igt_aux.h
+@@ -29,6 +29,7 @@
+ #define IGT_AUX_H
+ 
+ #include <inttypes.h>
++#include <signal.h>
+ #include <stdbool.h>
+ #include <stddef.h>
+ #include <sys/time.h>
+@@ -48,7 +49,9 @@
+ # ifndef HAVE_GETTID
+ #  define gettid() (pid_t)(syscall(__NR_gettid))
+ # endif
+-# define sigev_notify_thread_id _sigev_un._tid
++# ifndef sigev_notify_thread_id
++#  define sigev_notify_thread_id _sigev_un._tid
++# endif
+ #endif
+ 
+ /* auxialiary igt helpers from igt_aux.c */
+-- 
+2.39.2
+
package/igt-gpu-tools/0004-lib-igt_x86.c-Fix-musl-uclibc-build.patch new file +43 -0
new file mode 100644
index 0000000000..fdb7e8b786
@@ -0,0 +1,43 @@
+From b47d645b3a1f476688201c23e9ef6fbccc891cec Mon Sep 17 00:00:00 2001
+From: Stefano Ragni <[email protected]>
+Date: Sun, 22 Oct 2023 12:06:01 +0200
+Subject: [PATCH] lib/igt_x86.c: Fix musl/uclibc build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Original patch was added to void-linux:
+https://github.com/void-linux/void-packages/commit/ddfc1f66a0c571b420303c33aed29fd38ace4fc7
+
+Fixes build error:
+../lib/igt_x86.c:295:6: error: ‘ifunc’ is not supported on this target
+  295 | void igt_memcpy_from_wc(void *dst, const void *src, unsigned long len)
+
+Bug report with request to split the original patch into some
+functional changes:
+Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138
+
+Upstream: https://lists.freedesktop.org/archives/igt-dev/2023-October/063813.html
+
+Signed-off-by: Stefano Ragni <[email protected]>
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ lib/igt_x86.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/igt_x86.c b/lib/igt_x86.c
+index 6ac700df0..8c102fd13 100644
+--- a/lib/igt_x86.c
++++ b/lib/igt_x86.c
+@@ -190,7 +190,7 @@ char *igt_x86_features_to_string(unsigned features, char *line)
+ }
+ #endif
+ 
+-#if defined(__x86_64__) && !defined(__clang__)
++#if defined(__x86_64__) && !defined(__clang__) && defined(__GLIBC__) && !defined(__UCLIBC__)
+ #pragma GCC push_options
+ #pragma GCC target("sse4.1")
+ #pragma GCC diagnostic ignored "-Wpointer-arith"
+-- 
+2.39.2
+
package/igt-gpu-tools/0005-lib-igt_halffloat.c-Fix-musl-uclibc-build.patch new file +46 -0
new file mode 100644
index 0000000000..07bdf39731
@@ -0,0 +1,46 @@
+From b81a041f3e07a377db7fa1ea79f83ed2d0183b61 Mon Sep 17 00:00:00 2001
+From: Stefano Ragni <[email protected]>
+Date: Sun, 22 Oct 2023 12:08:54 +0200
+Subject: [PATCH] lib/igt_halffloat.c: Fix musl/uclibc build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Original patch was added to void-linux:
+https://github.com/void-linux/void-packages/commit/ddfc1f66a0c571b420303c33aed29fd38ace4fc7
+
+Fixes build error:
+../lib/igt_halffloat.c:205:6: error: ‘ifunc’ is not supported on this target
+  205 | void igt_float_to_half(const float *f, uint16_t *h, unsigned int num)
+
+../lib/igt_halffloat.c:216:6: error: ‘ifunc’ is not supported on this target
+  216 | void igt_half_to_float(const uint16_t *h, float *f, unsigned int num)
+
+Bug report with request to split the original patch into some
+functional changes:
+Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138
+
+Upstream: https://lists.freedesktop.org/archives/igt-dev/2023-October/063816.html
+
+Signed-off-by: Stefano Ragni <[email protected]>
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ lib/igt_halffloat.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/igt_halffloat.c b/lib/igt_halffloat.c
+index 08ab05fce..5dbe08e01 100644
+--- a/lib/igt_halffloat.c
++++ b/lib/igt_halffloat.c
+@@ -162,7 +162,7 @@ static inline float _half_to_float(uint16_t val)
+ 	return fi.f;
+ }
+ 
+-#if defined(__x86_64__) && !defined(__clang__)
++#if defined(__x86_64__) && !defined(__clang__) && defined(__GLIBC__) && !defined(__UCLIBC__)
+ #pragma GCC push_options
+ #pragma GCC target("f16c")
+ 
+-- 
+2.39.2
+
package/igt-gpu-tools/0006-benchmarks-gem_exec_tracer.c-Fix-musl-build.patch new file +46 -0
new file mode 100644
index 0000000000..1ac7a37bd3
@@ -0,0 +1,46 @@
+From 5d4df590185ca31ebd1a9ce90922907c15658c17 Mon Sep 17 00:00:00 2001
+From: Mohammed Anas <[email protected]>
+Date: Sun, 22 Oct 2023 12:10:23 +0200
+Subject: [PATCH] benchmarks/gem_exec_tracer.c: Fix musl build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Original patch was added to void-linux:
+https://github.com/void-linux/void-packages/commit/111918317d06598fe1459dbe139923404f3f4b9d
+
+Fixes build error:
+../benchmarks/gem_exec_tracer.c:274:1: error: conflicting types for ‘ioctl’; have ‘int(int,  long unsigned int, ...)’
+  274 | ioctl(int fd, unsigned long request, ...)
+
+Bug report with request to split the original patch into some
+functional changes:
+Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138
+
+Upstream: https://lists.freedesktop.org/archives/igt-dev/2023-October/063817.html
+
+Signed-off-by: Mohammed Anas <[email protected]>
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ benchmarks/gem_exec_tracer.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/benchmarks/gem_exec_tracer.c b/benchmarks/gem_exec_tracer.c
+index 7e86473e4..3156dfc23 100644
+--- a/benchmarks/gem_exec_tracer.c
++++ b/benchmarks/gem_exec_tracer.c
+@@ -271,7 +271,11 @@ static int is_i915(int fd)
+ }
+ 
+ int
++#ifdef __GLIBC__
+ ioctl(int fd, unsigned long request, ...)
++#else
++ioctl(int fd, int request, ...)
++#endif
+ {
+ 	struct trace *t, **p;
+ 	va_list args;
+-- 
+2.39.2
+
package/igt-gpu-tools/Config.in new file +32 -0
new file mode 100644
index 0000000000..809c8e28ac
@@ -0,0 +1,32 @@
+config BR2_PACKAGE_IGT_GPU_TOOLS
+	bool "igt-gpu-tools"
+	depends on BR2_USE_MMU # fork()
+	depends on BR2_ENABLE_LOCALE
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_PACKAGE_HAS_UDEV
+	depends on BR2_USE_WCHAR # elfutils
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11 # linux/dma-buf.h
+	select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # procps-ng
+	select BR2_PACKAGE_CAIRO
+	select BR2_PACKAGE_CAIRO_PNG
+	select BR2_PACKAGE_ELFUTILS
+	select BR2_PACKAGE_KMOD
+	select BR2_PACKAGE_LIBDRM
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_LIBPCIACCESS
+	select BR2_PACKAGE_PIXMAN
+	select BR2_PACKAGE_PROCPS_NG
+	select BR2_PACKAGE_ZLIB
+	help
+	  IGT GPU Tools is a collection of tools for development and
+	  testing of the DRM drivers.
+
+	  https://gitlab.freedesktop.org/drm/igt-gpu-tools
+
+comment "igt-gpu-tools needs udev /dev management and toolchain w/ threads, wchar, dynamic library, locale, headers >= 4.11"
+	depends on BR2_USE_MMU
+	depends on !BR2_PACKAGE_HAS_UDEV || BR2_STATIC_LIBS || \
+		!BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR || \
+		!BR2_ENABLE_LOCALE || \
+		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11
package/igt-gpu-tools/igt-gpu-tools.hash new file +5 -0
new file mode 100644
index 0000000000..95cc3a639b
@@ -0,0 +1,5 @@
+# Locally calculated from download
+sha256  6f8b2b12704c0b37c22f32a3751688e7144f850faa715e85b26effdc5209cfd1  igt-gpu-tools-v1.28.tar.bz2
+
+# Hash for license file:
+sha256  1b7e266857b05808660f42369a4a797459d7b7bec7245e378aa28a8db2f213da  COPYING
package/igt-gpu-tools/igt-gpu-tools.mk new file +38 -0
new file mode 100644
index 0000000000..6aecd42429
@@ -0,0 +1,38 @@
+################################################################################
+#
+# igt-gpu-tools
+#
+################################################################################
+
+IGT_GPU_TOOLS_VERSION = 1.28
+IGT_GPU_TOOLS_SOURCE = igt-gpu-tools-v$(IGT_GPU_TOOLS_VERSION).tar.bz2
+IGT_GPU_TOOLS_SITE = https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/archive/v$(IGT_GPU_TOOLS_VERSION)
+IGT_GPU_TOOLS_LICENSE = MIT
+IGT_GPU_TOOLS_LICENSE_FILES = COPYING
+IGT_GPU_TOOLS_INSTALL_STAGING = YES
+IGT_GPU_TOOLS_DEPENDENCIES = host-pkgconf cairo elfutils kmod libdrm libglib2 libpciaccess pixman procps-ng zlib
+
+ifeq ($(BR2_PACKAGE_JSON_C),y)
+IGT_GPU_TOOLS_CONF_OPTS += -Drunner=enabled
+IGT_GPU_TOOLS_DEPENDENCIES += json-c
+else
+IGT_GPU_TOOLS_CONF_OPTS += -Drunner=disabled
+endif
+
+ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
+IGT_GPU_TOOLS_CONF_OPTS += -Dlibunwind=enabled
+IGT_GPU_TOOLS_DEPENDENCIES += libunwind
+else
+IGT_GPU_TOOLS_CONF_OPTS += -Dlibunwind=disabled
+endif
+
+# igt_stats is broken with Relocation link-time protections enabled
+# https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/102
+ifeq ($(BR2_RELRO_NONE),)
+define IGT_GPU_TOOLS_REMOVE_IGT_STATS
+	$(RM) -fr $(TARGET_DIR)/usr/bin/igt_stats
+endef
+IGT_GPU_TOOLS_POST_INSTALL_TARGET_HOOKS += IGT_GPU_TOOLS_REMOVE_IGT_STATS
+endif
+
+$(eval $(meson-package))
Signature · 1 line
2.39.2
Quoted 4 lines
Quoted 4 lines

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot