Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mutter-45.* fails to build for musl targets due to the 'undeclared RLIMIT_RTTIME' error #48391

Closed
chrysos349 opened this issue Jan 26, 2024 · 4 comments

Comments

@chrysos349
Copy link
Contributor

Hey,

I've created the issue upstream a week ago. No answer.

Any ideas? Am I doing something wrong?

The issue is below.

mutter 45.* fails to (cross)build for musl targets due to the error: 'RLIMIT_RTTIME' undeclared.

AFAIK, RLIMIT_RTTIME was introduced in musl-1.2. Unfortunately, Void Linux has musl-1.1 and has no plans to update it.

It seems the only way to build successfully for musl targets in Void Linux is to disable wayland functionality by adding -Dnative_backend=false -Dwayland=false -Dxwayland=false to configure arguments, but this outcome is not desirable.

TLDR: Is there a way to patch mutter 45.* in order to be able to build it for musl targets in Void Linux with musl-1.1 which lacks RLIMIT_RTTIME?

RLIMIT_RTTIME[752/767] Compiling C object src/libmutter-13.so.0.0.0.p/backends_native_meta-thread.c.o
FAILED: src/libmutter-13.so.0.0.0.p/backends_native_meta-thread.c.o
aarch64-linux-musl-gcc -Isrc/libmutter-13.so.0.0.0.p -Isrc -I../src -I. -I.. -Iclutter -I../clutter -Iclutter/clutter -I../clutter/clutter -Imtk -I../mtk -Imtk/mtk -I../mtk/mtk -Icogl -I../cogl -Icogl/cogl -I../cogl/cogl -Isrc/meta -I/usr/aarch64-linux-musl/usr/include/glib-2.0 -I/usr/aarch64-linux-musl/usr/lib64/glib
-2.0/include -I/usr/aarch64-linux-musl/usr/include/gio-unix-2.0 -I/usr/aarch64-linux-musl/usr/include/libmount -I/usr/aarch64-linux-musl/usr/include/blkid -I/usr/aarch64-linux-musl/usr/include/graphene-1.0 -I/usr/aarch64-linux-musl/usr/lib64/graphene-1.0/include -I/usr/aarch64-linux-musl/usr/include/cairo -I/usr/aarch
64-linux-musl/usr/include/freetype2 -I/usr/aarch64-linux-musl/usr/include/libpng16 -I/usr/aarch64-linux-musl/usr/include/pixman-1 -I/usr/aarch64-linux-musl/usr/include/gdk-pixbuf-2.0 -I/usr/aarch64-linux-musl/usr/include/atk-1.0 -I/usr/aarch64-linux-musl/usr/include/json-glib-1.0 -I/usr/aarch64-linux-musl/usr/include/
pango-1.0 -I/usr/aarch64-linux-musl/usr/include/fribidi -I/usr/aarch64-linux-musl/usr/include/harfbuzz -I/usr/aarch64-linux-musl/usr/include/libwacom-1.0 -I/usr/aarch64-linux-musl/usr/include/gudev-1.0 -I/usr/aarch64-linux-musl/usr/include/libevdev-1.0/ -I/usr/aarch64-linux-musl/usr/include/gsettings-desktop-schemas -
I/usr/aarch64-linux-musl/usr/include/colord-1 -I/usr/aarch64-linux-musl/usr/include/gnome-settings-daemon-45 -I/usr/aarch64-linux-musl/usr/include/libei-1.0 -I/usr/aarch64-linux-musl/usr/include/gnome-desktop-4.0 -I/usr/aarch64-linux-musl/usr/include/libxml2 -I/usr/aarch64-linux-musl/usr/include/startup-notification-1
.0 -I/usr/aarch64-linux-musl/usr/include/pipewire-0.3 -I/usr/aarch64-linux-musl/usr/include/spa-0.2 -I/usr/aarch64-linux-musl/usr/include/gobject-introspection-1.0 -I/usr/aarch64-linux-musl/usr/include/uuid -I/usr/aarch64-linux-musl/usr/include/elogind -I/usr/aarch64-linux-musl/usr/include/libdrm -I/usr/aarch64-linux-
musl/usr/include -fvisibility=hidden -flto=auto -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -D_GNU_SOURCE -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -pipe -march=armv8-a -ffile-prefix-map=/builddir/mutter-45.3/build=. -fPIC -D_REENTRANT -pthread -DCLUTTER_ENABLE_COMPOSITOR_API
-DCOGL_ENABLE_EXPERIMENTAL_API -DCOGL_ENABLE_EXPERIMENTAL_2_0_API -DCOGL_ENABLE_MUTTER_API -DCLUTTER_DISABLE_DEPRECATION_WARNINGS -DCOGL_DISABLE_DEPRECATION_WARNINGS -DSN_API_NOT_YET_FROZEN=1 '-DGETTEXT_PACKAGE="mutter"' -DWITH_VERBOSE_MODE '-DG_LOG_DOMAIN="libmutter"' -MD -MQ src/libmutter-13.so.0.0.0.p/backends_nati
ve_meta-thread.c.o -MF src/libmutter-13.so.0.0.0.p/backends_native_meta-thread.c.o.d -o src/libmutter-13.so.0.0.0.p/backends_native_meta-thread.c.o -c ../src/backends/native/meta-thread.c
../src/backends/native/meta-thread.c: In function 'request_realtime_scheduling':
../src/backends/native/meta-thread.c:288:18: error: 'RLIMIT_RTTIME' undeclared (first use in this function); did you mean 'RLIMIT_RTPRIO'?
 288 |   if (setrlimit (RLIMIT_RTTIME, &rl) != 0)
     |                  ^~~~~~~~~~~~~
     |                  RLIMIT_RTPRIO
../src/backends/native/meta-thread.c:288:18: note: each undeclared identifier is reported only once for each function it appears in
[753/767] Linking target clutter/clutter/libmutter-clutter-13.so.0.0.0
[754/767] Generating cogl/cogl-pango/CoglPango-13.gir with a custom command (wrapped by meson to set env)
[755/767] Generating cogl/cogl/Cogl-13.typelib with a custom command
ninja: build stopped: subcommand failed.

@oreo639
Copy link
Member

oreo639 commented Jan 27, 2024

Seems like this was something fixed in musl 1.2.0 bminor/musl@2507e7f

We have packages that work around not having RLIMIT_RTTIME by adding -DRLIMIT_RTTIME=15 to the CFLAGS.

@chrysos349
Copy link
Contributor Author

@oreo639
Thanks a lot! The issue is solved!

@oreo639
Copy link
Member

oreo639 commented Jan 29, 2024

Btw, the patch has been pulled in to void so the workaround should be unnecessary

@chrysos349
Copy link
Contributor Author

@oreo639
Yes, I saw all your amazing PRs lately. You're on fire! You're a great addition to the Void Team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants