[FreeNX-kNX] Compiling NX1.5.0 on amd64

Xiong Jiang linuster at gmail.com
Sat Sep 24 13:01:04 UTC 2005


Once nxagent is built in nx-X11/programs/Xserver/nxagent, you should be able
to start it like './nxagent :11'.

ldd ./nxagent shows if it is linked with the right libs.

amd64:/home/jxiong/NX/nx-X11/programs/Xserver# ldd ./nxagent
libXext-nx.so.6 => /usr/lib/libXext-nx.so.6 (0x0000002a9566e000)
libX11-nx.so.6 => /usr/lib/libX11-nx.so.6 (0x0000002a9577e000)
libz.so.1 => /usr/lib/libz.so.1 (0x0000002a95961000)
libm.so.6 => /lib/libm.so.6 (0x0000002a95a75000)
libXpm.so.4 => /usr/X11R6/lib/libXpm.so.4 (0x0000002a95bfa000)
libXcomp.so.1 => /usr/lib/libXcomp.so.1 (0x0000002a95d0b000)
libXcompext.so.1 => /usr/lib/libXcompext.so.1 (0x0000002a95f2e000)
libXrender-nx.so.1 => /usr/lib/libXrender-nx.so.1 (0x0000002a960c5000)
libc.so.6 => /lib/libc.so.6 (0x0000002a961ce000)
libdl.so.2 => /lib/libdl.so.2 (0x0000002a9640b000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x0000002a9650e000)
libpng12.so.0 => /usr/lib/libpng12.so.0 (0x0000002a966ea000)
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x0000002a96811000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x0000002a96932000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0000002a96b3b000)
/lib64/ld-linux-x86-64.so.2 (0x0000002a95556000)

I copied those libX11-nx, libXext-nx, libXrender-nx to /usr/lib so it's
easier for it to be located.

First problem I hit is at lib/X11/IntAtom.c:240

if ((state->atoms[i] = repl->atom))
_XUpdateAtomCache(dpy, state->names[i], (Atom) repl->atom,
(unsigned long)0, idx, 0);

This doesn't sound right. Should it be "if ((state->atoms[i] ==
repl->atom))"?
It's just my vague guess since the author may have omit a comment here
justifying the use of '='. This causes segfault later in _XUpdateAtomCache()
because the state->names[i] is invalid pointer.

Then I tried to make it as '=='. However I got problems in
programs/Xserver/hw/nxagent/Atoms.c:517

if (aMap == NULL)
{
Atom local = MakeAtom(name_list[i], strlen(name_list[i]), True);

The name_list[0] is a NULL pointer and it causes segfault in MakeAtom.

Maybe name_list is not correctly initialized in XInternAtoms() as I am
tampering with it.

Well, that's my attempt so far. Hope this is clear if any of you want to
continue the debugging. Btw, I had to add '-g' in Makefile to generate the
debug information. This is easy once you know the build commands to use.

I am still quite surprised about the package being released in such a shape.
Maybe NoMachine is short of resources as well.

Thanks,
Xiong

On 9/24/05, Xiong Jiang <linuster at gmail.com> wrote:
>
> OK, finally managed to build the stuff.
>
> at lib/X11/XlcDL.c:64, I made it like:
>
> #ifdef _LP64
> # if defined(__sparcv9)
> # define _MACH64_NAME "sparcv9"
> # elif defined(__ia64__)
> # undef MACH64_NAME
> # else
> # undef MACH64_NAME
> /*# error "Unknown architecture"
> */
> # endif /* defined(__sparcv9) */
> # ifdef _MACH64_NAME
> # define _MACH64_NAME_LEN (sizeof (_MACH64_NAME) - 1)
> # endif
> #endif /* _LP64 */
>
> I am not sure if it really matters. Just to make it compile.
>
> Now after nxcomp and nxcompext are built, you should be able to 'make
> World' under nx-X11. The directory names are hardcoded in makefile so you
> should not rename the directories unpacked from .tar.gz tarballs.
>
> Three libs are replaced by NX: libX11, libXext, libXrender.
> I changed in Makefile to use LIBNAME=X11-nx and Xext-nx, Xrender-nx for
> them. so that it's easier to distinguish it from the libX11 installed. I
> don't know much about the Imakefile system so I changed the Makefile and
> build again. Some other makefiles are modified accordingly as they will link
> with the libX11-nx, libXext-nx, libXrender-nx we just built.
>
> Again, I haven't found out how to change the Imake config files to do this
> easily. If you know the trick, please share with us.
>
> nxagent will be built when 'make' under nx-X11/programs. A problem here
> again:
> lib/freetype2 and fontconfig is not built as shared lib, but nxagent needs
> to link to it. Maybe I did something wrong here again by changing it to
> build a shared lib. But Imake gurus please point me to the right way.
>
> nxagent/Makefile also got problem that it cannot find the libX11-nx,
> libXext-nx, libXrender-nx.
>
> See, a deb source package will save me all the hassle of tampering with
> Makefile.
> However nx-X11 is not in svn://svn.debian.org/pkg-nx yet.
> I am write from my short memory in late night, my words here is so vague.
> I need to redo this and find the right answer.
>
> OK here is the story of compiling. It still doesn't work though.
>
> See my next email about the bugs I hit.
>
> Xiong
>
> On 9/24/05, Xiong Jiang <linuster at gmail.com> wrote:
> >
> > OK, let's start this thread for problems encountered in compiling NX on
> > debian-amd64.
> > I am trying gcc 3.3.6 first since I had failure with gcc4 on 1.4.0.2<http://1.4.0.2>before.
> >
> > I have the following source tarballs From
> > http://www.nomachine.com/sources.php:
> >
> > nxagent-1.5.0-90.tar.gz nxesd-1.5.0-3.tar.gz nxssh-1.5.0-21.tar.gz
> > nxauth-1.5.0-1.tar.gz nxproxy-1.5.0-9.tar.gz nxuexec-1.5.0-3.tar.gz
> > nxcomp-1.5.0-65.tar.gz nxscripts-1.5.0-11.tar.gz
> > nxviewer-1.5.0-14.tar.gz
> > nxcompext-1.5.0-16.tar.gz nxsensor-1.5.0-5.tar.gz nxwin-1.5.0-3.tar.gz
> > nxdesktop-1.5.0-61.tar.gz nxspool-1.5.0-2.tar.gz nx-X11-1.5.0-15.tar.gz
> >
> > My progress so far:
> >
> > nxcomp:
> > Need forward declaration patch in RenderExtension.h
> > Need -fPIC in Makefile
> > It builds after the patches
> >
> > nxproxy:
> > builds OK
> >
> > nx-X11
> > Need to unpack nxagent and nxauth after unpack nx-X11. They will be
> > unpacked into
> > nx-X11 directory as well.
> > make World OK
> > When make install, got XlcDL.c:64:4: #error "Unknown architecture"
> >
> > #ifdef _LP64
> > # if defined(__sparcv9)
> > # define _MACH64_NAME "sparcv9"
> > # elif defined(__ia64__)
> > # undef MACH64_NAME
> > # else
> > # error "Unknown architecture"
> > # endif /* defined(__sparcv9) */
> > # ifdef _MACH64_NAME
> > # define _MACH64_NAME_LEN (sizeof (_MACH64_NAME) - 1)
> > # endif
> > #endif /* _LP64 */
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/freenx-knx/attachments/20050924/6e980764/attachment.html>


More information about the FreeNX-kNX mailing list