Skip to contentSkip to conversation

igt: Fix musl build

PATCH Superseded Bernd Kuhls 2 participants 11 messages Oct 22, 2023 – Oct 24, 2023

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover igt: Fix musl build

Hi,

this is my first patch series I am sending so please be patient ;)

Currently there are efforts underway to add a igt-gpu-tools package to the buildroot project. Besides glibc buildroot also supports musl- and uClibc-based toolchains. While testing the new package it turns out that igt-gpu-tools does not build with other libc's out of the box, see
https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138

This patch series tries to solve the request from the bug tracker that the void-linux patch is "splitted into some functional changes".

During build I added only those parts of the void-linux patch which were needed to fix build errors, I quoted those errors in each patch message. Besides that, due to my non-knowledge of C, I can not provide any more information.

Regards, Bernd

Bernd Kuhls (1):
build: check that outb is present in io.h

Stefano Ragni (5):
Include limits.h to fix build with musl libc
lib/igt_aux.h: Fix musl build
lib/igt_x86.c: Fix musl/uclibc build
lib/igt_halffloat.c: Fix musl/uclibc build
benchmarks/gem_syslatency.c: Fix musl build

mhmdanas (1):
benchmarks/gem_exec_tracer.c: Fix musl build

 benchmarks/gem_exec_tracer.c  | 4 ++++
 benchmarks/gem_syslatency.c   | 2 ++
 lib/amdgpu/amd_pci_unplug.c   | 1 +
 lib/igt_audio.c               | 1 +
 lib/igt_aux.c                 | 1 +
 lib/igt_aux.h                 | 2 +-
 lib/igt_device_scan.c         | 1 +
 lib/igt_eld.c                 | 1 +
 lib/igt_frame.c               | 1 +
 lib/igt_halffloat.c           | 2 +-
 lib/igt_hwmon.c               | 1 +
 lib/igt_x86.c                 | 2 +-
 meson.build                   | 2 +-
 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 +
 21 files changed, 25 insertions(+), 4 deletions(-)
Signature · 1 line
2.39.2
#1 lore raw

PATCH 1/7 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.

---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
index b35a00faa..cee8a7446 100644
@@ -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('''
Signature · 1 line
2.39.2
#2 lore raw

PATCH 2/7 Include limits.h to fix build with musl libc

In reply to Bernd Kuhls

From: Stefano Ragni <[email protected]>

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

---
 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(+)
lib/amdgpu/amd_pci_unplug.c +1 -0
index 078398b5e..554f489c6 100644
@@ -21,6 +21,7 @@
  *
 */
 #include <linux/limits.h>
+#include <limits.h> // PATH_MAX
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <pthread.h>
lib/igt_audio.c +1 -0
index e0b1bafe1..dd5e0d2c1 100644
@@ -26,6 +26,7 @@
 
 #include "config.h"
 
+#include <limits.h> // PATH_MAX
 #include <errno.h>
 #include <fcntl.h>
 #include <gsl/gsl_fft_real.h>
lib/igt_aux.c +1 -0
index 18edc5ef9..d6aeb876b 100644
@@ -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>
lib/igt_device_scan.c +1 -0
index f4f95fef3..23b17a715 100644
@@ -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>
lib/igt_eld.c +1 -0
index ef6625df1..3e9b8a404 100644
@@ -26,6 +26,7 @@
 #include "config.h"
 
 #include <dirent.h>
+#include <limits.h> // PATH_MAX
 #include <errno.h>
 #include <glob.h>
 #include <stdint.h>
lib/igt_frame.c +1 -0
index 45523a79f..86b8aad4d 100644
@@ -26,6 +26,7 @@
 
 #include "config.h"
 
+#include <limits.h> // PATH_MAX
 #include <fcntl.h>
 #include <pixman.h>
 #include <cairo.h>
lib/igt_hwmon.c +1 -0
index f37ced2d9..53c346e73 100644
@@ -2,6 +2,7 @@
 /*
  * Copyright © 2022 Intel Corporation
  */
+#include <limits.h> // PATH_MAX
 #include <sys/stat.h>
 #include <sys/sysmacros.h>
 #include <dirent.h>
runner/executor.c +1 -0
index d3e6296dd..d2737af89 100644
@@ -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>
runner/runner_tests.c +1 -0
index a7e968f85..6d605251f 100644
@@ -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>
tests/device_reset.c +1 -0
index 9ebd479df..ecb01d29f 100644
@@ -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>
tests/intel/i915_pm_rpm.c +1 -0
index 2b0a63bde..289dfc508 100644
@@ -27,6 +27,7 @@
 
 #include "config.h"
 
+#include <limits.h> // PATH_MAX
 #include <stdio.h>
 #include <stdint.h>
 #include <stdbool.h>
tests/kms_sysfs_edid_timing.c +1 -0
index ee47a024e..5df2da533 100644
@@ -22,6 +22,7 @@
  */
 #include "igt.h"
 
+#include <limits.h> // PATH_MAX
 #include <dirent.h>
 #include <fcntl.h>
 #include <sys/stat.h>
tests/testdisplay.c +1 -0
index 42218210f..4c31c0e59 100644
@@ -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>
tests/tools_test.c +1 -0
index 8412ba521..f36a61927 100644
@@ -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__
tools/igt_compliance_utils.c +1 -0
index 0faf3fc87..f6bd970e3 100644
@@ -24,6 +24,7 @@
  */
 
 #include "igt.h"
+#include <limits.h> // PATH_MAX
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
Signature · 1 line
2.39.2
#3 lore raw

Re: [igt-dev] [PATCH 2/7] Include limits.h to fix build with musl libc

Hi Bernd,

Quoted 9 lines · Bernd Kuhls

From: Stefano Ragni <[email protected]>

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

Add here s-o-b from Stefano:

Quoted 13 lines
---
 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 +

-------------- ^^^^^^^^^^^^^
There is no MAX_PATH in this file?

Quoted 11 lines
 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(+)
lib/amdgpu/amd_pci_unplug.c +0 -0
index 078398b5e..554f489c6 100644

lib/amdgpu/amd_pci_unplug.c line 23

Quoted 3 lines
lib/amdgpu/amd_pci_unplug.c +0 -0
@@ -21,6 +21,7 @@
  *
 */
 #include <linux/limits.h>

------------------ ^^^^^^^^

lib/amdgpu/amd_pci_unplug.c line 24

Quoted 1 line
lib/amdgpu/amd_pci_unplug.c +1 -0
+#include <limits.h> // PATH_MAX

------------ ^^^^^^^^
Looks like it already have limits there?

lib/igt_audio.c line 29

Quoted 12 lines
lib/amdgpu/amd_pci_unplug.c +0 -0
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <pthread.h>
lib/igt_audio.c +1 -0
index e0b1bafe1..dd5e0d2c1 100644
@@ -26,6 +26,7 @@
 
 #include "config.h"
 
+#include <limits.h> // PATH_MAX

------------ ^^^^^^^^
Put this in alphabetical order.

Quoted 20 lines
lib/igt_audio.c +0 -0
 #include <errno.h>
 #include <fcntl.h>
 #include <gsl/gsl_fft_real.h>
lib/igt_aux.c +1 -0
index 18edc5ef9..d6aeb876b 100644
@@ -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>
lib/igt_device_scan.c +0 -0
index f4f95fef3..23b17a715 100644

lib/igt_device_scan.c line 30

Quoted 4 lines
lib/igt_device_scan.c +1 -0
@@ -27,6 +27,7 @@
 #include "igt_list.h"
 #include "intel_chipset.h"
 
+#include <limits.h> // PATH_MAX

------------ ^^^^^^^^
Put this in alphabetical order.

lib/igt_eld.c line 29

Quoted 12 lines
lib/igt_device_scan.c +0 -0
 #include <ctype.h>
 #include <dirent.h>
 #include <fcntl.h>
lib/igt_eld.c +1 -0
index ef6625df1..3e9b8a404 100644
@@ -26,6 +26,7 @@
 #include "config.h"
 
 #include <dirent.h>
+#include <limits.h> // PATH_MAX

------------ ^^^^^^^^
Put this in alphabetical order.

lib/igt_frame.c line 29

Quoted 12 lines
lib/igt_eld.c +0 -0
 #include <errno.h>
 #include <glob.h>
 #include <stdint.h>
lib/igt_frame.c +1 -0
index 45523a79f..86b8aad4d 100644
@@ -26,6 +26,7 @@
 
 #include "config.h"
 
+#include <limits.h> // PATH_MAX

------------ ^^^^^^^^
Put this in alphabetical order.

Quoted 20 lines
lib/igt_frame.c +0 -0
 #include <fcntl.h>
 #include <pixman.h>
 #include <cairo.h>
lib/igt_hwmon.c +1 -0
index f37ced2d9..53c346e73 100644
@@ -2,6 +2,7 @@
 /*
  * Copyright © 2022 Intel Corporation
  */
+#include <limits.h> // PATH_MAX
 #include <sys/stat.h>
 #include <sys/sysmacros.h>
 #include <dirent.h>
runner/executor.c +0 -0
index d3e6296dd..d2737af89 100644

runner/executor.c line 4

Quoted 4 lines
runner/executor.c +1 -0
@@ -1,6 +1,7 @@
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <limits.h> // PATH_MAX

------------ ^^^^^^^^
Put this in alphabetical order.

Quoted 31 lines
runner/executor.c +0 -0
 #include <glib.h>
 #ifdef __linux__
 #include <linux/watchdog.h>
runner/runner_tests.c +1 -0
index a7e968f85..6d605251f 100644
@@ -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>
tests/device_reset.c +1 -0
index 9ebd479df..ecb01d29f 100644
@@ -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>
tests/intel/i915_pm_rpm.c +0 -0
index 2b0a63bde..289dfc508 100644

tests/intel/i915_pm_rpm.c line 30

Quoted 4 lines
tests/intel/i915_pm_rpm.c +1 -0
@@ -27,6 +27,7 @@
 
 #include "config.h"
 
+#include <limits.h> // PATH_MAX

Remove this change, there is no PATH_MAX in this file.

tests/kms_sysfs_edid_timing.c line 25

Quoted 12 lines
tests/intel/i915_pm_rpm.c +0 -0
 #include <stdio.h>
 #include <stdint.h>
 #include <stdbool.h>
tests/kms_sysfs_edid_timing.c +1 -0
index ee47a024e..5df2da533 100644
@@ -22,6 +22,7 @@
  */
 #include "igt.h"
 
+#include <limits.h> // PATH_MAX

------------ ^^^^^^^^
Put this in alphabetical order.

tests/testdisplay.c line 61

Quoted 12 lines
tests/kms_sysfs_edid_timing.c +0 -0
 #include <dirent.h>
 #include <fcntl.h>
 #include <sys/stat.h>
tests/testdisplay.c +1 -0
index 42218210f..4c31c0e59 100644
@@ -58,6 +58,7 @@
 #include <strings.h>
 #include <unistd.h>
 #include <termios.h>
+#include <limits.h> // PATH_MAX

------------ ^^^^^^^^
Put this in alphabetical order.

tests/tools_test.c line 29

Quoted 12 lines
tests/testdisplay.c +0 -0
 #include <sys/poll.h>
 #include <sys/time.h>
 #include <sys/ioctl.h>
tests/tools_test.c +1 -0
index 8412ba521..f36a61927 100644
@@ -26,6 +26,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <limits.h> // PATH_MAX

------------ ^^^^^^^^
Put this in alphabetical order.

Regards,
Kamil

Quoted 18 lines
tests/tools_test.c +0 -0
 #include <libgen.h>
 #include <unistd.h>
 #ifdef __linux__
tools/igt_compliance_utils.c +1 -0
index 0faf3fc87..f6bd970e3 100644
@@ -24,6 +24,7 @@
  */
 
 #include "igt.h"
+#include <limits.h> // PATH_MAX
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
Signature · 1 line
2.39.2
#4 lore raw

PATCH 3/7 lib/igt_aux.h: Fix musl build

In reply to Bernd Kuhls

From: Stefano Ragni <[email protected]>

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();

---
 lib/igt_aux.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_aux.h +1 -1
index fb76b0313..a13e8156a 100644
@@ -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 */
Signature · 1 line
2.39.2
#5 lore raw

Re: [igt-dev] [PATCH 3/7] lib/igt_aux.h: Fix musl build

Hi Bernd,

Quoted 9 lines · Bernd Kuhls

From: Stefano Ragni <[email protected]>

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

Quoted 6 lines

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();

While it fixes your build (?) it breaks igt build on current Ubuntu 22/x86_64, see:

[130/1763] Compiling C object lib/libigt-igt_aux_c.a.p/igt_aux.c.o
../lib/igt_aux.c: In function 'igt_sigiter_start':
../lib/igt_aux.c:191:44: warning: assignment to 'void (*)(__sigval_t)' {aka 'void (*)(union sigval)'} from 'pid_t' {aka 'int'} makes pointer from integer without a cast [-Wint-conversion]
191 | sev.sigev_notify_thread_id = __igt_sigiter.tid;
| ^

../lib/igt_aux.c: In function 'igt_start_siglatency':
../lib/igt_aux.c:1994:36: warning: assignment to 'void (*)(__sigval_t)' {aka 'void (*)(union sigval)'} from '__pid_t' {aka 'int'} makes pointer from integer without a cast [-Wint-conversion]
1994 | sev.sigev_notify_thread_id = gettid();
| ^
--
[516/1763] Compiling C object tests/gem_close_race.p/intel_gem_close_race.c.o
../tests/intel/gem_close_race.c: In function 'thread':
../tests/intel/gem_close_race.c:269:36: warning: assignment to 'void (*)(__sigval_t)' {aka 'void (*)(union sigval)'} from '__pid_t' {aka 'int'} makes pointer from integer without a cast [-Wint-conversion]
269 | sev.sigev_notify_thread_id = gettid();
| ^
--
[1537/1763] Compiling C object benchmarks/gem_syslatency.p/gem_syslatency.c.o
../benchmarks/gem_syslatency.c: In function 'sys_wait':
../benchmarks/gem_syslatency.c:168:36: warning: assignment to 'void (*)(__sigval_t)' {aka 'void (*)(union sigval)'} from '__pid_t' {aka 'int'} makes pointer from integer without a cast [-Wint-conversion]
168 | sev.sigev_notify_thread_id = gettid();
| ^

Regards,
Kamil

Quoted 22 lines
---
 lib/igt_aux.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_aux.h +1 -1
index fb76b0313..a13e8156a 100644
@@ -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 */
Signature · 1 line
2.39.2
#6 lore raw

PATCH 4/7 lib/igt_x86.c: Fix musl/uclibc build

In reply to Bernd Kuhls

From: Stefano Ragni <[email protected]>

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)

---
 lib/igt_x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_x86.c +1 -1
index 6ac700df0..8c102fd13 100644
@@ -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"
Signature · 1 line
2.39.2
#7 lore raw

PATCH 5/7 lib/igt_halffloat.c: Fix musl/uclibc build

In reply to Bernd Kuhls

From: Stefano Ragni <[email protected]>

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)

---
 lib/igt_halffloat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_halffloat.c +1 -1
index 08ab05fce..5dbe08e01 100644
@@ -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")
 
Signature · 1 line
2.39.2
#8 lore raw

PATCH 6/7 benchmarks/gem_exec_tracer.c: Fix musl build

In reply to Bernd Kuhls

From: mhmdanas <[email protected]>

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, ...)

---
 benchmarks/gem_exec_tracer.c | 4 ++++
 1 file changed, 4 insertions(+)
benchmarks/gem_exec_tracer.c +4 -0
index 7e86473e4..3156dfc23 100644
@@ -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;
Signature · 1 line
2.39.2
#9 lore raw

Re: [igt-dev] [PATCH 6/7] benchmarks/gem_exec_tracer.c: Fix musl build

Hi Bernd,

Quoted 1 line · Bernd Kuhls

From: mhmdanas <[email protected]>

------- ^^^^^^^^
Please no nicks in author or s-o-b, write here full name.

+cc Petri

Btw did you check against new igt sources, v1.28?

Quoted 7 lines

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

Please move gitlab link below.

Quoted 4 lines

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, ...)

Write "Link: ..." here:

Quoted 1 line

Regards,
Kamil

Quoted 23 lines
---
 benchmarks/gem_exec_tracer.c | 4 ++++
 1 file changed, 4 insertions(+)
benchmarks/gem_exec_tracer.c +4 -0
index 7e86473e4..3156dfc23 100644
@@ -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;
Signature · 1 line
2.39.2
#10 lore raw

PATCH 7/7 benchmarks/gem_syslatency.c: Fix musl build

In reply to Bernd Kuhls

From: Stefano Ragni <[email protected]>

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();

---
 benchmarks/gem_syslatency.c | 2 ++
 1 file changed, 2 insertions(+)
benchmarks/gem_syslatency.c +2 -0
index 312c428b7..e0740fc11 100644
@@ -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"
Signature · 1 line
2.39.2