You are not logged in.

#1 2020-11-15 16:11:37

sshaikh
Member
Registered: 2019-07-03
Posts: 20

[SOLVED] Manually creating xorgxrdp throws "undefined symbol" error

I am trying to manually build and install xordxrdp, PKGBUILD here: https://aur.archlinux.org/cgit/aur.git/ … h=xorgxrdp. My primary reason for doing so is to include a specific flag to configure.

After editing the PKGBUILD makepkg -si successfully builds and installs the package[1]. However during use it throws the following errors:

[    53.247] (EE) Failed to load /usr/lib/xorg/modules/libxorgxrdp.so: /usr/lib/xorg/modules/libxorgxrdp.so: undefined symbol: glamor_xv_init
[    53.248] (EE) Failed to load /usr/lib/xorg/modules/drivers/xrdpdev_drv.so: /usr/lib/xorg/modules/drivers/xrdpdev_drv.so: undefined symbol: rdpRRModeDestroy
[    53.248] (EE) Failed to load /usr/lib/xorg/modules/input/xrdpmouse_drv.so: /usr/lib/xorg/modules/input/xrdpmouse_drv.so: undefined symbol: rdpUnregisterInputCallback
[    53.249] (EE) Failed to load /usr/lib/xorg/modules/input/xrdpkeyb_drv.so: /usr/lib/xorg/modules/input/xrdpkeyb_drv.so: undefined symbol: rdpUnregisterInputCallback

I noticed that during building I get the following warnings which appear related:

libtool: warning: remember to run 'libtool --finish /usr/lib/xorg/modules'
libtool: warning: remember to run 'libtool --finish /usr/lib/xorg/modules/drivers'
libtool: warning: remember to run 'libtool --finish /usr/lib/xorg/modules/input'

However when using the original PKGBUILD, I see the same libtool warnings during installation, yet the software works okay.

Should I run the libtool commands? What do they do? The man page just says "complete the installation of the libtool libraries". I see that the files exist, so what is there to finish?
If the commands do need to be run, should they be placed in the PKGBUILD?

[1] I needed help including a build location: https://bbs.archlinux.org/viewtopic.php?pid=1936388

Last edited by sshaikh (2020-11-15 21:03:22)

Offline

#2 2020-11-15 19:24:18

loqs
Member
Registered: 2014-03-06
Posts: 12,094

Re: [SOLVED] Manually creating xorgxrdp throws "undefined symbol" error

  CFLAGS+=" $(pkgconf --cflags libdrm)" LDFLAGS+=" -L/usr/lib/xorg/modules -lglamoregl" ./configure \
    --prefix="/usr" -enable-glamor

Does the above fix the first error?

Offline

#3 2020-11-15 19:37:32

sshaikh
Member
Registered: 2019-07-03
Posts: 20

Re: [SOLVED] Manually creating xorgxrdp throws "undefined symbol" error

It did not, but the errors have changed slightly:

[  3146.782] (EE) Failed to load /usr/lib/xorg/modules/input/xrdpkeyb_drv.so: libglamoregl.so: cannot open shared object file: No such file or directory

Last edited by sshaikh (2020-11-15 19:42:17)

Offline

#4 2020-11-15 20:41:28

loqs
Member
Registered: 2014-03-06
Posts: 12,094

Re: [SOLVED] Manually creating xorgxrdp throws "undefined symbol" error

  CFLAGS+=" $(pkgconf --cflags libdrm)" LDFLAGS+=" -L/usr/lib/xorg/modules -lglamoregl -Wl,-rpath,/usr/lib/xorg/modules" ./configure \
    --prefix="/usr" -enable-glamor

This is quite horrible but does it load the library and resolve all the glamor symbols?

Offline

#5 2020-11-15 20:47:52

sshaikh
Member
Registered: 2019-07-03
Posts: 20

Re: [SOLVED] Manually creating xorgxrdp throws "undefined symbol" error

That did the trick! Is that the final solution or an experiment to figure out what's wrong (eg with the makefile etc)? I'd be glad to refer this thread to upstream if there's something they can do to fix it their side.

Last edited by sshaikh (2020-11-15 20:54:12)

Offline

#6 2020-11-15 20:59:43

loqs
Member
Registered: 2014-03-06
Posts: 12,094

Re: [SOLVED] Manually creating xorgxrdp throws "undefined symbol" error

I would expect it all to done by the configure script.  The commit that added glamor support [1] seems to only checksfor xorg-server > 1.19.
Would like another opinion on that though.

[1] https://github.com/neutrinolabs/xorgxrd … 960ff5d982

Offline

#7 2020-11-15 21:02:02

sshaikh
Member
Registered: 2019-07-03
Posts: 20

Re: [SOLVED] Manually creating xorgxrdp throws "undefined symbol" error

It appears to have only struck Arch (and derivative) users only - I just happened to have lucked out finding someone who could help.

I'll throw the solution their way anyway.

Thanks for the help!

Last edited by sshaikh (2020-11-15 21:02:18)

Offline

#8 2020-11-16 11:38:10

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 8,587

Re: [SOLVED] Manually creating xorgxrdp throws "undefined symbol" error

loqs wrote:

I would expect it all to done by the configure script.  The commit that added glamor support [1] seems to only checksfor xorg-server > 1.19.
Would like another opinion on that though.

[1] https://github.com/neutrinolabs/xorgxrd … 960ff5d982

I checked https://github.com/neutrinolabs/xorgxrd … nfigure.ac and agree.


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#9 2020-11-16 12:07:42

sshaikh
Member
Registered: 2019-07-03
Posts: 20

Re: [SOLVED] Manually creating xorgxrdp throws "undefined symbol" error

So would that be another PKGCHECK line that checks for glamour? Does doing the check alone resolve the linking requirement later?

Also, why does adding that xorg-server check cause issues with the xRDP modules? They seem unrelated and work without it.

I'll have a play to see if I can fix this in the source to send back upstream.

Offline

#10 2020-11-16 20:53:08

sshaikh
Member
Registered: 2019-07-03
Posts: 20

Re: [SOLVED] Manually creating xorgxrdp throws "undefined symbol" error

So I had said play and didn't get very far.

Firstly, I fell down a rabbit hole trying to find the name of the glamor package to check for. I checked the contents of /user/{lib,share}/pkconfig/ but didn't find anything useful. I tried glamoregl but that resulted in a "couldn't be found" error

Secondly, I tried answering my question above about the utility of PKGCHECK. It seems it is literally just a check[1], so even if I did find the right package to check for I don't think it would solve anything.

Finally, I realised that I still don't know what the issue is, partly because I don't understand why a missing glamor dependency would also break what seems like unrelated rdp dependencies which were working previously.

On the bright side I am more familiar with PKGBUILDs and makepkg so this isn't a total waste of time smile

[1]https://autotools.io/pkgconfig/pkg_check_modules.html

Last edited by sshaikh (2020-11-16 20:53:52)

Offline

#11 2020-11-16 21:16:47

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,768

Re: [SOLVED] Manually creating xorgxrdp throws "undefined symbol" error

The main thing the PKG_CHECK_MODULES would do is define GLAMOR_CFLAGS and GLAMOR_LIBS for later use, but that depends on actually adding those new variables to some Makefile.am target you'd like to have link to glamor.

EDIT: glamor isn't a pkg-config library, it is /usr/lib/xorg/modules/libglamoregl.so and I'm not sure a program is supposed to directly link to these...

Last edited by eschwartz (2020-11-16 21:17:49)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#12 2020-11-16 21:53:46

loqs
Member
Registered: 2014-03-06
Posts: 12,094

Re: [SOLVED] Manually creating xorgxrdp throws "undefined symbol" error

Enabling the glamor option also fails if libdrm or glew are not installed so those should be checked for.

I think you could use something similar to the following to get the X server module location:

PKG_CHECK_VAR([XORG_SERVER_MODULES], [xorg-server], [moduledir])

Not to say a program should do that.

Offline

#13 2020-11-16 22:49:26

sshaikh
Member
Registered: 2019-07-03
Posts: 20

Re: [SOLVED] Manually creating xorgxrdp throws "undefined symbol" error

I see, so this is less a matter of misconfiguration and more something a little more structural? If so I'll probably draw a line under it here. I've passed your findings and this thread to the developers.

Thanks again for the help and fix.

Offline

#14 2020-11-17 00:21:50

loqs
Member
Registered: 2014-03-06
Posts: 12,094

Re: [SOLVED] Manually creating xorgxrdp throws "undefined symbol" error

The following patch is an attempt to add detection to configure.ac and */Makefile.am
I previously mentioned glew,  it should have been epoxy.

diff --git a/configure.ac b/configure.ac
index 7a0d5ce..72e8030 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,6 +25,9 @@ PKG_CHECK_MODULES([XORG_SERVER], [xorg-server >= 0], [],
   [AC_MSG_ERROR([please install xserver-xorg-dev, xorg-x11-server-sdk or xorg-x11-server-devel])])
 if test "x${enable_glamor}" = "xyes"; then
   PKG_CHECK_MODULES([XORG_SERVER_GLAMOR], [xorg-server >= 1.19.0])
+  PKG_CHECK_MODULES([LIBDRM], [libdrm])
+  PKG_CHECK_MODULES([EPOXY], [epoxy])
+  PKG_CHECK_VAR([XORG_SERVER_MODULES], [xorg-server], [moduledir])
 fi
 
 if test "x$XRDP_CFLAGS" = "x"; then
diff --git a/module/Makefile.am b/module/Makefile.am
index e3e9ba5..be0bebe 100644
--- a/module/Makefile.am
+++ b/module/Makefile.am
@@ -22,12 +22,13 @@ if WITH_GLAMOR
 EXTRA_FLAGS += -DXORGXRDP_GLAMOR -DGLAMOR_FOR_XORG
 EXTRA_SOURCES += rdpEgl.c
 EXTRA_HEADERS += rdpEgl.h
-EGLLIB += -lepoxy
 endif
 
 AM_CFLAGS = \
   $(XORG_SERVER_CFLAGS) \
   $(XRDP_CFLAGS) \
+  $(LIBDRM_CFLAGS) \
+  $(EPOXY_CFLAGS) \
   -DPACKAGE_VERSION_MAJOR=@package_version_major@ \
   -DPACKAGE_VERSION_MINOR=@package_version_minor@ \
   -DPACKAGE_VERSION_PATCHLEVEL=@package_version_patchlevel@ \
@@ -82,6 +83,9 @@ noinst_HEADERS = \
 libxorgxrdp_la_LTLIBRARIES = libxorgxrdp.la
 
 libxorgxrdp_la_LDFLAGS = -module -avoid-version
+if WITH_GLAMOR
+libxorgxrdp_la_LDFLAGS += $(EPOXY_LDFLAGS)
+endif
 
 libxorgxrdp_ladir = $(moduledir)
 
diff --git a/xrdpdev/Makefile.am b/xrdpdev/Makefile.am
index 6787c66..30c9019 100644
--- a/xrdpdev/Makefile.am
+++ b/xrdpdev/Makefile.am
@@ -13,6 +13,7 @@ endif
 AM_CFLAGS = \
   $(XORG_SERVER_CFLAGS) \
   $(XRDP_CFLAGS) \
+  $(LIBDRM_CFLAGS) \
   -DPACKAGE_VERSION_MAJOR=@package_version_major@ \
   -DPACKAGE_VERSION_MINOR=@package_version_minor@ \
   -DPACKAGE_VERSION_PATCHLEVEL=@package_version_patchlevel@ \
diff --git a/xrdpkeyb/Makefile.am b/xrdpkeyb/Makefile.am
index 3e0ecbd..2b29fab 100644
--- a/xrdpkeyb/Makefile.am
+++ b/xrdpkeyb/Makefile.am
@@ -11,6 +11,9 @@ AM_CFLAGS = \
 xrdpkeyb_drv_la_LTLIBRARIES = xrdpkeyb_drv.la
 
 xrdpkeyb_drv_la_LDFLAGS = -module -avoid-version
+if WITH_GLAMOR
+xrdpkeyb_drv_la_LDFLAGS += -L$(XORG_SERVER_MODULES) -lglamoregl -Wl,-rpath,$(XORG_SERVER_MODULES)
+endif
 
 xrdpkeyb_drv_ladir = $(moduledir)/input
 
 

Last edited by loqs (2020-11-17 00:45:10)

Offline

#15 2020-11-17 20:51:04

sshaikh
Member
Registered: 2019-07-03
Posts: 20

Re: [SOLVED] Manually creating xorgxrdp throws "undefined symbol" error

The patch didn't work at first blush, but did when I added the missing parameters to libxorgxrdp_la_LDFLAGS:

+libxorgxrdp_la_LDFLAGS += $(EPOXY_LDFLAGS) -L$(XORG_SERVER_MODULES) -lglamoregl -Wl,-rpath,$(XORG_SERVER_MODULES)

Thanks again

Offline

Board footer

Powered by FluxBB