Can't compile Mono on Snow Leopard?

View: New views
4 Messages — Rating Filter:   Alert me  

Can't compile Mono on Snow Leopard?

by Kenny Clement :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm using Mono in combination with Monobjc.
On OS X 10.5 (leopard), everything works, but when I run the app on OS X
10.6 (Snow Leopard), I'm getting a few issues.

So far:

Issue #1:
Running unit tests on Snow Leopard doesn't work, because of bug #533893
https://bugzilla.novell.com/show_bug.cgi?id=533893

Apparently, this bug has been resolved on SVN.

Issue #2:
Mono crashes when doing Garbage Collection. I created bug report #537764
for this:
https://bugzilla.novell.com/show_bug.cgi?id=537764

Still working on reproducing in a sample app or small test code.

Issue #3:
In order to try the fix for issue #1, and also for testing with a
different GC, I tried compiling the SVN version of Mono on SNow Leopard.
Unfortunately, this also fails.
It seems as if Snow Leopard is detected incorrectly. The mach-type, ...
are incorrect, resulting in build errors.
I got around most of these with some manual fixes (adding some
#define's, to circumvent the auto-detection).
However, I am now stuck, in mini-x86.c, it seems it expects an int, and
is receiving a long int.

You can see that in the output at the bottom of this mail.

My question here:
Am I the only one with these issues?
Am I doing something obviously wrong here?

Has anyone else been able to build on snow leopard?

Any ideas?

Thanks for any help you guys can give me!


Kenny Clement


mini-x86.c: In function ‘mono_arch_is_int_overflow’:
mini-x86.c:739: warning: cast to pointer from integer of different size
mini-x86.c: In function ‘mono_arch_instrument_prolog’:
mini-x86.c:1435: warning: cast from pointer to integer of different size
mini-x86.c:1436: warning: cast from pointer to integer of different size
mini-x86.c:1440: warning: cast from pointer to integer of different size
mini-x86.c: In function ‘mono_arch_instrument_epilog_full’:
mini-x86.c:1541: warning: cast from pointer to integer of different size
mini-x86.c:1542: warning: cast from pointer to integer of different size
mini-x86.c:1546: warning: cast from pointer to integer of different size
mini-x86.c: In function ‘mono_arch_output_basic_block’:
mini-x86.c:2127: warning: cast from pointer to integer of different size
mini-x86.c:2182: warning: cast from pointer to integer of different size
mini-x86.c:2182: warning: cast from pointer to integer of different size
mini-x86.c:2182: warning: cast from pointer to integer of different size
mini-x86.c:3044: warning: cast from pointer to integer of different size
mini-x86.c:3065: warning: cast from pointer to integer of different size
mini-x86.c:3176: warning: cast from pointer to integer of different size
mini-x86.c:4325: warning: format ‘%d’ expects type ‘int’, but argument 6
has type ‘long int’
mini-x86.c: In function ‘mono_arch_emit_prolog’:
mini-x86.c:4456: warning: cast from pointer to integer of different size
mini-x86.c:4468: warning: cast from pointer to integer of different size
mini-x86.c: In function ‘mono_arch_emit_epilog’:
mini-x86.c:4694: warning: overflow in implicit constant conversion
mini-x86.c: In function ‘mono_arch_build_imt_thunk’:
mini-x86.c:5073: warning: cast from pointer to integer of different size
mini-x86.c:5073: warning: cast from pointer to integer of different size
mini-x86.c:5073: warning: cast from pointer to integer of different size
mini-x86.c:5073: warning: cast from pointer to integer of different size
mini-x86.c:5073: warning: cast from pointer to integer of different size
mini-x86.c:5079: warning: cast from pointer to integer of different size
mini-x86.c:5082: warning: cast from pointer to integer of different size
mini-x86.c:5082: warning: cast from pointer to integer of different size
mini-x86.c:5082: warning: cast from pointer to integer of different size
mini-x86.c:5082: warning: cast from pointer to integer of different size
mini-x86.c:5082: warning: cast from pointer to integer of different size
mini-x86.c:5088: warning: cast from pointer to integer of different size
mini-x86.c:5102: warning: cast from pointer to integer of different size
mini-x86.c:5111: warning: cast from pointer to integer of different size
mini-x86.c:5111: warning: cast from pointer to integer of different size
mini-x86.c:5111: warning: cast from pointer to integer of different size
mini-x86.c:5111: warning: cast from pointer to integer of different size
mini-x86.c:5111: warning: cast from pointer to integer of different size
mini-x86.c: In function ‘mono_arch_get_this_arg_from_call’:
mini-x86.c:5423: warning: cast to pointer from integer of different size
mini-x86.c: In function ‘mono_arch_context_get_int_reg’:
mini-x86.c:5528: warning: cast to pointer from integer of different size
mini-x86.c:5529: warning: cast to pointer from integer of different size
mini-x86.c:5530: warning: cast to pointer from integer of different size
mini-x86.c:5531: warning: cast to pointer from integer of different size
mini-x86.c:5532: warning: cast to pointer from integer of different size
mini-x86.c:5533: warning: cast to pointer from integer of different size
mini-x86.c:5534: warning: cast to pointer from integer of different size
mini-x86.c:5535: warning: cast to pointer from integer of different size
/var/tmp//ccYEwYMY.s:37605:suffix or operands invalid for `pushf'
/var/tmp//ccYEwYMY.s:37606:suffix or operands invalid for `pop'
/var/tmp//ccYEwYMY.s:37609:suffix or operands invalid for `push'
/var/tmp//ccYEwYMY.s:37610:suffix or operands invalid for `popf'
/var/tmp//ccYEwYMY.s:37611:suffix or operands invalid for `pushf'
/var/tmp//ccYEwYMY.s:37612:suffix or operands invalid for `pop'
make[4]: *** [mini-x86.lo] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
_______________________________________________
Mono-osx mailing list
Mono-osx@...
http://lists.ximian.com/mailman/listinfo/mono-osx

Re: Can't compile Mono on Snow Leopard?

by Alexander Shulgin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Kenny Clement wrote:
> Hi,
>
> I'm using Mono in combination with Monobjc.
> On OS X 10.5 (leopard), everything works, but when I run the app on OS X
> 10.6 (Snow Leopard), I'm getting a few issues.
>
> So far:
>
[snip]
> Issue #2:
> Mono crashes when doing Garbage Collection. I created bug report #537764
> for this:
> https://bugzilla.novell.com/show_bug.cgi?id=537764
>
> Still working on reproducing in a sample app or small test code.

I have similar problem with 10.6.  Could not narrow down.  Added
commented to the bug report.

--
Regards,
Alex
_______________________________________________
Mono-osx mailing list
Mono-osx@...
http://lists.ximian.com/mailman/listinfo/mono-osx

Re: Can't compile Mono on Snow Leopard?

by Tom Philpot :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I posted this to the mono-devel list a few days ago and got a reply from
Geoff Norton.
------ Original Messages ------

I have some experimental patches for amd64-darwin-mono, but not ready
yet.  For now you should set the CFLAGS="-m32"

-g

On 8-Sep-09, at 8:14 PM, Tom Philpot wrote:

> The primary reason seems to be that the default version of gcc on Snow
> Leopard, 4.2.1,  no longer defines __i386__. gcc 4.2.1 defines
> __x86_64__.
>
> I started down the path of modifying some of the #defines to correctly
> target DARWIN and use __x86_64__, but I ran into trouble building
> aot-runtime.c because mini.h wanted to use the -x86 sources not the
> amd64
> sources.
>
> Has anyone else tried to build Mono from SVN on Snow Leopard?
>
> Thanks,
> Tom
>
>
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list@...
> http://lists.ximian.com/mailman/listinfo/mono-devel-list


On 9/11/09 8:08 AM, "Alex Shulgin" <alexander.shulgin@...>
wrote:

> Kenny Clement wrote:
>> Hi,
>>
>> I'm using Mono in combination with Monobjc.
>> On OS X 10.5 (leopard), everything works, but when I run the app on OS X
>> 10.6 (Snow Leopard), I'm getting a few issues.
>>
>> So far:
>>
> [snip]
>> Issue #2:
>> Mono crashes when doing Garbage Collection. I created bug report #537764
>> for this:
>> https://bugzilla.novell.com/show_bug.cgi?id=537764
>>
>> Still working on reproducing in a sample app or small test code.
>
> I have similar problem with 10.6.  Could not narrow down.  Added
> commented to the bug report.
>
> --
> Regards,
> Alex
> _______________________________________________
> Mono-osx mailing list
> Mono-osx@...
> http://lists.ximian.com/mailman/listinfo/mono-osx

_______________________________________________
Mono-osx mailing list
Mono-osx@...
http://lists.ximian.com/mailman/listinfo/mono-osx

Re: Can't compile Mono on Snow Leopard?

by Jason Foreman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Kenny,

On Sep 11, 2009, at 9:51 AM, Kenny Clement wrote:

> Hi,
>
> I'm using Mono in combination with Monobjc.

I'm currently evaluating this exact combination for use as well.

> On OS X 10.5 (leopard), everything works, but when I run the app on  
> OS X
> 10.6 (Snow Leopard), I'm getting a few issues.

I'm also noticing some issues on Snow Leopard...

>
> So far:
>
> Issue #1:
> Running unit tests on Snow Leopard doesn't work, because of bug  
> #533893
> https://bugzilla.novell.com/show_bug.cgi?id=533893
>
> Apparently, this bug has been resolved on SVN.

I'm not sure this really is fixed, or else there are other bugs in the  
same low-level code.  I've been able to build mono (see below) and can  
still force a crash by running:

        Console.WriteLine("{0}", Process.GetCurrentProcess());


> Issue #2:
> Mono crashes when doing Garbage Collection. I created bug report  
> #537764
> for this:
> https://bugzilla.novell.com/show_bug.cgi?id=537764
>
> Still working on reproducing in a sample app or small test code.
>
> Issue #3:
> In order to try the fix for issue #1, and also for testing with a
> different GC, I tried compiling the SVN version of Mono on SNow  
> Leopard.
> Unfortunately, this also fails.
> It seems as if Snow Leopard is detected incorrectly. The mach-
> type, ...
> are incorrect, resulting in build errors.
> I got around most of these with some manual fixes (adding some
> #define's, to circumvent the auto-detection).
> However, I am now stuck, in mini-x86.c, it seems it expects an int,  
> and
> is receiving a long int.
>
> You can see that in the output at the bottom of this mail.
>
> My question here:
> Am I the only one with these issues?
> Am I doing something obviously wrong here?
>
> Has anyone else been able to build on snow leopard?
>
> Any ideas?

I was able to build on Snow Leopard.  I followed most of the  
instructions here:

        http://mono-project.com/Compiling_Mono_on_OSX

to build the dependencies, then here:

        http://mono-project.com/Compiling_Mono_From_SVN

to build from an svn checkout.

The main thing I did change was to first add a few lines to the script  
which sets up my mono dev environment (do this before building any of  
the dependencies):

CFLAGS="-arch i386 -D_XOPEN_SOURCE"
LDFLAGS="-arch i386"
CXXFLAGS=$CFLAGS

Things were definitely not happy when trying to build for x86_64, but  
I was more interested in getting something built that I could test  
than in debugging the build on that architecture.

So now I have a mono build that I can use to track down some of these  
various issues.  I wonder if anyone has any tips on debugging mono on  
Mac OS X?  I ended up using gdb from the command line to do a few  
simple tests, but I'll probably try to at least set things up to debug  
with Xcode.

FWIW, the I tracked the first issue mentioned (or my variant of said  
issue) down to a null pointer dereference in mono/io-layer/processes.c  
in the load_modules call.  The call to getsectbynamefromheader is  
return null, and no check is done so a later call crashes.  I haven't  
yet figured out why it returns null under Snow Leopard as I'm not too  
familiar with those APIs.  I'm also brand new to mono development so  
I'm still trying to figure out what the heck I'm doing.

I'm willing to help fix some of these 10.6 issues as long as someone  
can help point me in the right direction when I get lost.


Jason




_______________________________________________
Mono-osx mailing list
Mono-osx@...
http://lists.ximian.com/mailman/listinfo/mono-osx

smime.p7s (3K) Download Attachment