Skip to contentSkip to conversation

package/wayland: make libdrm and xlib_libxshemfence optional

PATCH In review Raphael Pavlidis 2 participants 5 messages Oct 3, 2025 – Dec 7, 2025 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/wayland: make libdrm and xlib_libxshemfence optional

To build XWayland with the DRI3 extension requires libdrm, xlib_libxshmfence and libepoxy. This is the same as with the glamour extension. Therefore, make the libdrm and xlib_libxshemfence optional and merge the checks together.

---
 package/x11r7/xwayland/Config.in   |  4 ----
 package/x11r7/xwayland/xwayland.mk | 11 ++++-------
 2 files changed, 4 insertions(+), 11 deletions(-)
package/x11r7/xwayland/Config.in +0 -4
index 311dae25ec..4f14f2cc36 100644
@@ -6,8 +6,6 @@ config BR2_PACKAGE_XWAYLAND
 	# We need a SHA1 implementation. If either openssl or
 	# libgcrypt are already part of the build, we'll use one of
 	# them, otherwise, use the small libsha1 library.
-	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # xlib_libxshmfence
-	select BR2_PACKAGE_LIBDRM
 	select BR2_PACKAGE_LIBSHA1 if (!BR2_PACKAGE_OPENSSL && !BR2_PACKAGE_LIBGCRYPT)
 	select BR2_PACKAGE_PIXMAN
 	select BR2_PACKAGE_WAYLAND
@@ -16,7 +14,6 @@ config BR2_PACKAGE_XWAYLAND
 	select BR2_PACKAGE_XLIB_LIBXFONT2
 	select BR2_PACKAGE_XLIB_LIBXKBFILE
 	select BR2_PACKAGE_XLIB_LIBXRANDR
-	select BR2_PACKAGE_XLIB_LIBXSHMFENCE
 	select BR2_PACKAGE_XLIB_XTRANS
 	select BR2_PACKAGE_XORGPROTO
 	help
@@ -26,5 +23,4 @@ config BR2_PACKAGE_XWAYLAND
 
 comment "xwayland needs a toolchain w/ threads, dynamic library"
 	depends on BR2_USE_MMU
-	depends on BR2_TOOLCHAIN_HAS_SYNC_4
 	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
package/x11r7/xwayland/xwayland.mk +4 -7
index e3b6727c19..a6d584705b 100644
@@ -12,7 +12,6 @@ XWAYLAND_LICENSE_FILES = COPYING
 XWAYLAND_CPE_ID_VENDOR = x.org
 XWAYLAND_INSTALL_STAGING = YES
 XWAYLAND_DEPENDENCIES = \
-	libdrm \
 	pixman \
 	wayland \
 	wayland-protocols \
@@ -20,21 +19,19 @@ XWAYLAND_DEPENDENCIES = \
 	xlib_libXfont2 \
 	xlib_libxkbfile \
 	xlib_libXrandr \
-	xlib_libxshmfence \
 	xlib_xtrans \
 	xorgproto
 XWAYLAND_CONF_OPTS = \
-	-Ddri3=true \
 	-Dxvfb=false \
 	-Ddefault_font_path=/usr/share/fonts/X11/ \
 	-Ddtrace=false \
 	-Ddocs=false
 
-ifeq ($(BR2_PACKAGE_LIBEPOXY),y)
-XWAYLAND_CONF_OPTS += -Dglamor=true
-XWAYLAND_DEPENDENCIES += libepoxy
+ifeq ($(BR2_PACKAGE_LIBDRM)$(BR2_PACKAGE_XLIB_LIBXSHMFENCE)$(BR2_PACKAGE_LIBEPOXY),yyy)
+XWAYLAND_CONF_OPTS += -Ddri3=true -Dglamor=true
+XWAYLAND_DEPENDENCIES += libdrm xlib_libxshmfence libepoxy
 else
-XWAYLAND_CONF_OPTS += -Dglamor=false
+XWAYLAND_CONF_OPTS += -Dglamor=false -Ddri3=false
 endif
 
 ifeq ($(BR2_PACKAGE_HAS_LIBGL),y)
Signature · 6 lines
2.51.0

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

PATCH 2/2 package/xwayland: add nettle and libmd as sha1 libraries

nettle or libdm can be used for sha1 library. Therefore, if one of those libraries is selected, then use it.

---
 package/x11r7/xwayland/Config.in   | 8 ++++----
 package/x11r7/xwayland/xwayland.mk | 8 +++++++-
 2 files changed, 11 insertions(+), 5 deletions(-)
package/x11r7/xwayland/Config.in +4 -4
index 4f14f2cc36..a4e4a4e46f 100644
@@ -3,10 +3,10 @@ config BR2_PACKAGE_XWAYLAND
 	depends on BR2_USE_MMU # fork()
 	depends on !BR2_STATIC_LIBS # wayland
 	depends on BR2_TOOLCHAIN_HAS_THREADS # wayland
-	# We need a SHA1 implementation. If either openssl or
-	# libgcrypt are already part of the build, we'll use one of
-	# them, otherwise, use the small libsha1 library.
-	select BR2_PACKAGE_LIBSHA1 if (!BR2_PACKAGE_OPENSSL && !BR2_PACKAGE_LIBGCRYPT)
+	# We need a SHA1 implementation. If either openssl, libgcrypt, nettle or
+	# libsha1 are already part of the build, we'll use one of them,
+	# otherwise, use the small libmd library.
+	select BR2_PACKAGE_LIBMD if (!BR2_PACKAGE_OPENSSL && !BR2_PACKAGE_LIBGCRYPT && !BR2_PACKAGE_NETTLE && !BR2_PACKAGE_LIBSHA1)
 	select BR2_PACKAGE_PIXMAN
 	select BR2_PACKAGE_WAYLAND
 	select BR2_PACKAGE_WAYLAND_PROTOCOLS
package/x11r7/xwayland/xwayland.mk +7 -1
index a6d584705b..84c8598bf7 100644
@@ -72,9 +72,15 @@ XWAYLAND_DEPENDENCIES += openssl
 else ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
 XWAYLAND_CONF_OPTS += -Dsha1=libgcrypt
 XWAYLAND_DEPENDENCIES += libgcrypt
-else
+else ifeq ($(BR2_PACKAGE_NETTLE),y)
+XWAYLAND_CONF_OPTS += -Dsha1=libnettle
+XWAYLAND_DEPENDENCIES += nettle
+else ifeq ($(BR2_PACKAGE_LIBSHA1),y)
 XWAYLAND_CONF_OPTS += -Dsha1=libsha1
 XWAYLAND_DEPENDENCIES += libsha1
+else
+XWAYLAND_CONF_OPTS += -Dsha1=libmd
+XWAYLAND_DEPENDENCIES += libmd
 endif
 
 ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
Signature · 6 lines
2.51.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Raphael Pavlidis

Hello Raphael,

Quoted 6 lines · On Fri, 3 Oct 2025 13:51:19 +0000 Raphael Pavlidis…

To build XWayland with the DRI3 extension requires libdrm, xlib_libxshmfence and libepoxy. This is the same as with the glamour extension. Therefore, make the libdrm and xlib_libxshemfence optional and merge the checks together.

You sent a new iteration of PATCH 2/2 in this series "package/xwayland:
add nettle and libmd as sha1 libraries", but you did not resent this PATCH 1/2, which is rather confusing.

Also, this PATCH 1/2 basically undoes what commit 797de283c7ae9b99e4d2366cf142b2bc8b2f2a84 that made libdrm a mandatory dependency to fix a build issue. Can you provide some explanation on what happened? Was 797de283c7ae9b99e4d2366cf142b2bc8b2f2a84 incorrect? Has something changed upstream? Did you double check that the config causing the build failure of 797de283c7ae9b99e4d2366cf142b2bc8b2f2a84 still builds properly after your proposed change?

Thanks a lot!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
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): [email protected]

#4 lore raw

Hello Raphael,

[Please keep the list in Cc when replying. Thanks!]

Quoted 5 lines · On Sun, 7 Dec 2025 17:53:43 +0100 Raphael Pavlidis…
Quoted 3 lines

You sent a new iteration of PATCH 2/2 in this series "package/xwayland:
add nettle and libmd as sha1 libraries", but you did not resent this PATCH 1/2, which is rather confusing.

I thought I had already marked the old patch series as obsolete.

It was still in the "New" state in patchwork, which is how I noticed.

Quoted 4 lines

I’ve also realized that it doesn’t work to make them optional; even though they are declared as optional dependencies in the meson files, the source code still includes those libraries unconditionally, even when they aren’t used (at least on the latest version).

OK! Then, there is an upstream bug: either meson file is incorrect, or the code is incorrect. Did you report the issue upstream?

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

Hello Thomas,

On 12/7/25 17:57, Thomas Petazzoni wrote:
[SNIP]

Quoted 2 lines

It was still in the "New" state in patchwork, which is how I noticed.

I double-check it, and you were right. I changed it.

Quoted 8 lines
Quoted 5 lines

I’ve also realized that it doesn’t work to make them optional; even though they are declared as optional dependencies in the meson files, the source code still includes those libraries unconditionally, even when they aren’t used (at least on the latest version).

OK! Then, there is an upstream bug: either meson file is incorrect, or the code is incorrect. Did you report the issue upstream?

I think the code is incorrect. Did not have time to report the bug.

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