dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/xe: add missing include <libgen.h>
@ 2025-08-25  1:09 Achill Gilgenast
  2025-08-25 13:03 ` Lucas De Marchi
  0 siblings, 1 reply; 2+ messages in thread
From: Achill Gilgenast @ 2025-08-25  1:09 UTC (permalink / raw)
  To: Matt Atwood, Lucas De Marchi, intel-xe, dri-devel
  Cc: linux-kernel, Achill Gilgenast, Thomas Hellström,
	Rodrigo Vivi, David Airlie, Simona Vetter

basename() got implicitly included on glibc but not on other libc's like
musl libc and therefore fails to build:

/home/achill/git/user-aports/experimental/linux-mainline/src/linux-6.17-rc3/drivers/gpu/drm/xe/xe_gen_wa_oob.c: In function 'fn_to_prefix':
/home/achill/git/user-aports/experimental/linux-mainline/src/linux-6.17-rc3/drivers/gpu/drm/xe/xe_gen_wa_oob.c:130:14: error: implicit declaration of function 'basename'; did you mean 'rename'? [-Wimplicit-function-declaration]
  130 |         fn = basename(fn);
      |              ^~~~~~~~
      |              rename
/home/achill/git/user-aports/experimental/linux-mainline/src/linux-6.17-rc3/drivers/gpu/drm/xe/xe_gen_wa_oob.c:130:12: error: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  130 |         fn = basename(fn);
      |            ^

Fixes: b0a2ee5567ab ("drm/xe: prepare xe_gen_wa_oob to be multi-use")
Signed-off-by: Achill Gilgenast <achill@achill.org>
---
 drivers/gpu/drm/xe/xe_gen_wa_oob.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/xe/xe_gen_wa_oob.c b/drivers/gpu/drm/xe/xe_gen_wa_oob.c
index 6581cb0f0e59..74af4b9fde65 100644
--- a/drivers/gpu/drm/xe/xe_gen_wa_oob.c
+++ b/drivers/gpu/drm/xe/xe_gen_wa_oob.c
@@ -6,6 +6,7 @@
 #define _GNU_SOURCE
 #include <ctype.h>
 #include <errno.h>
+#include <libgen.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
-- 
2.51.0

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

* Re: [PATCH] drm/xe: add missing include <libgen.h>
  2025-08-25  1:09 [PATCH] drm/xe: add missing include <libgen.h> Achill Gilgenast
@ 2025-08-25 13:03 ` Lucas De Marchi
  0 siblings, 0 replies; 2+ messages in thread
From: Lucas De Marchi @ 2025-08-25 13:03 UTC (permalink / raw)
  To: Achill Gilgenast
  Cc: Matt Atwood, intel-xe, dri-devel, linux-kernel,
	Thomas Hellström, Rodrigo Vivi, David Airlie, Simona Vetter

On Mon, Aug 25, 2025 at 03:09:09AM +0200, Achill Gilgenast wrote:
>basename() got implicitly included on glibc but not on other libc's like
>musl libc and therefore fails to build:
>
>/home/achill/git/user-aports/experimental/linux-mainline/src/linux-6.17-rc3/drivers/gpu/drm/xe/xe_gen_wa_oob.c: In function 'fn_to_prefix':
>/home/achill/git/user-aports/experimental/linux-mainline/src/linux-6.17-rc3/drivers/gpu/drm/xe/xe_gen_wa_oob.c:130:14: error: implicit declaration of function 'basename'; did you mean 'rename'? [-Wimplicit-function-declaration]
>  130 |         fn = basename(fn);
>      |              ^~~~~~~~
>      |              rename
>/home/achill/git/user-aports/experimental/linux-mainline/src/linux-6.17-rc3/drivers/gpu/drm/xe/xe_gen_wa_oob.c:130:12: error: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
>  130 |         fn = basename(fn);
>      |            ^
>
>Fixes: b0a2ee5567ab ("drm/xe: prepare xe_gen_wa_oob to be multi-use")
>Signed-off-by: Achill Gilgenast <achill@achill.org>

libgen.h provides a different basename than the one used here.
glibc defines it in string.h, but other libc's don't (or removed it
recently). See https://lore.kernel.org/intel-xe/w4j3kzezrd4xqc4q4vkpbbxqvqxitam5htkex6rj6dguj5kbw5@27gqnp6veuu4/

Lucas De Marchi

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

end of thread, other threads:[~2025-08-25 13:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-25  1:09 [PATCH] drm/xe: add missing include <libgen.h> Achill Gilgenast
2025-08-25 13:03 ` Lucas De Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).