[Mono-list] Adding Solaris/amd64 support

Andreas Färber andreas.faerber at web.de
Tue Mar 6 03:58:36 EST 2007


Hi Miguel,

Thanks for the quick reply!

>> By default, Solaris' gcc compiles to 32-bit unless overwritten by -
>> m64. I have therefore patched configure.in to infer the x86/amd64
>> architecture from the pointer size (as seen for another platform).
>
> This sounds like a choice that the Solaris gcc people thought  
> should be
> made explicitly.  Maybe we should do the same, and have a special
> configure option that enables the 64 bit binary?

I adapted it from this snippet in configure.in:
	sparc*-*-*)
		if test "x$ac_cv_sizeof_void_p" = "x8"; then
		   TARGET=SPARC64
		else
			TARGET=SPARC
		fi
So that if I pass CFLAGS=-m64 it compiles 64-bit amd64 or otherwise  
32-bit x86.

Of course you/we could change this behavior. My personal opinion on  
this is that I don't like this approach at all - I would favor an  
approach where this is decided at compile time using the defines  
__x86_64__ etc. Would it not be possible to set up a header to do #if  
defined(__x86_64) #define TARGET AMD64 or similar? That would also  
facilitate cross-compiling e.g. Mac OS X universal or Unix to Symbian.

>> ** ERROR **: file mini-amd64.c: line 180 (amd64_patch): assertion
>> failed: (amd64_is_imm32 (disp))
>> aborting...
>> Stacktrace:
>>
>> Abbrechen - Speicherabbild 'core' geschrieben
>
> You could turn the above into a G_BREAKPOINT and with the debugger see
> what it is trying to decode (you cause x/20i address on the address to
> see the disassembled instruction).

Unfortunately I've never needed to debug on Unix except in Xcode but  
if you or someone else walks me through this I'd be happy to provide  
any output. How do I turn it into a G_BREAKPOINT? What tools do I  
need to use? Dtrace? gdb? What parameters, prompts etc.?

Andreas


More information about the Mono-list mailing list