building VNC for Itanium

Jeff Boerio boerio "at" ichips.intel.com
Thu, 23 Aug 2001 00:52:28 +0000


I'm trying to build VNC for the Itanium (Linux/64) platform.  I doubt there
are too many Itanium machines floating around out there, so I'm probably in
unchartered waters.  But people with 64-bit experience may be able to offer
me some help here.

I wound up downloading the XFree86 4.x sources today and compared how they
got it to build versus what already exists with the Tridia VNC 1.4 code
I've been working with.

The binaries I generate run .... until you try to run an X application in
them :)  The program crashes out in the Xalloc() routine (I'm using
-DINTERNAL_MALLOC because otherwise things crash a lot faster).  If anyone 
has any experience with this, I'd love to hear from you, because it's a little
over my head I think.

I also have some concerns with some of the warnings I get.  The most
alarming ones come from things like this:

gcc -c -g -O2 -ansi -pedantic  -I../../../include/fonts -I../include  -I../../.. -I../../../exports/include  -Dlinux -D__ia64__ -DINTERNAL_MALLOC -DXALLOC_DEBUG -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE -D_REENTRANT -DSHAPE          -DGCCUSESGAS -DSTATIC_COLOR -DAVOID_GLYPHBLT -DPIXPRIV   -D_XSERVER64 -DNDEBUG   -DFUNCPROTO=15 -DNARROWPROTO   -I../../../lib/xtrans -DUNIXCONN -DTCPCONN -DFONT_t -DTRANS_CLIENT -DTRANS_SERVER -DTRANS_REOPEN  transport.c
In file included from transport.c:80:
../../../lib/xtrans/Xtranssock.c: In function `_FontTransSocketINETGetAddr':
../../../lib/xtrans/Xtranssock.c:306: warning: pointer targets in passing arg 3 of `getsockname' differ in signedness
../../../lib/xtrans/Xtranssock.c: In function `_FontTransSocketINETGetPeerAddr':
../../../lib/xtrans/Xtranssock.c:353: warning: pointer targets in passing arg 3 of `getpeername' differ in signedness
../../../lib/xtrans/Xtranssock.c: In function `_FontTransSocketINETAccept':
../../../lib/xtrans/Xtranssock.c:1094: warning: pointer targets in passing arg 3 of `accept' differ in signedness
../../../lib/xtrans/Xtranssock.c: In function `_FontTransSocketUNIXAccept':
../../../lib/xtrans/Xtranssock.c:1177: warning: pointer targets in passing arg 3 of `accept' differ in signedness

I'm not much of a socket guy at all, and I don't know what the implications of 
these warnings are.

If anyone has any suggestions, especially people who have 64-bit knowledge on
other platforms, I'd really like to hear from you.

diffs of all the mods I've made so far are below.

Thanks,

     - Jeff

(all commands are "diff my_mods original_file")

./Xvnc/config/cf/Imake.cf
547,556d546
< # ifdef ia64
< #  define ia64Architecture
< #  undef ia64
< # endif
< # ifdef __ia64__
< #  ifndef ia64Architecture
< #   define ia64Architecture
< #  endif
< #  undef __ia64__
< # endif /* ia64 */

This is subtly different than my original mod, and figured it couldn't hurt
anything, and is indeed a cleaner set of definitions.

./Xvnc/config/cf/linux.cf
158d157
<
160,176c159,167
< # if UseElfFormat
< #  ifdef ia64Architecture
< #   define CcCmd                      gcc
< #   define CplusplusCmd               g++
< #   define AsCmd                      as
< #   define LdCmd                      ld
< #   define AsmDefines         -D__ELF__
< #  else
< #   define CcCmd                      gcc
< #   define AsCmd                      as
< #   define LdCmd                      ld
< #   define AsmDefines         -D__ELF__
< #   define CplusplusCmd               c++
< # endif
< # if UseStaticTermcapLib
< #  define TermcapLibrary	StaticLibrary(/usr/lib/termcap,termcap)
< # endif
< # endif
---
> #if UseElfFormat
> #define CcCmd                 gcc
> #define AsCmd                 as
> #define LdCmd                 ld
> #define AsmDefines            -D__ELF__
> #define CplusplusCmd          c++
> #if UseStaticTermcapLib
> #define TermcapLibrary	StaticLibrary(/usr/lib/termcap,termcap)
> #endif
185,191d175
< #ifdef ia64Architecture
< #define CcCmd                 gcc
< #define CplusplusCmd          g++
< #define AsCmd                 /usr/bin/as
< #define LdCmd                 /usr/bin/ld
< #define AsmDefines            -DUSE_GAS -U__ELF__
< #endif /* ia64Architecture */
256,262d239
<
< #ifdef ia64Architecture
< #define OptimizedCDebugFlags  -g -O2
< #define OptimizedCDebugFlags  -g -O2
< #define LinuxMachineDefines   -D__ia64__ -DINTERNAL_MALLOC -DXALLOC_DEBUG
< #define ServerOSDefines               XFree86ServerOSDefines -DDDXTIME -DPART_NET
< #define ServerExtraDefines    -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
< #endif /* ia64Architecture */

There are some interesting differences here.  I cannot get anything to
function without using the -DINTERNAL_MALLOC, so that stays.  I believe the
problems I'm having are in Xalloc(), but I haven't been able to prove it,
hence the -DXALLOC_DEBUG definition.

The one thing the XFree86 4.x version did define was -D_XSERVER64, which
they say is for systems where an unsigned long is not 32 bits.

./Xvnc/include/Xmd.h
62c62
< #if defined(__alpha) || defined(__alpha__) || defined(__ia64__) || defined(ia64)
---
> #if defined(__alpha) || defined(__alpha__)

And this is where we define an unsigned long as 64 bits.

The most changes I've made so far are to xalloc.c, since I have
-DINTERNAL_MALLOC defined.

./Xvnc/programs/Xserver/os/xalloc.c
189,190c189
< #if defined(__alpha__) || defined(__alpha) || \
<     defined(__ia64__) || defined(ia64)
---
> #ifdef __alpha__
193d191
< #define MAGIC_FREE            0x1506196615061966
197d194
< #define MAGIC_FREE            0x25182079
212,213c209
< /* #if defined(linux) && defined(i386) */
< #if defined(ia64) || defined(__ia64__) || defined(i386)
---
> #if defined(linux) && defined(i386)
316,321c312
< #if defined(__alpha__) || defined(__alpha) || \
<     defined(__sparc__) || \
<     defined(__mips__) || \
<     defined(__powerpc__) || \
<     defined(__arm32__) || \
<     defined(__ia64__) || defined(ia64)
<     defined(__arm32__) || \
<     defined(__ia64__) || defined(ia64)
---
> #if defined(__alpha__) || defined(__sparc__) || defined(__mips__)

The MAGIC_FREE stuff doesn't do anything; it was in the XFree86 4.x code,
so I threw it in here, but nowhere else is there a call for this.  So it's
gonna go.

-- 
Jeff Boerio, DPG-OR Engineering Computing, boerio "at" ichips.intel.com
Mgr, UNIX Software Applications & Support
---------------------------------------------------------------------
To unsubscribe, send a message with the line: unsubscribe vnc-list
to majordomo "at" uk.research.att.com
See also: http://www.uk.research.att.com/vnc/intouch.html
---------------------------------------------------------------------