package/igt-gpu-tools: new package
PATCH v5 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]
---
A v6 version is pending due to reviews for the musl patch series.
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 | 215 ++++++++++++++++++ .../0003-lib-igt_aux.h-Fix-musl-build.patch | 46 ++++ ...-lib-igt_x86.c-Fix-musl-uclibc-build.patch | 42 ++++ ...gt_halffloat.c-Fix-musl-uclibc-build.patch | 45 ++++ ...rks-gem_exec_tracer.c-Fix-musl-build.patch | 45 ++++ ...arks-gem_syslatency.c-Fix-musl-build.patch | 42 ++++ 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 ++++ 12 files changed, 546 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/0007-benchmarks-gem_syslatency.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
@@ -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
@@ -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
@@ -0,0 +1,34 @@ +From 9a433c2602b15ba329b9276121a6b0c1aca51077 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://patchwork.freedesktop.org/series/125427/ + +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 +215 -0
215 lines not on this page · raw message
package/igt-gpu-tools/0003-lib-igt_aux.h-Fix-musl-build.patch new file +46 -0
46 lines not on this page · raw message
package/igt-gpu-tools/0004-lib-igt_x86.c-Fix-musl-uclibc-build.patch new file +42 -0
42 lines not on this page · raw message
package/igt-gpu-tools/0005-lib-igt_halffloat.c-Fix-musl-uclibc-build.patch new file +45 -0
45 lines not on this page · raw message
package/igt-gpu-tools/0006-benchmarks-gem_exec_tracer.c-Fix-musl-build.patch new file +45 -0
45 lines not on this page · raw message
package/igt-gpu-tools/0007-benchmarks-gem_syslatency.c-Fix-musl-build.patch new file +42 -0
42 lines not on this page · raw message
package/igt-gpu-tools/Config.in new file +32 -0
@@ -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
@@ -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
@@ -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
Hi Bernd,
Quoted 660 lines · Bernd Kuhls
From: Gaël PORTAY <[email protected]>
IGT GPU Tools is a collection of tools for development and testing of the DRM drivers
Signed-off-by Gaël PORTAY <[email protected]>Signed-off-by Andy Yan <[email protected]>Signed-off-by Bernd Kuhls <[email protected]>[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 tojson_c
- remove brokenigt_statsbinary]
---
A v6 version is pending due to reviews for the musl patch series.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 | 215 ++++++++++++++++++ .../0003-lib-igt_aux.h-Fix-musl-build.patch | 46 ++++ ...-lib-igt_x86.c-Fix-musl-uclibc-build.patch | 42 ++++ ...gt_halffloat.c-Fix-musl-uclibc-build.patch | 45 ++++ ...rks-gem_exec_tracer.c-Fix-musl-build.patch | 45 ++++ ...arks-gem_syslatency.c-Fix-musl-build.patch | 42 ++++ 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 ++++ 12 files changed, 546 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/0007-benchmarks-gem_syslatency.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.mkDEVELOPERS +1
-0@@ -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@@ -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@@ -0,0 +1,34 @@ +From 9a433c2602b15ba329b9276121a6b0c1aca51077 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://patchwork.freedesktop.org/series/125427/ + +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 +215
-0@@ -0,0 +1,215 @@ +From 46cac4c5d108bfe6ee22ea4efb6dbb48e2b7e43f 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: +https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138 + +Upstream: https://patchwork.freedesktop.org/series/125427/ + +Signed-off-by: Bernd Kuhls <[email protected]> +--- + lib/amdgpu/amd_pci_unplug.c | 1 + + lib/igt_audio.c | 1 + + lib/igt_aux.c | 1 + + lib/igt_device_scan.c | 1 + + lib/igt_eld.c | 1 + + lib/igt_frame.c | 1 + + lib/igt_hwmon.c | 1 + + runner/executor.c | 1 + + runner/runner_tests.c | 1 + + tests/device_reset.c | 1 + + tests/intel/i915_pm_rpm.c | 1 + + tests/kms_sysfs_edid_timing.c | 1 + + tests/testdisplay.c | 1 + + tests/tools_test.c | 1 + + tools/igt_compliance_utils.c | 1 + + 15 files changed, 15 insertions(+) + +diff --git a/lib/amdgpu/amd_pci_unplug.c b/lib/amdgpu/amd_pci_unplug.c +index 078398b5e..554f489c6 100644 +--- a/lib/amdgpu/amd_pci_unplug.c ++++ b/lib/amdgpu/amd_pci_unplug.c +@@ -21,6 +21,7 @@ + * + */ + #include <linux/limits.h> ++#include <limits.h> // PATH_MAX + #include <fcntl.h> + #include <sys/stat.h> + #include <pthread.h> +diff --git a/lib/igt_audio.c b/lib/igt_audio.c +index e0b1bafe1..dd5e0d2c1 100644 +--- a/lib/igt_audio.c ++++ b/lib/igt_audio.c +@@ -26,6 +26,7 @@ + + #include "config.h" + ++#include <limits.h> // PATH_MAX + #include <errno.h> + #include <fcntl.h> + #include <gsl/gsl_fft_real.h> +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_device_scan.c b/lib/igt_device_scan.c +index f4f95fef3..23b17a715 100644 +--- a/lib/igt_device_scan.c ++++ b/lib/igt_device_scan.c +@@ -27,6 +27,7 @@ + #include "igt_list.h" + #include "intel_chipset.h" + ++#include <limits.h> // PATH_MAX + #include <ctype.h> + #include <dirent.h> + #include <fcntl.h> +diff --git a/lib/igt_eld.c b/lib/igt_eld.c +index ef6625df1..3e9b8a404 100644 +--- a/lib/igt_eld.c ++++ b/lib/igt_eld.c +@@ -26,6 +26,7 @@ + #include "config.h" + + #include <dirent.h> ++#include <limits.h> // PATH_MAX + #include <errno.h> + #include <glob.h> + #include <stdint.h> +diff --git a/lib/igt_frame.c b/lib/igt_frame.c +index 45523a79f..86b8aad4d 100644 +--- a/lib/igt_frame.c ++++ b/lib/igt_frame.c +@@ -26,6 +26,7 @@ + + #include "config.h" + ++#include <limits.h> // PATH_MAX + #include <fcntl.h> + #include <pixman.h> + #include <cairo.h> +diff --git a/lib/igt_hwmon.c b/lib/igt_hwmon.c +index f37ced2d9..53c346e73 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/runner/executor.c b/runner/executor.c +index d3e6296dd..d2737af89 100644 +--- a/runner/executor.c ++++ b/runner/executor.c +@@ -1,6 +1,7 @@ + #include <ctype.h> + #include <errno.h> + #include <fcntl.h> ++#include <limits.h> // PATH_MAX + #include <glib.h> + #ifdef __linux__ + #include <linux/watchdog.h> +diff --git a/runner/runner_tests.c b/runner/runner_tests.c +index a7e968f85..6d605251f 100644 +--- a/runner/runner_tests.c ++++ b/runner/runner_tests.c +@@ -1,5 +1,6 @@ + #include <dirent.h> + #include <fcntl.h> ++#include <limits.h> // PATH_MAX + #include <sys/stat.h> + #include <sys/types.h> + #include <unistd.h> +diff --git a/tests/device_reset.c b/tests/device_reset.c +index 9ebd479df..ecb01d29f 100644 +--- a/tests/device_reset.c ++++ b/tests/device_reset.c +@@ -3,6 +3,7 @@ + * Copyright(c) 2020 Intel Corporation. All rights reserved. + */ + #include <fcntl.h> ++#include <limits.h> // PATH_MAX + #include <sys/ioctl.h> + #include <sys/stat.h> + #include <signal.h> +diff --git a/tests/intel/i915_pm_rpm.c b/tests/intel/i915_pm_rpm.c +index 2b0a63bde..289dfc508 100644 +--- a/tests/intel/i915_pm_rpm.c ++++ b/tests/intel/i915_pm_rpm.c +@@ -27,6 +27,7 @@ + + #include "config.h" + ++#include <limits.h> // PATH_MAX + #include <stdio.h> + #include <stdint.h> + #include <stdbool.h> +diff --git a/tests/kms_sysfs_edid_timing.c b/tests/kms_sysfs_edid_timing.c +index ee47a024e..5df2da533 100644 +--- a/tests/kms_sysfs_edid_timing.c ++++ b/tests/kms_sysfs_edid_timing.c +@@ -22,6 +22,7 @@ + */ + #include "igt.h" + ++#include <limits.h> // PATH_MAX + #include <dirent.h> + #include <fcntl.h> + #include <sys/stat.h> +diff --git a/tests/testdisplay.c b/tests/testdisplay.c +index 42218210f..4c31c0e59 100644 +--- a/tests/testdisplay.c ++++ b/tests/testdisplay.c +@@ -58,6 +58,7 @@ + #include <strings.h> + #include <unistd.h> + #include <termios.h> ++#include <limits.h> // PATH_MAX + #include <sys/poll.h> + #include <sys/time.h> + #include <sys/ioctl.h> +diff --git a/tests/tools_test.c b/tests/tools_test.c +index 8412ba521..f36a61927 100644 +--- a/tests/tools_test.c ++++ b/tests/tools_test.c +@@ -26,6 +26,7 @@ + #include <sys/types.h> + #include <sys/stat.h> + #include <fcntl.h> ++#include <limits.h> // PATH_MAX + #include <libgen.h> + #include <unistd.h> + #ifdef __linux__ +diff --git a/tools/igt_compliance_utils.c b/tools/igt_compliance_utils.c +index 0faf3fc87..f6bd970e3 100644 +--- a/tools/igt_compliance_utils.c ++++ b/tools/igt_compliance_utils.c +@@ -24,6 +24,7 @@ + */ + + #include "igt.h" ++#include <limits.h> // PATH_MAX + #include <stdio.h> + #include <string.h> + #include <stdlib.h> +-- +2.39.2 +package/igt-gpu-tools/0003-lib-igt_aux.h-Fix-musl-build.patch new file +46
-0@@ -0,0 +1,46 @@ +From 3359989ee93c73f574dde5ed076536dd4d4398a6 Mon Sep 17 00:00:00 2001 +From: Stefano Ragni <[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 + +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: +https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138 + +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(); + +Upstream: https://patchwork.freedesktop.org/series/125427/ + +Signed-off-by: Bernd Kuhls <[email protected]> +--- + lib/igt_aux.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/igt_aux.h b/lib/igt_aux.h +index fb76b0313..a13e8156a 100644 +--- a/lib/igt_aux.h ++++ b/lib/igt_aux.h +@@ -48,7 +48,7 @@ + # ifndef HAVE_GETTID + # define gettid() (pid_t)(syscall(__NR_gettid)) + # endif +-# define sigev_notify_thread_id _sigev_un._tid ++# define sigev_notify_thread_id sigev_notify_function + #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 +42
-0@@ -0,0 +1,42 @@ +From d68ce435fcfa52038e43c0997898e9c706fe36a4 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 + +Bug report with request to split the original patch into some +functional changes: +https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138 + +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) + +Upstream: https://patchwork.freedesktop.org/series/125427/ + +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 +45
-0@@ -0,0 +1,45 @@ +From 7da0501278532d4dde7b9fddd6300c24d4172628 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 + +Bug report with request to split the original patch into some +functional changes: +https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138 + +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) + +Upstream: https://patchwork.freedesktop.org/series/125427/ + +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 +45
-0@@ -0,0 +1,45 @@ +From d69dbc4683cbefacf0901f4ff96973850ad33500 Mon Sep 17 00:00:00 2001 +From: mhmdanas <[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 + +Bug report with request to split the original patch into some +functional changes: +https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138 + +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, ...) + +Upstream: https://patchwork.freedesktop.org/series/125427/ + +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/0007-benchmarks-gem_syslatency.c-Fix-musl-build.patch new file +42
-0@@ -0,0 +1,42 @@ +From 23654df67b8bf8170a8650d9a350345add52c742 Mon Sep 17 00:00:00 2001 +From: Stefano Ragni <[email protected]> +Date: Sun, 22 Oct 2023 12:11:43 +0200 +Subject: [PATCH] benchmarks/gem_syslatency.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/ddfc1f66a0c571b420303c33aed29fd38ace4fc7 + +Bug report with request to split the original patch into some +functional changes: +https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138 + +Fixes build error: +../benchmarks/gem_syslatency.c:166:13: error: ‘union <anonymous>’ has no member named ‘sigev_notify_thread_id’ + 166 | sev.sigev_notify_thread_id = gettid(); + +Upstream: https://patchwork.freedesktop.org/series/125427/ + +Signed-off-by: Bernd Kuhls <[email protected]> +--- + benchmarks/gem_syslatency.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/benchmarks/gem_syslatency.c b/benchmarks/gem_syslatency.c +index 312c428b7..e0740fc11 100644 +--- a/benchmarks/gem_syslatency.c ++++ b/benchmarks/gem_syslatency.c +@@ -46,6 +46,8 @@ + #include <linux/unistd.h> + #endif + ++#define sigev_notify_thread_id sigev_notify_function ++ + #include "i915/gem_create.h" + #include "i915/gem_ring.h" + #include "igt_aux.h" +-- +2.39.2 +package/igt-gpu-tools/Config.in new file +32
-0@@ -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_11package/igt-gpu-tools/igt-gpu-tools.hash new file +5
-0@@ -0,0 +1,5 @@ +# Locally calculated from download +sha256 6f8b2b12704c0b37c22f32a3751688e7144f850faa715e85b26effdc5209cfd1 igt-gpu-tools-v1.28.tar.bz2 + +# Hash for license file: +sha256 1b7e266857b05808660f42369a4a797459d7b7bec7245e378aa28a8db2f213da COPYINGpackage/igt-gpu-tools/igt-gpu-tools.mk new file +26
-0@@ -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
package/igt-gpu-tools/igt-gpu-tools.mk line 36
Quoted 10 lines
package/igt-gpu-tools/igt-gpu-tools.mk new file +10
-0+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
This is a workaround for igt_stats only but the issue affects more, if not almost all IGT binaries. A few more random examples:
# /usr/libexec/igt-gpu-tools/drm_read
drm_read[101]: segfault at 2a9f6 ip 000000000002a9f6 sp 00007ffffcd71c08 error 14 in drm_read[55a806cda000+2000] likely on CPU 0 (core 0, socket 0)
Code: Unable to access opcode bytes at 0x2a9cc.
Segmentation fault
# /usr/libexec/igt-gpu-tools/gem_stress
gem_stress[102]: segfault at 2a9f6 ip 000000000002a9f6 sp 00007fff7f092068 error 14 in gem_stress[561401c9f000+2000] likely on CPU 0 (core 0, socket 0)
Code: Unable to access opcode bytes at 0x2a9cc.
Segmentation fault
# /usr/libexec/igt-gpu-tools/perf_pmu
perf_pmu[103]: segfault at 2a9f6 ip 000000000002a9f6 sp 00007fff5ffa43a8 error 14 in perf_pmu[5645b1d9e000+4000] likely on CPU 0 (core 0, socket 0)
Code: Unable to access opcode bytes at 0x2a9cc.
Segmentation faultInstead I would add a package dependency:
package/igt-gpu-tools/Config.in +1 -0
@@ -7,6 +7,7 @@ config BR2_PACKAGE_IGT_GPU_TOOLS 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 + depends on BR2_RELRO_NONE # prevent segfault in IGT binaries select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # procps-ng select BR2_PACKAGE_CAIRO select BR2_PACKAGE_CAIRO_PNG
Francois
Quoted 5 lines
package/igt-gpu-tools/igt-gpu-tools.mk new file +2
-0+ +$(eval $(meson-package))Signature · 1 line
2.39.2
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
A message that is not in the archive (sent off-list or not yet received): ZTgVKtuCBV708jzY__8992.36735874496$1698174287$gmane$org@fdugast-desk.home
Am Tue, 24 Oct 2023 21:04:10 +0200 schrieb Francois Dugast:
Quoted 2 lines
This is a workaround for
igt_statsonly but the issue affects more, if not almost all IGT binaries. A few more random examples:
[...]
Quoted 1 line
Instead I would add a package dependency:
[...]
Quoted 1 line
+ depends on
BR2_RELRO_NONE# prevent segfault in IGT binaries
The tool I am interested in, intel_gpu_top, works fine with my private config BR2_RELRO_FULL=y so depending on BR2_RELRO_NONE is too much imho. Are the chances that the bug causing segfaults can be fixed?
Regards, Bernd
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot