Re: Porting NX: 64bit problems
On Thu, Sep 17, 2015 at 4:30 PM, Adam Jacksonwrote: > On Tue, 2015-09-01 at 00:09 +0200, Ulrich Sibiller wrote: >> So I am looking for some advice how to solve this in a clean fashion. >> Is there a document describing how to cleanly use libX11 calls from a >> server? Is there some kind of best practice? Code examples? Does >> anybody have some glue code that takes care of datatype conversion for that >> purpose? > > It's not easy or pretty, but it can be done. Xnest is probably the > simplest example, hw/xnest/Xnest.h has some boilerplate for renaming > types appropriately. DMX has a more complicated version of the same > thing. Thank you. There's something similar to Xnest.h called Agent.h in the NX sources but it does not seem to solve the problem completely. The problem is that XKB exists in the server and in the lib. Still investigating. > The other option is to strictly segregate the code the way pre-xcb-port > Xephyr did, where all the xlib calls are in one file and the server > interface in another, and you define your own types to pass stuff back > and forth. This looks promising. However, it means touch a lot of places so I'll try to solve it with the other suggestion for now. Thank you, Uli ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: Porting NX: 64bit problems
On Tue, 2015-09-01 at 00:09 +0200, Ulrich Sibiller wrote: > So I am looking for some advice how to solve this in a clean fashion. > Is there a document describing how to cleanly use libX11 calls from a > server? Is there some kind of best practice? Code examples? Does > anybody have some glue code that takes care of datatype conversion for that > purpose? It's not easy or pretty, but it can be done. Xnest is probably the simplest example, hw/xnest/Xnest.h has some boilerplate for renaming types appropriately. DMX has a more complicated version of the same thing. The other option is to strictly segregate the code the way pre-xcb-port Xephyr did, where all the xlib calls are in one file and the server interface in another, and you define your own types to pass stuff back and forth. - ajax ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Porting NX: 64bit problems
Hello, I am currently trying to port the (old) code of NoMachine NX to modular X. The code as released by NoMachine and maintained t the x2go project [1] is mostly based on the Xorg 6.9 tree. My first goal is to port that code to Xorg 7.0 as 6.9 and 7.0 share the same code (after that updating step by step to the current Xorg is planned). While I have succeeded in doing this for a 32bit environment I am struggling on the 64bit version. The problem is that the xserver (nxagent) has a different size than libX11 for some data types. This can been seen especially in the xkb area. The code calls libX11's XKBGetKeyboard() [2] to receive an XkbDescPtr. XkbDescRec points to an XkbNamesRec, structure which consists of several Atoms and Atom is 64bit in libX11 but 32bit in nxagent. Accessing that data leads to wrong values at best and crashes at worse. The reason for this is the _XSERVER64 define which is set within the xserver but not within libX11. I can work around this to some degree by undefining _XSERVER64 in the server code (but I see crashes when freeing stuff later in the xkb parts of the server because there the datatype size also differs from the one in libX11). The 6.9 based NX code solves this by always compiling _everything_ including libX11 with _XSERVER64 defined. I do not want to do this because I want to keep as close as possible to the upstream Xorg code which defines _XSERVER64 only for the server code. So I am looking for some advice how to solve this in a clean fashion. Is there a document describing how to cleanly use libX11 calls from a server? Is there some kind of best practice? Code examples? Does anybody have some glue code that takes care of datatype conversion for that purpose? Thank you, Uli [1] http://code.x2go.org/gitweb?p=nx-libs.git;a=summary [2] http://code.x2go.org/gitweb?p=nx-libs.git;a=blob;f=nx-X11/programs/Xserver/hw/nxagent/Keyboard.c;h=e3b58b6c72e03a1143b6294cb5812ebcc40fce4b;hb=HEAD#l954 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel