Subject: pkg/35585: emulators/vba doesn't compile for non-32 bit architectures
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <martijnb@atlas.localdomain>
List: pkgsrc-bugs
Date: 02/11/2007 20:10:01
>Number:         35585
>Category:       pkg
>Synopsis:       emulators/vba doesn't compile for non-32 bit architectures
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 11 20:10:00 +0000 2007
>Originator:     Martijn van Buul
>Release:        NetBSD 4.99.10
>Organization:
	
>Environment:
	
	
System: NetBSD atlas 4.99.10 NetBSD 4.99.10 (ATLAS) #4: Sun Feb 11 14:31:39 CET 2007 root@atlas:/usr/src/sys/arch/amd64/compile/ATLAS amd64
Architecture: x86_64
Machine: amd64
>Description:
	emulators/vba doesn't compile on non-32 bit architectures; it assumes
	that pointers can be safely casted back- and forth with uint32's on
	a few locations. I hope I got all of them; at least it compiles
	now, and as far as I can see things do work.

	Please note that all of these instances were in the debugger/profiler
	section of the emulator, which I cannot test, lacking the proper 
	knowledge (and tools)
>How-To-Repeat:
	Try to build emulators/vba on an amd64
>Fix:
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/emulators/vba/distinfo,v
retrieving revision 1.3
diff -r1.3 distinfo
8a9,11
> SHA1 (patch-ad) = b61c4053bbed582db5df2039c20b436e1d9e1ff1
> SHA1 (patch-ae) = b7e08365abd77b5c0f3473b4ce091b747298dfc8
> SHA1 (patch-af) = 0b194e624acb083942bd8f9f1a56c34bdd97d9e4
Index: patches/patch-ad
===================================================================
RCS file: patches/patch-ad
diff -N patches/patch-ad
0a1,13
> $NetBSD$
> 
> --- src/prof/gmon.h.orig	2002-11-20 14:29:08.000000000 +0100
> +++ src/prof/gmon.h
> @@ -119,7 +119,7 @@
>  
>  struct tostruct
>    {
> -    char *selfpc;
> +    uint32_t selfpc;
>      int count;
>      unsigned short link;
>    };
Index: patches/patch-ae
===================================================================
RCS file: patches/patch-ae
diff -N patches/patch-ae
0a1,22
> $NetBSD$
> 
> --- src/prof/prof.cpp.orig	2004-05-13 16:31:58.000000000 +0200
> +++ src/prof/prof.cpp
> @@ -279,7 +279,7 @@ void profCleanup()
>  
>  void profCount()
>  {
> -  register char *selfpc;
> +  register u32 selfpc;
>    register unsigned short *frompcindex;
>    register struct tostruct *top;
>    register struct tostruct *prevtop;
> @@ -292,7 +292,7 @@ void profCount()
>    
>    /* selfpc = pc pushed by mcount call.
>       This identifies the function that was just entered.  */
> -  selfpc = (char *) reg[14].I;
> +  selfpc = (u32) reg[14].I;
>    /* frompcindex = pc in preceding frame.
>       This identifies the caller of the function just entered.  */
>    frompcindex = (unsigned short *) reg[12].I;
Index: patches/patch-af
===================================================================
RCS file: patches/patch-af
diff -N patches/patch-af
0a1,16
> $NetBSD$
> 
> --- src/sdl/debugger.cpp.orig	2004-05-13 16:13:14.000000000 +0200
> +++ src/sdl/debugger.cpp
> @@ -950,9 +950,9 @@ void debuggerBreakOnWrite(u32 *mem, u32 
>  {
>    u32 address = 0;
>    if(mem >= (u32*)&workRAM[0] && mem <= (u32*)&workRAM[0x3ffff])
> -    address = 0x2000000 + ((u32)mem - (u32)&workRAM[0]);
> +    address = 0x2000000 + (u32)((u8 *)mem - &workRAM[0]);
>    else
> -    address = 0x3000000 + ((u32)mem - (u32)&internalRAM[0]);
> +    address = 0x3000000 + (u32)((u8 *)mem - &internalRAM[0]);
>  
>    if(size == 2)
>      printf("Breakpoint (on write) address %08x old:%08x new:%08x\n", 

>Unformatted: