Comment 0 for bug 137847

Revision history for this message
In , Kaare Hviid (ukh-id) wrote : xview: amd64 support

Package: xview
Version: 3.2p1.4-19
Severity: wishlist
Tags: patch sid

Trying to get XView into shape on amd64 has taken me way too long.
Considering the current transition mess and the fact that the patch
has been sitting idle without any work for a couple of months, I'd
better post it now, rather than waiting for my sid boxes to stabilize
in order to do thorough testing. So far, everything appears to work
fine on amd64 with this patch. So here goes...

The main purpose of this patch is adding amd64 support for XView. It
also attepmts to fix the following issues:

* Support for building with gcc-4.0. It should also allow
 building with gcc-3.4 and gcc-3.3.

* This patch *might* support building and running on ia64 too,
 provided you add ia64 to the Architecture line. I have yet
 to find someone willing to test this patch on their ia64
 systems though.

Random ramblings follow...

The main fix is in libxview/attr/attr.c, where an _XV_API_BROKEN_64BIT
#define will enable filtering of attributes that appear suspect, much
in the same vain as suggested in #125391. It's not 100% fool-proof
though and some attribute arguments, notably XV_KEY_DATA and
PANEL_VALUE, have to be carefully casted to (Attr_attribute) due to the
design. Also, some attributes have been wrongly defined (c.f. the
headers), why applications built on amd64 and ia64 with the previously
non-functioning xview libraries have to be rebuilt. I have taken care
*not* to change the attribute values for any other platforms.

However, the bulk of this patch consists of:

* Casting of XView attributes and ensuring that attribute lists
 are NULL-terminated rather than 0-terminated. In the case of
 gcc on Debian GNU/Linux, NULL should be #defined to (void *)0,
 ensuring that termination will be correct. Now, this isn't
 needed thanks to the filter in attr.c, but it should be of no
 harm, so I decided not to remove them.
* A lot of ANSI C prototypes. They actually helped me to track
 down a couple of 64-bit related bugs. I decided to let them
 stay as well.

There are also some other minor 64-bit fixes - and a lot of spots where
I couldn't figure out the Right thing to do - these are marked FIXME.

Unfortunately, olvwm will not work properly on amd64 when built with
gcc 3.3 using -O2. gcc 3.4 and 4.0 works, as does -O0 and and -O3
with gcc 3.3. Since we're now moving on to gcc 4.0 as the default
compiler, I simply do not find it very interesting to dig for the cause
of the problem. However, I recently found that olvwm segfaults, both
the current version and my 4.0-recompiled version using this patch on
alpha, at least when started via an Xnest server. I lack the resources
to try it on a real X server though. I get a misaligned trap, and that
may very well be what happens on amd64 too with gcc 3.3. I simply don't
have the time and energy to hunt down this one now - and I think it's
more important I get this patch out of the door first.

Some of the external applications that depend on XView have 64-bit
problems of their own - but I'll leave them for now until if or when our
XView maintainer decides he wants to go through with this patch.

Thanks!

-ukh