Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Unable to build tinywl on Ubuntu Cosmic #1463

Closed
georgewsinger opened this issue Jan 13, 2019 · 17 comments
Closed

Unable to build tinywl on Ubuntu Cosmic #1463

georgewsinger opened this issue Jan 13, 2019 · 17 comments

Comments

@georgewsinger
Copy link

georgewsinger commented Jan 13, 2019

Problem: I'm on Ubuntu Cosmic (18.10). When attempting to build tinywl, I get several undefined reference's:

george@UbuntuBox:~/wlroots/tinywl$ make
cc  \
 -I /usr/include \
 -g -Werror -I. \
 -DWLR_USE_UNSTABLE \
 -I/usr/local/include -I/usr/include/libdrm -I/usr/include/pixman-1 -L/usr/local/lib/x86_64-linux-gnu -lwlroots -lwayland-server -lxkbcommon \
 -o tinywl tinywl.c
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `wl_signal_add':
/usr/include/wayland-server-core.h:431: undefined reference to `wl_list_insert'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `focus_view':
/home/george/wlroots/tinywl/tinywl.c:111: undefined reference to `wlr_xdg_surface_from_wlr_surface'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:113: undefined reference to `wlr_xdg_toplevel_set_activated'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:115: undefined reference to `wlr_seat_get_keyboard'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:117: undefined reference to `wl_list_remove'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:118: undefined reference to `wl_list_insert'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:120: undefined reference to `wlr_xdg_toplevel_set_activated'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:126: undefined reference to `wlr_seat_keyboard_notify_enter'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `keyboard_handle_modifiers':
/home/george/wlroots/tinywl/tinywl.c:142: undefined reference to `wlr_seat_set_keyboard'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:144: undefined reference to `wlr_seat_keyboard_notify_modifiers'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `handle_keybinding':
/home/george/wlroots/tinywl/tinywl.c:158: undefined reference to `wl_display_terminate'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:162: undefined reference to `wl_list_length'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:171: undefined reference to `wl_list_remove'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:172: undefined reference to `wl_list_insert'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `keyboard_handle_key':
/home/george/wlroots/tinywl/tinywl.c:193: undefined reference to `xkb_state_key_get_syms'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:197: undefined reference to `wlr_keyboard_get_modifiers'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:208: undefined reference to `wlr_seat_set_keyboard'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:209: undefined reference to `wlr_seat_keyboard_notify_key'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `server_new_keyboard':
/home/george/wlroots/tinywl/tinywl.c:224: undefined reference to `xkb_context_new'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:225: undefined reference to `xkb_keymap_new_from_names'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:228: undefined reference to `wlr_keyboard_set_keymap'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:229: undefined reference to `xkb_keymap_unref'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:230: undefined reference to `xkb_context_unref'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:231: undefined reference to `wlr_keyboard_set_repeat_info'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:239: undefined reference to `wlr_seat_set_keyboard'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:242: undefined reference to `wl_list_insert'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `server_new_pointer':
/home/george/wlroots/tinywl/tinywl.c:251: undefined reference to `wlr_cursor_attach_input_device'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `server_new_input':
/home/george/wlroots/tinywl/tinywl.c:272: undefined reference to `wl_list_empty'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:275: undefined reference to `wlr_seat_set_capabilities'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `seat_request_cursor':
/home/george/wlroots/tinywl/tinywl.c:292: undefined reference to `wlr_cursor_set_surface'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `view_at':
/home/george/wlroots/tinywl/tinywl.c:314: undefined reference to `wlr_xdg_surface_surface_at'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `process_cursor_resize':
/home/george/wlroots/tinywl/tinywl.c:385: undefined reference to `wlr_xdg_toplevel_set_size'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `process_cursor_motion':
/home/george/wlroots/tinywl/tinywl.c:408: undefined reference to `wlr_xcursor_manager_set_cursor_image'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:421: undefined reference to `wlr_seat_pointer_notify_enter'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:425: undefined reference to `wlr_seat_pointer_notify_motion'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:430: undefined reference to `wlr_seat_pointer_clear_focus'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `server_cursor_motion':
/home/george/wlroots/tinywl/tinywl.c:445: undefined reference to `wlr_cursor_move'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `server_cursor_motion_absolute':
/home/george/wlroots/tinywl/tinywl.c:461: undefined reference to `wlr_cursor_warp_absolute'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `server_cursor_button':
/home/george/wlroots/tinywl/tinywl.c:472: undefined reference to `wlr_seat_pointer_notify_button'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `server_cursor_axis':
/home/george/wlroots/tinywl/tinywl.c:495: undefined reference to `wlr_seat_pointer_notify_axis'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `render_surface':
/home/george/wlroots/tinywl/tinywl.c:521: undefined reference to `wlr_surface_get_texture'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:531: undefined reference to `wlr_output_layout_output_coords'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:557: undefined reference to `wlr_output_transform_invert'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:558: undefined reference to `wlr_matrix_project_box'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:563: undefined reference to `wlr_render_texture_with_matrix'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:567: undefined reference to `wlr_surface_send_frame_done'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `output_frame':
/home/george/wlroots/tinywl/tinywl.c:581: undefined reference to `wlr_output_make_current'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:586: undefined reference to `wlr_output_effective_resolution'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:588: undefined reference to `wlr_renderer_begin'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:591: undefined reference to `wlr_renderer_clear'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:609: undefined reference to `wlr_xdg_surface_for_each_surface'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:615: undefined reference to `wlr_renderer_end'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:616: undefined reference to `wlr_output_swap_buffers'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `server_new_output':
/home/george/wlroots/tinywl/tinywl.c:631: undefined reference to `wl_list_empty'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:634: undefined reference to `wlr_output_set_mode'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:645: undefined reference to `wl_list_insert'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:651: undefined reference to `wlr_output_layout_add_auto'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:656: undefined reference to `wlr_output_create_global'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `xdg_surface_destroy':
/home/george/wlroots/tinywl/tinywl.c:675: undefined reference to `wl_list_remove'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `begin_interactive':
/home/george/wlroots/tinywl/tinywl.c:694: undefined reference to `wlr_xdg_surface_get_geometry'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `server_new_xdg_surface':
/home/george/wlroots/tinywl/tinywl.c:762: undefined reference to `wl_list_insert'
/usr/bin/ld: /tmp/ccmbVrSH.o: in function `main':
/home/george/wlroots/tinywl/tinywl.c:766: undefined reference to `wlr_log_init'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:788: undefined reference to `wl_display_create'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:797: undefined reference to `wlr_backend_autocreate'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:802: undefined reference to `wlr_backend_get_renderer'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:803: undefined reference to `wlr_renderer_init_wl_display'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:809: undefined reference to `wlr_compositor_create'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:810: undefined reference to `wlr_data_device_manager_create'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:814: undefined reference to `wlr_output_layout_create'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:818: undefined reference to `wl_list_init'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:828: undefined reference to `wl_list_init'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:829: undefined reference to `wlr_xdg_shell_create'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:838: undefined reference to `wlr_cursor_create'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:839: undefined reference to `wlr_cursor_attach_output_layout'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:845: undefined reference to `wlr_xcursor_manager_create'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:846: undefined reference to `wlr_xcursor_manager_load'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:876: undefined reference to `wl_list_init'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:879: undefined reference to `wlr_seat_create'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:885: undefined reference to `wl_display_add_socket_auto'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:887: undefined reference to `wlr_backend_destroy'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:893: undefined reference to `wlr_backend_start'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:894: undefined reference to `wlr_backend_destroy'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:895: undefined reference to `wl_display_destroy'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:911: undefined reference to `_wlr_strip_path'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:911: undefined reference to `_wlr_log'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:913: undefined reference to `wl_display_run'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:916: undefined reference to `wl_display_destroy_clients'
/usr/bin/ld: /home/george/wlroots/tinywl/tinywl.c:917: undefined reference to `wl_display_destroy'
collect2: error: ld returned 1 exit status
make: *** [Makefile:21: tinywl] Error 1

Dependencies

I installed wlroots via

meson build
ninja -C build
sudo ninja -C build install

and I seem to have all of the needed dependencies (in particular: wayland-scanner and other wayland libraries):

george@UbuntuBox:~/wlroots/tinywl$ apt list --installed | grep wayland

kwayland-data/cosmic,cosmic,now 4:5.50.0-0ubuntu1 all [installed,automatic]
kwayland-integration/cosmic,now 4:5.13.5-0ubuntu1 amd64 [installed,automatic]
libkf5waylandclient5/cosmic,now 4:5.50.0-0ubuntu1 amd64 [installed,automatic]
libqt5waylandclient5/cosmic,now 5.11.1-2 amd64 [installed,automatic]
libqt5waylandcompositor5/cosmic,now 5.11.1-2 amd64 [installed,automatic]
libva-wayland2/cosmic,now 2.2.0-1 amd64 [installed,automatic]
libwayland-bin/cosmic-updates,now 1.16.0-1ubuntu1.1 amd64 [installed,automatic]
libwayland-client0/cosmic-updates,now 1.16.0-1ubuntu1.1 amd64 [installed]
libwayland-cursor0/cosmic-updates,now 1.16.0-1ubuntu1.1 amd64 [installed]
libwayland-dev/cosmic-updates,now 1.16.0-1ubuntu1.1 amd64 [installed]
libwayland-egl1-mesa/cosmic,now 18.2.2-0ubuntu1 amd64 [installed]
libwayland-egl1/cosmic-updates,now 1.16.0-1ubuntu1.1 amd64 [installed,automatic]
libwayland-server0/cosmic-updates,now 1.16.0-1ubuntu1.1 amd64 [installed]
qtwayland5/cosmic,now 5.11.1-2 amd64 [installed,automatic]
wayland-protocols/cosmic,cosmic,now 1.16-1 all [installed]
xwayland/cosmic-updates,now 2:1.20.1-3ubuntu2.1 amd64 [installed]

and here are the actual wlroots libs:

george@UbuntuBox:/usr$ find . -name "*roots*"
./local/lib/x86_64-linux-gnu/libwlroots.so
./local/lib/x86_64-linux-gnu/pkgconfig/wlroots.pc
./local/lib/x86_64-linux-gnu/libwlroots.so.0
./local/lib/x86_64-linux-gnu/libwlroots.so.0.0.0

with

george@UbuntuBox:/usr/local/lib/x86_64-linux-gnu$ ldd libwlroots.so
        linux-vdso.so.1 (0x00007ffc4eff8000)
        libwayland-server.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-server.so.0 (0x00007ff0c1b12000)
        libwayland-client.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-client.so.0 (0x00007ff0c1b01000)
        libwayland-egl.so.1 => /usr/lib/x86_64-linux-gnu/libwayland-egl.so.1 (0x00007ff0c1afc000)
        libEGL.so.1 => /usr/lib/x86_64-linux-gnu/libEGL.so.1 (0x00007ff0c1ae7000)
        libGLESv2.so.2 => /usr/lib/x86_64-linux-gnu/libGLESv2.so.2 (0x00007ff0c1ad2000)
        libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007ff0c1abf000)
        libgbm.so.1 => /usr/lib/x86_64-linux-gnu/libgbm.so.1 (0x00007ff0c1aad000)
        libinput.so.10 => /usr/lib/x86_64-linux-gnu/libinput.so.10 (0x00007ff0c1a67000)
        libxkbcommon.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007ff0c1a26000)
        libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007ff0c1a06000)
        libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007ff0c1761000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff0c15d4000)
        libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007ff0c15a9000)
        libxcb-composite.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-composite.so.0 (0x00007ff0c15a4000)
        libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007ff0c1595000)
        libxcb-xfixes.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-xfixes.so.0 (0x00007ff0c158b000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff0c1581000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff0c1397000)
        libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007ff0c118d000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff0c116c000)
        libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007ff0c10af000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff0c10a9000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ff0c0e8c000)
        libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007ff0c0e4f000)
        libmtdev.so.1 => /usr/lib/x86_64-linux-gnu/libmtdev.so.1 (0x00007ff0c0c48000)
        libevdev.so.2 => /usr/lib/x86_64-linux-gnu/libevdev.so.2 (0x00007ff0c0a2e000)
        libwacom.so.2 => /usr/lib/x86_64-linux-gnu/libwacom.so.2 (0x00007ff0c0a22000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff0c1bf6000)
        libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007ff0c081e000)
        libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007ff0c0618000)
        libgudev-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgudev-1.0.so.0 (0x00007ff0c040c000)
        libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007ff0c03b8000)
        libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007ff0c029b000)
        libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007ff0c0084000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007ff0c0010000)

How Makefile variables are expanding

Just to be sure, I verified in a shell that the Makefile variables are expanding as follows: WAYLAND_PROTOCOLS := //usr/share/wayland-protocol, WAYLAND_SCANNER := /usr/bin/wayland-scannery, and finally LIBS := -I/usr/local/include -I/usr/include/libdrm -I/usr/include/pixman-1 -L/usr/local/lib/x86_64-linux-gnu -lwlroots -lwayland-server -lxkbcommon.

What gives?

@georgewsinger
Copy link
Author

georgewsinger commented Jan 16, 2019

Tinywl has improper gcc flag ordering. Its Makefile should be adjusted so that

tinywl: tinywl.c xdg-shell-protocol.h xdg-shell-protocol.c
        $(CC) $(CFLAGS) \
                -I /usr/include \
                -g -Werror -I. \
                -DWLR_USE_UNSTABLE \
                -o $@ $< \  # <-- this line switched with
                $(LIBS)      # <-- this line

and it now builds accordingly; however, there is a new error when running:

$ LD_LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu ./tinywl 
2019-01-16 10:20:43 - [backend/session/direct-ipc.c:47] Do not have root privileges; cannot become DRM master
2019-01-16 10:20:43 - [backend/session/session.c:91] Failed to load session backend
2019-01-16 10:20:43 - [backend/backend.c:265] Failed to start a DRM session
Segmentation fault (core dumped)

Tinywl should be choosing the X11 backend but instead it's choosing DRM. I tried opening ./tinywl on a tty with root privileges and it still fails; the error reads

Successfully loaded direct session
Found 0 GPUs
Failed to open any DRM device

@emersion
Copy link
Member

Tinywl has improper gcc flag ordering. Its Makefile should be adjusted so that

This seems wrong.

Tinywl should be choosing the X11 backend but instead it's choosing DRM.

Is DISPLAY set in your env?

@georgewsinger
Copy link
Author

Yes:

$ echo $DISPLAY
:1

@KaneTW
Copy link
Contributor

KaneTW commented Jan 16, 2019

Can confirm that the order works. See also https://eli.thegreenplace.net/2013/07/09/library-order-in-static-linking.

The linker first looks at tinywl.o for the symbols that it needs, then in -lwayland-server etc. It doesn't keep track of the symbols provided by preceding libs.

@emersion
Copy link
Member

Can confirm that the order works

You're right. Can you send a PR?

@KaneTW
Copy link
Contributor

KaneTW commented Jan 16, 2019

Done! #1471

emersion added a commit that referenced this issue Jan 16, 2019
@ianyfan ianyfan closed this as completed Jan 16, 2019
@emersion
Copy link
Member

This issue isn't completely fixed:

Tinywl should be choosing the X11 backend but instead it's choosing DRM.

Can you try rootston?

Never run a Wayland compositor with sudo.

@ianyfan
Copy link
Contributor

ianyfan commented Jan 16, 2019

My bad, sorry

@ianyfan ianyfan reopened this Jan 16, 2019
@georgewsinger
Copy link
Author

georgewsinger commented Jan 16, 2019

Attempt to run rootston:

cd rootston
cp rootston.ini.example rootston.ini # I set `xwayland=true`
../build/rootston/rootston

2019-01-16 18:37:53 - [rootston/config.c:401] Configured output VGA-1 with mode 768x1024@0.000000
2019-01-16 18:37:53 - [backend/session/direct-ipc.c:47] Do not have root privileges; cannot become DRM master
2019-01-16 18:37:53 - [backend/session/session.c:91] Failed to load session backend
2019-01-16 18:37:53 - [backend/backend.c:265] Failed to start a DRM session
2019-01-16 18:37:53 - [rootston/main.c:26] could not start backend

@ascent12
Copy link
Member

@georgewsinger See https://github.com/swaywm/sway/wiki/Running-Sway-without-systemd
That page is not actually sway specific. It applies to any wlroots-based compositor, including rootston.

@georgewsinger
Copy link
Author

georgewsinger commented Jan 17, 2019

@ascent12 I'm running Unbuntu Cosmic 18.10, so should have systemd, no?

Do you mean this: https://github.com/swaywm/sway/wiki/Running-Sway-without-systemd#direct-via-capabilities ?

@ascent12
Copy link
Member

@georgewsinger You probably compiled wlroots without logind support. That would happen if you using the auto-detection of dependencies (the default behaviour) and you don't have libsystemd-dev installed.
Install that, run meson configure -Dlogind=enabled inside of the build directory to make absolutely sure, and run ninja again to recompile.

@georgewsinger
Copy link
Author

@ascent12 I'm now getting:

2019-01-24 20:44:42 - [backend/session/logind.c:501] Failed to get seat id: No data available
2019-01-24 20:44:42 - [backend/session/direct-ipc.c:35] Do not have CAP_SYS_ADMIN; cannot become DRM mas
ter                                                                                                    
2019-01-24 20:44:42 - [backend/session/session.c:91] Failed to load session backend
2019-01-24 20:44:42 - [backend/backend.c:265] Failed to start a DRM session

@georgewsinger
Copy link
Author

georgewsinger commented Jan 25, 2019

What I really need is the x11 backend enabled (I don't want to load tinywl in DRM, but in Ubuntu 18.10 against X). But when I adjust the meson.build file as follows to allow this:

conf_data.set10('WLR_HAS_LIBCAP', true)
conf_data.set10('WLR_HAS_SYSTEMD', true)
conf_data.set10('WLR_HAS_ELOGIND', true)
conf_data.set10('WLR_HAS_X11_BACKEND', true)
conf_data.set10('WLR_HAS_XWAYLAND', false)
conf_data.set10('WLR_HAS_XCB_ERRORS', false)
conf_data.set10('WLR_HAS_XCB_ICCCM', false)

I get this error:

FAILED: libwlroots.so.0.0.0 
cc  -o libwlroots.so.0.0.0  -Wl,--no-undefined -Wl,--as-needed -shared -fPIC -Wl,--start-group -Wl,-sona
me,libwlroots.so.0 -Wl,--whole-archive xwayland/libwlr_xwayland.a protocol/libwl_protos.a backend/libwlr
_backend.a render/libwlr_render.a types/libwlr_types.a util/libwlr_util.a xcursor/libwlr_xcursor.a -Wl,-
-no-whole-archive -Wl,--version-script,/home/george/wlroots/wlroots.syms /usr/lib/x86_64-linux-gnu/libca
p.so /lib/x86_64-linux-gnu/libsystemd.so /usr/lib/x86_64-linux-gnu/libwayland-server.so /usr/lib/x86_64-
linux-gnu/libwayland-client.so /usr/lib/x86_64-linux-gnu/libwayland-egl.so /usr/lib/x86_64-linux-gnu/lib
EGL.so /usr/lib/x86_64-linux-gnu/libGLESv2.so /usr/lib/x86_64-linux-gnu/libdrm.so /usr/lib/x86_64-linux-
gnu/libgbm.so /usr/lib/x86_64-linux-gnu/libinput.so /usr/lib/x86_64-linux-gnu/libxkbcommon.so /lib/x86_6
4-linux-gnu/libudev.so /usr/lib/x86_64-linux-gnu/libpixman-1.so -lm /usr/lib/x86_64-linux-gnu/libxcb.so 
/usr/lib/x86_64-linux-gnu/libxcb-composite.so /usr/lib/x86_64-linux-gnu/libxcb-render.so /usr/lib/x86_64
-linux-gnu/libxcb-xfixes.so -lrt -Wl,--end-group                                                       
/usr/bin/ld: backend/libwlr_backend.a(backend.c.o): in function `attempt_x11_backend':
/home/george/wlroots/build/../backend/backend.c:107: undefined reference to `wlr_x11_backend_create'
/usr/bin/ld: /home/george/wlroots/build/../backend/backend.c:114: undefined reference to `wlr_x11_output
_create'                                                                                               
collect2: error: ld returned 1 exit status
[79/104] Compiling C object 'rootston/a721b6f@@rootston@exe/output.c.o'.
ninja: build stopped: subcommand failed.

@emersion
Copy link
Member

But when I adjust the meson.build file as follows to allow this:

Don't do that, it won't work.

Instead, use Meson options: meson build -Dx11-backend=enabled.

@emersion
Copy link
Member

emersion commented Mar 2, 2019

Any updates on this?

@georgewsinger
Copy link
Author

georgewsinger commented Mar 2, 2019

Your last suggestion worked 👍

@emersion emersion closed this as completed Mar 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

5 participants