Bug 7503 - when building mono 2.11.4 from source on Mac OS X Snow Leopard using gcc 4.2.1 compilation fails.
Summary: when building mono 2.11.4 from source on Mac OS X Snow Leopard using gcc 4.2....
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 2.10.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-09-27 09:45 UTC by Mirek Rusin
Modified: 2013-01-09 15:32 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Mirek Rusin 2012-09-27 09:45:06 UTC
My system is:

$ uname -a
Darwin newlaptop.livedrive.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64

My gcc is:

$ gcc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~3/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~3/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

When compiling the most recent version of mono:

$ wget http://download.mono-project.com/sources/mono/mono-2.11.4.tar.bz2
$ tar xvjf mono-2.11.4.tar.bz2
$ cd mono-2.11.4
$ ./configure --prefix=/usr/local/mono-2.11.4 --with-glib=embedded --disable-dtrace --with-mcs-docs=no --enable-nls=no --host=i386-apple-darwin10
$ make

After several minutes I've got the following error:

make all-local
MCS     [net_4_0] CustomMarshalers.dll

Unhandled Exception:
System.RankException: Arrays must be of same size.
  at System.Array.Copy (System.Array sourceArray, Int32 sourceIndex, System.Array destinationArray, Int32 destinationIndex, Int32 length) [0x00000] in <filename unknown>:0 
  at System.Array.CopyTo (System.Array array, Int32 index) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AssemblyReferencesLoader`1[IKVM.Reflection.Assembly].LoadReferencesCore (Mono.CSharp.ModuleContainer module, IKVM.Reflection.Assembly& corlib_assembly, System.Collections.Generic.List`1& loaded) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.StaticLoader.LoadReferences (Mono.CSharp.ModuleContainer module) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.RankException: Arrays must be of same size.
  at System.Array.Copy (System.Array sourceArray, Int32 sourceIndex, System.Array destinationArray, Int32 destinationIndex, Int32 length) [0x00000] in <filename unknown>:0 
  at System.Array.CopyTo (System.Array array, Int32 index) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AssemblyReferencesLoader`1[IKVM.Reflection.Assembly].LoadReferencesCore (Mono.CSharp.ModuleContainer module, IKVM.Reflection.Assembly& corlib_assembly, System.Collections.Generic.List`1& loaded) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.StaticLoader.LoadReferences (Mono.CSharp.ModuleContainer module) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 
make[8]: *** [../../class/lib/net_4_0/CustomMarshalers.dll] Error 1
make[7]: *** [do-all] Error 2
make[6]: *** [all-recursive] Error 1
make[5]: *** [all-recursive] Error 1
make[4]: *** [profile-do--net_4_0--all] Error 2
make[3]: *** [profiles-do--all] Error 2
make[2]: *** [all-local] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Comment 1 Mirek Rusin 2012-09-27 10:15:50 UTC
I've made a mistake, above fails for 64 bit build only, it does build fine for 32 bits:

./configure --prefix=/usr/local/mono-2.11.4 --with-glib=embedded
--disable-dtrace --with-mcs-docs=no --enable-nls=no --host=i386-apple-darwin10

above works fine.

./configure --prefix=/usr/local/mono-2.11.4 --with-glib=embedded
--disable-dtrace --with-mcs-docs=no --enable-nls=no --host=x86_64-apple-darwin10

above fails on Mac OS X 10.6.x Snow Leopard and builds successfully on Mac OS X 10.7.x Lion.
Comment 2 Rodrigo Kumpera 2013-01-09 15:32:26 UTC
mono 64 bits now works on osx.