Aetf/kmscon

Compilation fails on Ubuntu 18.04

Aetf opened this issue · 7 comments

Aetf commented

From @************:

Compilation failed with

/home/ciro/git/kmscon/src/kmscon_terminal.c:105: undefined reference to `tsm_vte_get_def_attr'

on Ubuntu 18.04.

Aetf commented

@************

tsm_vte_get_def_attr belongs to libtsm. Have you installed libtsm first?

I had installed:

ii  libtsm-dev:amd64                                                 3-1build1                                   amd64        Terminal-emulator State Machine - development
ii  libtsm3:amd64                                                    3-1build1                                   amd64        Terminal-emulator State Machine - runtime

otherwise the ./configure was failing.

Aetf commented

Probably libtsm.h is messed up somehow. Try run make with verbose output:

make V=1

and paste the output here.

Also, check if tsm_vte_get_def_attr is present in /usr/include/libtsm.h.

Part that looks interesting:

gcc -DHAVE_CONFIG_H -I.  -DBUILD_MODULE_DIR='"/usr/local/lib/kmscon"' -include ./config.h -I ./src    -Wall -pipe -fno-common -ffast-math -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -ffunction-sections -fdata-sections -fstack-protector -g -O2  -g -O2 -MT src/kmscon-kmscon_terminal.o -MD -MP -MF src/.deps/kmscon-kmscon_terminal.Tpo -c -o src/kmscon-kmscon_terminal.o `test -f 'src/kmscon_terminal.c' || echo './'`src/kmscon_terminal.c
src/kmscon_terminal.c: In function ‘do_clear_margins’:
src/kmscon_terminal.c:105:2: warning: implicit declaration of function ‘tsm_vte_get_def_attr’; did you mean ‘tsm_screen_set_def_attr’? [-Wimplicit-function-declaration]
  tsm_vte_get_def_attr(scr->term->vte, &attr);
  ^~~~~~~~~~~~~~~~~~~~
  tsm_screen_set_def_attr
mv -f src/.deps/kmscon-kmscon_terminal.Tpo src/.deps/kmscon-kmscon_terminal.Po
/bin/bash ./libtool  --tag=CC   --mode=link gcc -Wall -pipe -fno-common -ffast-math -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -ffunction-sections -fdata-sections -fstack-protector -g -O2  -g -O2 -Wl,--as-needed -Wl,--gc-sections -Wl,-z,relro -Wl,-z,now -rdynamic  -o kmscon src/kmscon-conf.o src/kmscon-pty.o src/kmscon-font.o src/kmscon-font_8x16.o src/kmscon-text.o src/kmscon-text_bblit.o src/kmscon-kmscon_module.o src/kmscon-kmscon_seat.o src/kmscon-kmscon_conf.o src/kmscon-kmscon_main.o src/kmscon-kmscon_dummy.o src/kmscon-kmscon_terminal.o  -lxkbcommon -ltsm libeloop.la libuterm.la libshl.la -lpthread -ldl
libtool: link: gcc -Wall -pipe -fno-common -ffast-math -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -ffunction-sections -fdata-sections -fstack-protector -g -O2 -g -O2 -Wl,--as-needed -Wl,--gc-sections -Wl,-z -Wl,relro -Wl,-z -Wl,now -rdynamic -o kmscon src/kmscon-conf.o src/kmscon-pty.o src/kmscon-font.o src/kmscon-font_8x16.o src/kmscon-text.o src/kmscon-text_bblit.o src/kmscon-kmscon_module.o src/kmscon-kmscon_seat.o src/kmscon-kmscon_conf.o src/kmscon-kmscon_main.o src/kmscon-kmscon_dummy.o src/kmscon-kmscon_terminal.o  -ltsm ./.libs/libeloop.a ./.libs/libuterm.a -ludev -ldrm ./.libs/libshl.a -lxkbcommon -lGLESv2 -lpthread -ldl -pthread
src/kmscon-kmscon_terminal.o: In function `do_clear_margins':
/home/ciro/git/kmscon/src/kmscon_terminal.c:105: undefined reference to `tsm_vte_get_def_attr'
collect2: error: ld returned 1 exit status
Makefile:1410: recipe for target 'kmscon' failed
make[2]: *** [kmscon] Error 1
Makefile:2109: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
Makefile:1085: recipe for target 'all' failed
make: *** [all] Error 2

The file /usr/include/libtsm.h does not contain tsm_vte_get_def_attr.

Aetf commented

I got it. The package in the official repo is rather old. You could try compile from source using my fork: Aetf/libtsm.

Thanks, that makes it compile, we can close this issue.

Then on Ubuntu, I go to Ctrl-Alt-F3 TTY and run ./kmscon, it just hangs, and I can't switch back to the graphical TTY anymore with Ctrl-Alt-F2.

I'm just a complete newbie trying to get any KMS / DRM / DRI example working to have some fun, hopefully as minimal as possible, and hopefully on QEMU Buildroot for: https://github.com/************/linux-kernel-module-cheat

Also tried https://github.com/dvdhrm/docs/blob/master/drm-howto/modeset.c on Ubuntu but it says:

drm device '/dev/dri/card0' does not support dumb buffers

as in: dvdhrm#113

Aetf commented

I haven't used Ubuntu for a long time... I suggest you have a look at the article in ArchWiki. Even though it's for Arch Linux, it has some information in general as well.