Bug 113134 - ksmserver does not compile
Summary: ksmserver does not compile
Status: RESOLVED NOT A BUG
Alias: None
Product: kdm
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR grave
Target Milestone: ---
Assignee: kdm bugs tracker
URL:
Keywords:
: 113045 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-09-23 11:21 UTC by mathpup
Modified: 2008-05-19 17:30 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Add libXau configure check to kdmlib (1.72 KB, patch)
2005-10-12 17:03 UTC, Thiago Macieira
Details
Add libXau configure check to kdmlib (1.72 KB, patch)
2005-10-12 17:03 UTC, Thiago Macieira
Details
Add libXau configure check to kdmlib (1.72 KB, patch)
2005-10-12 17:04 UTC, Thiago Macieira
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mathpup 2005-09-23 11:21:52 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc version 3.3.5 20050117 (prerelease) (SUSE Linux) Latest compiler for SUSE 9.3
OS:                Linux

Recent kdebase/ksmserver fails to compile.

make[1]: Entering directory `/home/marcus/src/kde/kdebase/ksmserver'
/bin/sh ../libtool --silent --tag=CXX --mode=link g++  -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -pipe -O3 -march=k8 -ffast-math -funroll-all-loops -fpeel-loops -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -D_GNU_SOURCE   -L/usr/lib64 -L/usr/local/lib64 -o libkdeinit_ksmserver.la -rpath /opt/kde3/lib -no-undefined -avoid-version -L/opt/kde3/lib -L/usr/lib/qt3/lib64 -L/usr/X11R6/lib64    -L/usr/local/lib64 -L/usr/lib64 main.lo server.lo shutdown.lo KSMServerInterface_skel.lo server_skel.lo ../kdmlib/libdmctl.la -lkdeui
/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../../x86_64-suse-linux/bin/ld: /usr/X11R6/lib64/libXau.a(AuFileName.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/X11R6/lib64/libXau.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [libkdeinit_ksmserver.la] Error 1
Comment 1 Philip Rodrigues 2005-09-23 11:38:29 UTC
Same error as in bug 113045, though the compiler version and distro are different here (FWIW).
Comment 2 Thiago Macieira 2005-09-23 13:13:10 UTC
Thanks Philip.

*** This bug has been marked as a duplicate of 113045 ***
Comment 3 mathpup 2005-09-24 01:14:42 UTC
This is *not* a duplicate of bug 113045. The problem was introduced about 3 days ago. The Makefile.am in kdmlib was changed so that it links against libXau.a. It appears not to be possible to link statically against this lib on SUSE X86_64.

http://websvn.kde.org/branches/KDE/3.5/kdebase/kdmlib/Makefile.am?rev=462294&view=log
Comment 4 Thiago Macieira 2005-09-24 03:48:14 UTC
Ok, sorry. It's not a duplicate.

It's no bug at all. Just make the libXau.so (shared library) version available.

This looks like a libtool bug for me. But it may never be solved (kdeinit), so please install the shared library version.
Comment 5 mathpup 2005-09-24 05:43:38 UTC
Where do I get a shared version of libXau.so? Suse does not provide one. Many 
other distros do not provide one, either.

You are basicly saying that that KDE 3.5 will not support Suse 9.3 on X86_64, 
given that there is no libXau.so provided for it.



On Friday 23 September 2005 8:48 pm, Thiago Macieira wrote:
[bugs.kde.org quoted mail]
Comment 6 Thiago Macieira 2005-09-24 05:53:49 UTC
Cartman: can you explain why kdmlib needs to link to libXau? It's not provided as a shared library in most distros, so kdmlib should never link to it.
Comment 7 Thiago Macieira 2005-09-24 06:02:31 UTC
*** Bug 113045 has been marked as a duplicate of this bug. ***
Comment 8 Ismail Donmez 2005-09-24 12:02:11 UTC
It needs libXau because of new GDM support which uses XAuth functions. Maybe we need some ifdefs or maybe I missed something as it doesn't compile for me without linking to libXau. 
Comment 9 Ismail Donmez 2005-09-24 12:09:49 UTC
Well also note that what reporter says is a 1) Afaik a gcc bug ( needing -fPIC for static libs ) 2) Distro bug ( You need to use -fPIC for amd64) . This bug is very much invalid in my opinion.
Comment 10 Thiago Macieira 2005-09-24 18:11:03 UTC
No, creating a shared library with dependency on a static one is not acceptable. libtool can cope with it, but we don't want that.

So, unless libXau is distributed in .so, I oppose to making ksmserver use it. I have to rebuild my KDE to verify what the consequences are, but so far I don't see how this could work anywhere at all.
Comment 11 mathpup 2005-09-25 06:24:59 UTC
So your proposed solution is to tell Suse users on AMD64 that KDE 3.5 will not 
be compilable without patches to KDE or recompiling X.org from source?


On Saturday 24 September 2005 5:09 am, ismail  donmez wrote:
> ------- Additional Comments From ismail uludag org tr  2005-09-24 12:09
> ------- Well also note that what reporter says is a 1) Afaik a gcc bug (
> needing -fPIC for static libs ) 2) Distro bug ( You need to use -fPIC for
> amd64) . This bug is very much invalid in my opinion.

Comment 12 Thiago Macieira 2005-09-25 06:46:49 UTC
As I said, I will investigate further. But, yes, that may very well be the proposed solution: recompile libXau with -fPIC.

In fact, can anyone tell me if that works?
Comment 13 mathpup 2005-09-25 06:58:16 UTC
But omitting -lXau fixes the compilation problems on my system. kdebase 
compiles just fine without it.


> ------- Additional Comments From thiago kde org  2005-09-25 06:46 -------
> As I said, I will investigate further. But, yes, that may very well be the
> proposed solution: recompile libXau with -fPIC.
>
> In fact, can anyone tell me if that works?

Comment 14 Ismail Donmez 2005-09-25 09:02:00 UTC
I will investigate this today. Meanwhile you should tell Suse to use -fPIC on amd64 which is a _must_ and not _should_.
Comment 15 Ismail Donmez 2005-09-26 10:37:02 UTC
Ok I checked this bug and kdmlib/dmctl.cpp has this :

void
DM::GDMAuthenticate()
{

[...]
        Xauth *xau;
[...]
        while ((xau = XauReadAuth( fp ))) {

etc which comes from libXau. So we need to link to libXau.
Comment 16 Ismail Donmez 2005-09-26 10:39:50 UTC
Problem is in kdmlib though I don't see any problem. Assigning to kdm maintainer Ossi to get his comments on this.
Comment 17 Oswald Buddenhagen 2005-09-26 16:08:52 UTC
to put it straight: yes, the problem is that x provides a static library Xau, which we are now linking to ksmserver (which is a dynamic library due to the kdeinit magic). on some systems, this plainly does not work.
i've seen this fixed recently in Xorg cvs. i have nothing better to offer than to wait ...
Comment 18 Ismail Donmez 2005-09-26 16:10:34 UTC
Tested on Ubuntu & Gentoo both provide a libXau.so .
Comment 19 Thiago Macieira 2005-09-27 02:22:00 UTC
I have just tested and libXau.a is NOT necessary. All Xau* symbols in use by kdmlib are provided by libX11, not libXau:

$ grep -r Xau . | grep -v \\.svn
./dmctl.cpp:#include <X11/Xauth.h>
./dmctl.cpp:    Xauth *xau;
./dmctl.cpp:    if (!(fp = fopen( XauFileName(), "r" )))
./dmctl.cpp:    while ((xau = XauReadAuth( fp ))) {
./dmctl.cpp:                            XauDisposeAuth( xau );
./dmctl.cpp:            XauDisposeAuth( xau );
./Makefile.am:libdmctl_la_LIBADD = $(LIB_KDECORE) -lXau

$ nm -D /usr/X11R6/lib/libX11.so.6 | grep Xau
00041670 T XauDisposeAuth
00041920 T XauFileName
00041760 T XauGetBestAuthByAddr
00041b50 T XauReadAuth

So, cartman: how did you come to the conclusion that libXau was needed? Did you get any compilation errors?
Comment 20 Ismail Donmez 2005-09-27 08:45:43 UTC
Yes I had undefined referenced to those XAuFoo functions
Comment 21 Thiago Macieira 2005-09-27 12:47:47 UTC
Can you try and reproduce it? Tell us what symbol it is and which library it is on.
Comment 22 Ismail Donmez 2005-09-27 21:16:15 UTC
On Tuesday 27 September 2005 13:47, Thiago Macieira wrote:
[bugs.kde.org quoted mail]

Seems to compile just fine on Gentoo :/ . Maybe its a problem with Ubuntu 
Breezy's X.org .
Comment 23 Thiago Macieira 2005-09-28 02:31:02 UTC
Someone with Breezy has confirmed that some of the symbols kdmlib needs aren't present in libX11.so.

The X.org version they have is X11R6 6.8.2, which is the same I have here.

This looks like an upstream bug. Can anyone else with a distribution that is not Ubunty/Breezy see the link failure without -lXau? (or, in other words, can everyone else compile kdmlib successfully without -lXau) 
Comment 24 Oswald Buddenhagen 2005-10-03 12:22:15 UTC
well, it works for me without -lXau, obviously. debian unstable here.

i have no idea how to proceed about this report other than resolving it INVALID - get yourself updated X packages.
Comment 25 Thiago Macieira 2005-10-03 12:51:07 UTC
I agree. The commit should be reversed and a bug should be filed with Ubuntu.
Comment 26 Oswald Buddenhagen 2005-10-03 13:04:04 UTC
uhm, no, i think carman's commit is perfectly valid. even if the symbols are in libX11, libXau must still be present, as not doing it would break something like 15 years of link-time compatibility.
what is invalid (as far as kde is concerned) is the report itself - in a modern environment, libXau simply has to be a dynamic lib.
otoh, we could just work around it by adding a test whether -lXau is necessary. only if it is, it has to be a .so file.
Comment 27 Thiago Macieira 2005-10-03 13:24:45 UTC
I'd rather not add another test, if possible.

But why should we link to libXau if every distribution but Ubuntu/Breezy works without it? That's why I asked if other distributoins had the same issue.
Comment 28 Oswald Buddenhagen 2005-10-03 13:26:19 UTC
have you tested with anything older than xorg 6.8?
Comment 29 Thiago Macieira 2005-10-03 13:39:43 UTC
Yes:

System 1 (Conectiva 10):
$ nm -D libX11.so.6 | grep Xau
0003f4f0 T XauDisposeAuth
0003f7c0 T XauFileName
0003f5e0 T XauGetBestAuthByAddr
0003f9e0 T XauReadAuth
$ rpm -qf libX11.so.6
xfree86-libs-common-4.4.0-61875cl

System 2 (Conectiva 9):
$ nm -D libX11.so.6 | grep Xau
0003ef70 T XauDisposeAuth
0003f200 T XauFileName
0003f060 T XauGetBestAuthByAddr
0003f410 T XauReadAuth
$ rpm -qf libX11.so.6
XFree86-libs-common-4.3.0-28971cl
Comment 30 Oswald Buddenhagen 2005-10-03 14:41:08 UTC
hmm, interesting. can you track this down to when it was introduced? in particular, whether the proprietary unixes also have it?
Comment 31 Ismail Donmez 2005-10-03 14:48:03 UTC
This must be because Ubuntu switched to modularized X.org which must have cut down on shared symbols. Also libXau.so should be there so I suggest reporting bug to Suse too.
Comment 32 Thiago Macieira 2005-10-03 16:14:10 UTC
I don't think it was ever introduced. My system and Ubuntu/Breezy are both using X.org 6.8.2.

I can think of two explanations:

1) X.org moves those symbols to libXau.so if libXau.so is built (as opposed to just libXau.a) using a configure option

2) Ubuntu moved those symbols on their own by patching the X.org source code

If it's option #1, we should add a configure test and link if necessary. If it's option #2, Ubuntu should get a bug report and fix it.
Comment 33 Oswald Buddenhagen 2005-10-03 17:07:31 UTC
i don't think the Xau symbols were in libX11 since ever ... why would libXau exist in the first place then?
Comment 34 Thiago Macieira 2005-10-04 04:22:09 UTC
Well, for other symbols.

However, note that all symbols found in libX11 are duplicated there:
$ nm /usr/X11R6/lib/libXau.a | grep T\ Xau
00000000 T XauDisposeAuth
00000000 T XauFileName
00000040 T XauGetAuthByAddr
00000040 T XauGetBestAuthByAddr
00000000 T XauLockAuth
00000140 T XauReadAuth
00000000 T XauUnlockAuth
000000d0 T XauWriteAuth

I don't think they ended up in libX11 by accident. It must be intentional, because if libX11 linked to libXau, there would be an indirect dependency in Ubuntu and cartman would never have committed his fix.

So, this boils down to what the X developers' intentions were. And I don't feel like digging through their source code -- writing a configure test is easier.
Comment 35 Thiago Macieira 2005-10-12 17:03:25 UTC
Created attachment 12960 [details]
Add libXau configure check to kdmlib

Ossi: ksmserver doesn't build due to kdmlib (libdmctl). Should I reassign to
ksmserver, or is kdmlib yours?

Anyways, this patch adds a configure-time check for the Xau* functions libdmctl
uses and determines whether they are in libX11 or libXau. However, it does not
detect whether libXau is required but only libXau.a is provided -- it will show
just a warning then.

Could the people having problem with this issue test the patch? It works for me
here.
Comment 36 Thiago Macieira 2005-10-12 17:03:26 UTC
Created attachment 12959 [details]
Add libXau configure check to kdmlib

Ossi: ksmserver doesn't build due to kdmlib (libdmctl). Should I reassign to
ksmserver, or is kdmlib yours?

Anyways, this patch adds a configure-time check for the Xau* functions libdmctl
uses and determines whether they are in libX11 or libXau. However, it does not
detect whether libXau is required but only libXau.a is provided -- it will show
just a warning then.

Could the people having problem with this issue test the patch? It works for me
here.
Comment 37 Thiago Macieira 2005-10-12 17:04:24 UTC
Created attachment 12961 [details]
Add libXau configure check to kdmlib

Ossi: ksmserver doesn't build due to kdmlib (libdmctl). Should I reassign to
ksmserver, or is kdmlib yours?

Anyways, this patch adds a configure-time check for the Xau* functions libdmctl
uses and determines whether they are in libX11 or libXau. However, it does not
detect whether libXau is required but only libXau.a is provided -- it will show
just a warning then.

Could the people having problem with this issue test the patch? It works for me
here.
Comment 38 Thiago Macieira 2005-11-24 23:19:36 UTC
KDE 3.5.0 has been tagged and no one tested my patch.
Comment 39 mathpup 2005-11-25 04:37:53 UTC
SVN version of 3.5 branch has compiled on my system for a while (the Suse 9.3 AMD64 that had problems with -fPIC and libXau). So I do not think it is a problem on this distro.
Comment 40 Oswald Buddenhagen 2006-10-13 19:44:32 UTC
finally getting rid of it. i just assume all distros are fixed by this time.