Fwd: What is the xawt sizer wrapper, really?
Artem Ananiev
artem.ananiev at oracle.com
Thu Jun 14 10:49:50 UTC 2012
Hi, Magnus,
(Please, keep me in CC as I'm not subscribed to this alias)
in XAWT, we don't have much native code. Xlib routines are called via
sun.awt.X11.XlibWrapper, and Xlib structures are accessed via Unsafe +
wrapper classes. For example, there is no XWMHints.java in the
workspace: it's generated in build-time based on the information from
sun/awt/X11/generator/xlibtypes.
Generation process include creating a new sizer.c file for each
structure described in "xlibtypes", compiling it and calling the
resulted binary to get offsets for all the structure fields. Then a new
Java class is generated with a number of get_* and set_* methods, which
are implemented as calls to Native (which is Unsafe internally). Here
are a few method from auto-generated XWMHints.java:
public long get_flags() { log.finest("");return
(Native.getLong(pData+0)); }
public void set_flags(long v) { log.finest("");
Native.putLong(pData+0, v); }
public int get_initial_state() { log.finest("");return
(Native.getInt(pData+12)); }
public void set_initial_state(int v) { log.finest("");
Native.putInt(pData+12, v); }
I don't remember the exact issue about Solaris-x64, why it's handled
separately and includes manual generation.
What are exact issues you observe with the wrapper generator?
Thanks,
Artem
> We've had series of recurring issues with the xawt sizer wrapper (as
> defined in jdk/make/sun/xawt/Makefile) -- we've called it the
> X11Wrapper, I'm not sure if it has any other, more proper name.
>
> First of all, I must ask: what is the purpose of this? Does anybody here
> know, and can explain?
>
> The logic of this makefile is quite convoluted, with multi-step
> generation and execution. Is this really neccessary?
>
> The real problem, from our point of view, is not the complex
> generate/run/generate scheme -- make handles that for us. The problem is
> the interaction between the build and target platform, and the reason
> for having both 32 and 64-bit versions.
>
> Appearantly, we build both a 32 and a 64 bit version on some platforms,
> and then try to execute both. This works with varying degree of success
> depending on what build OS you're using and how it is configured. :-)
>
> Do we really need to do this? And why?
>
> Also, for 64-bit solaris we compare the generated file with a checked-in
> version, and if it differs, the build fail! So in reality, on this
> platform, we're not really doing real build work, but rather verifying
> that the build system looks like expected. But this is something that
> should be done in configure, rather as part of the build. If this is the
> real reason for this wrapper, could we perhaps generate these
> sizes-files for all platforms and check them in, and just verify them as
> part of configure?
>
> /Magnus
> (who have been working hard with the X11Wrapper for quite some time and
> still is totally confused about it's purpose and workings)
More information about the build-dev
mailing list