Opened 15 years ago

Closed 14 years ago

#20894 closed defect (fixed)

Mono fails to build on Snow Leopard x86_64

Reported by: matt@… Owned by: mww@…
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: snowleopard Cc: jean-philippe.humbert@…, macports@…, bgrupe27, dcestari@…, hvitved@…, adrian@…, d.czerwonk@…, ac90b671@…, rgabo@…, nerdling (Jeremy Lavergne), celil.rufat@…, macports@…, drkp (Dan Ports), kibiz0r@…, rob@…, deesto (John S. De Stefano Jr.), matt@…, domiman@…, andreas@…, p_ansell@…, reid@…, motya@…, sgaragagghu@…, s.bonczkowski@…, leafyoung@…, ryandesign (Ryan Carsten Schmidt)
Port: mono

Description

Before Snow Leopard I was running Leopard and MacPorts 1.7.1 on my Mac, and just built mono and boo a few nights ago. When I upgraded to Snow Leopard I removed MacPorts and did a fresh install. Mono, however, failed to build.

Output from "sudo port install mono"

--->  Building mono
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.2.3" && /usr/bin/make -j2 all " returned error 2
Command output: /usr/bin/make  all-recursive
Making all in po
Making all in mcs
make[3]: Nothing to be done for `all-am'.
Making all in libgc
Making all in include
Making all in private
make[4]: Nothing to be done for `all'.
make[4]: Nothing to be done for `all-am'.
Making all in doc
make[3]: Nothing to be done for `all'.
/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.2 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.2.3/libgc/include -DPACKAGE_NAME=\"libgc-mono\" -DPACKAGE_TARNAME=\"libgc-mono\" -DPACKAGE_VERSION=\"6.6\" -DPACKAGE_STRING=\"libgc-mono\ 6.6\" -DPACKAGE_BUGREPORT=\"Hans_Boehm@hp.com\" -DGC_DARWIN_THREADS=1 -DTHREAD_LOCAL_ALLOC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DSILENT=1 -DNO_SIGNALS=1 -DNO_EXECUTE_PERMISSION=1 -DJAVA_FINALIZATION=1 -DGC_GCJ_SUPPORT=1 -DATOMIC_UNCOLLECTABLE=1 -D_IN_LIBGC=1 -I./.. -I./.. -I./include  -I/opt/local/include -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP -DGetCurrentProcess=MonoGetCurrentProcess -DGetCurrentThread=MonoGetCurrentThread -DCreateEvent=MonoCreateEvent   -O2 -arch x86_64 -g   -MT allchblk.lo -MD -MP -MF .deps/allchblk.Tpo -c -o allchblk.lo allchblk.c
/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.2 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.2.3/libgc/include -DPACKAGE_NAME=\"libgc-mono\" -DPACKAGE_TARNAME=\"libgc-mono\" -DPACKAGE_VERSION=\"6.6\" -DPACKAGE_STRING=\"libgc-mono\ 6.6\" -DPACKAGE_BUGREPORT=\"Hans_Boehm@hp.com\" -DGC_DARWIN_THREADS=1 -DTHREAD_LOCAL_ALLOC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DSILENT=1 -DNO_SIGNALS=1 -DNO_EXECUTE_PERMISSION=1 -DJAVA_FINALIZATION=1 -DGC_GCJ_SUPPORT=1 -DATOMIC_UNCOLLECTABLE=1 -D_IN_LIBGC=1 -I./.. -I./.. -I./include  -I/opt/local/include -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP -DGetCurrentProcess=MonoGetCurrentProcess -DGetCurrentThread=MonoGetCurrentThread -DCreateEvent=MonoCreateEvent   -O2 -arch x86_64 -g   -MT alloc.lo -MD -MP -MF .deps/alloc.Tpo -c -o alloc.lo alloc.c
 /usr/bin/gcc-4.2 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.2.3/libgc/include -DPACKAGE_NAME=\"libgc-mono\" -DPACKAGE_TARNAME=\"libgc-mono\" -DPACKAGE_VERSION=\"6.6\" "-DPACKAGE_STRING=\"libgc-mono 6.6\"" -DPACKAGE_BUGREPORT=\"Hans_Boehm@hp.com\" -DGC_DARWIN_THREADS=1 -DTHREAD_LOCAL_ALLOC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DSILENT=1 -DNO_SIGNALS=1 -DNO_EXECUTE_PERMISSION=1 -DJAVA_FINALIZATION=1 -DGC_GCJ_SUPPORT=1 -DATOMIC_UNCOLLECTABLE=1 -D_IN_LIBGC=1 -I./.. -I./.. -I./include -I/opt/local/include -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP -DGetCurrentProcess=MonoGetCurrentProcess -DGetCurrentThread=MonoGetCurrentThread -DCreateEvent=MonoCreateEvent -O2 -arch x86_64 -g -MT alloc.lo -MD -MP -MF .deps/alloc.Tpo -c alloc.c  -fno-common -DPIC -o .libs/alloc.o
 /usr/bin/gcc-4.2 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.2.3/libgc/include -DPACKAGE_NAME=\"libgc-mono\" -DPACKAGE_TARNAME=\"libgc-mono\" -DPACKAGE_VERSION=\"6.6\" "-DPACKAGE_STRING=\"libgc-mono 6.6\"" -DPACKAGE_BUGREPORT=\"Hans_Boehm@hp.com\" -DGC_DARWIN_THREADS=1 -DTHREAD_LOCAL_ALLOC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DSILENT=1 -DNO_SIGNALS=1 -DNO_EXECUTE_PERMISSION=1 -DJAVA_FINALIZATION=1 -DGC_GCJ_SUPPORT=1 -DATOMIC_UNCOLLECTABLE=1 -D_IN_LIBGC=1 -I./.. -I./.. -I./include -I/opt/local/include -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP -DGetCurrentProcess=MonoGetCurrentProcess -DGetCurrentThread=MonoGetCurrentThread -DCreateEvent=MonoCreateEvent -O2 -arch x86_64 -g -MT allchblk.lo -MD -MP -MF .deps/allchblk.Tpo -c allchblk.c  -fno-common -DPIC -o .libs/allchblk.o
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.2.3/libgc/include/private/gc_priv.h:66,
                 from allchblk.c:19:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.2.3/libgc/include/private/gcconfig.h:499: error: expected identifier or '(' before '--' token
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.2.3/libgc/include/private/gc_priv.h:66,
                 from alloc.c:19:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.2.3/libgc/include/private/gcconfig.h:499: error: expected identifier or '(' before '--' token
make[3]: *** [allchblk.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [alloc.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Error: The following dependencies failed to build: mono nant
Error: Status 1 encountered during processing.

Attachments (4)

mono-Portfile.patch (847 bytes) - added by drkp (Dan Ports) 14 years ago.
port-mono.log (6.2 KB) - added by deesto (John S. De Stefano Jr.) 14 years ago.
Portfile (2.8 KB) - added by rob@… 14 years ago.
Portfile for mono build on Snow Leopard with x86_64 patch
mono-port-log.txt.bz2 (33.9 KB) - added by deesto (John S. De Stefano Jr.) 14 years ago.
deesto's newest install log

Download all attachments as: .zip

Change History (58)

comment:1 Changed 15 years ago by mf2k (Frank Schima)

Keywords: snowleopard added; mono snow leopard removed
Owner: changed from macports-tickets@… to mww@…

comment:2 Changed 15 years ago by jean-philippe.humbert@…

Cc: jean-philippe.humbert@… added

Cc Me!

comment:3 Changed 15 years ago by jean-philippe.humbert@…

I have the same problem with the same output.

comment:4 Changed 15 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:5 Changed 15 years ago by mighty_ernie@…

Seems like the problem's upstream? The only platform's that Mono's GC supports under Darwin are ppc, ppc64, i386, and arm. I reckon x86_64 needs to be added.

comment:6 Changed 15 years ago by mighty_ernie@…

The latest Mono supports x86_64 on Darwin. The port just needs to be upgraded.

comment:7 in reply to:  6 ; Changed 15 years ago by mighty_ernie@…

Replying to mighty_ernie@…:

The latest Mono supports x86_64 on Darwin. The port just needs to be upgraded.

Oh, I lied. The latest mono does not support x86_64 fully. Someone is working on it, but suggests configuring for 32bit for the time being:

http://go-mono.com/forums/#nabble-p25356442

comment:8 Changed 15 years ago by bgrupe27

Cc: bgrupe@… added

Cc Me!

comment:9 Changed 15 years ago by dcestari@…

Cc: dcestari@… added

Cc Me!

comment:10 Changed 15 years ago by hvitved@…

Cc: hvitved@… added

Cc Me!

comment:11 Changed 15 years ago by adrian@…

Cc: adrian@… added

Cc Me!

comment:12 Changed 15 years ago by d.czerwonk@…

Cc: d.czerwonk@… added

Cc Me!

comment:13 Changed 14 years ago by ac90b671@…

Cc Me!

comment:14 Changed 14 years ago by ac90b671@…

Cc: ac90b671@… added

Cc Me!

comment:15 in reply to:  7 ; Changed 14 years ago by rgabo@…

Replying to mighty_ernie@…:

Replying to mighty_ernie@…:

The latest Mono supports x86_64 on Darwin. The port just needs to be upgraded.

Oh, I lied. The latest mono does not support x86_64 fully. Someone is working on it, but suggests configuring for 32bit for the time being:

http://go-mono.com/forums/#nabble-p25356442

Building using the command 'sudo port install mono build_arch=i386' gets me further, but I still get the following error:

Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.2.3" && /usr/bin/make -j2 all " returned error 2
Command output:       _setup_interface_offsets in libmonoruntime.a(class.o)
      _setup_interface_offsets in libmonoruntime.a(class.o)
      _setup_interface_offsets in libmonoruntime.a(class.o)
      _mono_method_add_generic_virtual_invocation in libmonoruntime.a(object.o)
      _build_imt_slots in libmonoruntime.a(object.o)
      _mono_class_proxy_vtable in libmonoruntime.a(object.o)
      _mono_reflection_free_type_info in libmonoruntime.a(reflection.o)
      _mono_dynamic_image_free in libmonoruntime.a(reflection.o)
      _mono_image_build_metadata in libmonoruntime.a(reflection.o)
      __wapi_thread_set_termination_details in libwapi.a(threads.o)
      __wapi_thread_set_termination_details in libwapi.a(threads.o)
      _cominterop_can_support_dispatch in libmonoruntime.a(marshal.o)
      _cominterop_can_support_dispatch in libmonoruntime.a(marshal.o)
      _cominterop_get_method_interface in libmonoruntime.a(marshal.o)
      _cominterop_ccw_queryinterface in libmonoruntime.a(marshal.o)
      _cominterop_ccw_queryinterface in libmonoruntime.a(marshal.o)
      _ves_icall_System_AppDomain_GetAssemblies in libmonoruntime.a(appdomain.o)
      _ves_icall_Type_GetInterfaces in libmonoruntime.a(icall.o)
      _ves_icall_Type_GetInterfaces in libmonoruntime.a(icall.o)
      _finalizer_thread in libmonoruntime.a(gc.o)
      _ves_icall_System_IO_MonoIO_GetFileSystemEntries in libmonoruntime.a(file-io.o)
      _ves_icall_System_Diagnostics_Process_GetModules_internal in libmonoruntime.a(process.o)
      __wapi_io_scandir in libwapi.a(io-portability.o)
      __wapi_io_scandir in libwapi.a(io-portability.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [pedump] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Error: Status 1 encountered during processing.

comment:16 Changed 14 years ago by rgabo@…

Cc: rgabo@… added

Cc Me!

comment:17 Changed 14 years ago by nerdling (Jeremy Lavergne)

Cc: snc@… added

Cc Me!

comment:18 Changed 14 years ago by celil.rufat@…

Cc: celil.rufat@… added

Cc Me!

comment:19 in reply to:  15 ; Changed 14 years ago by mighty_ernie@…

Replying to rgabo@…:

Replying to mighty_ernie@…:

Replying to mighty_ernie@…:

The latest Mono supports x86_64 on Darwin. The port just needs to be upgraded.

Oh, I lied. The latest mono does not support x86_64 fully. Someone is working on it, but suggests configuring for 32bit for the time being:

http://go-mono.com/forums/#nabble-p25356442

Building using the command 'sudo port install mono build_arch=i386' gets me further, but I still get the following error:

Apparently using the following flags had worked successfully. I'm not enough of a macports guru to know how to do this, though :S

-m32 -Dmacosx -D_XOPEN_SOURCE

comment:20 Changed 14 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:21 in reply to:  19 ; Changed 14 years ago by steals.mail@…

Replying to mighty_ernie@…:

Replying to rgabo@…:

Replying to mighty_ernie@…:

Replying to mighty_ernie@…:

The latest Mono supports x86_64 on Darwin. The port just needs to be upgraded.

Oh, I lied. The latest mono does not support x86_64 fully. Someone is working on it, but suggests configuring for 32bit for the time being:

http://go-mono.com/forums/#nabble-p25356442

Building using the command 'sudo port install mono build_arch=i386' gets me further, but I still get the following error:

Apparently using the following flags had worked successfully. I'm not enough of a macports guru to know how to do this, though :S

-m32 -Dmacosx -D_XOPEN_SOURCE

add line ' configure.cflags-append "-m32 -Dmacosx -D_XOPEN_SOURCE" ' before the lines configure.args.... and install port with command 'sudo port install mono build_arch=i386'

comment:22 in reply to:  21 Changed 14 years ago by shrift@…

Replying to steals.mail@…:

Replying to mighty_ernie@…:

Replying to rgabo@…:

Replying to mighty_ernie@…:

Replying to mighty_ernie@…:

The latest Mono supports x86_64 on Darwin. The port just needs to be upgraded.

Oh, I lied. The latest mono does not support x86_64 fully. Someone is working on it, but suggests configuring for 32bit for the time being:

http://go-mono.com/forums/#nabble-p25356442

Building using the command 'sudo port install mono build_arch=i386' gets me further, but I still get the following error:

Apparently using the following flags had worked successfully. I'm not enough of a macports guru to know how to do this, though :S

-m32 -Dmacosx -D_XOPEN_SOURCE

add line ' configure.cflags-append "-m32 -Dmacosx -D_XOPEN_SOURCE" ' before the lines configure.args.... and install port with command 'sudo port install mono build_arch=i386'

Where should we add that line? I can't find a "configure.args" anywhere.

comment:23 Changed 14 years ago by drkp (Dan Ports)

Cc: dports@… added

Cc Me!

comment:24 Changed 14 years ago by kibiz0r@…

Cc: kibiz0r@… added

Cc Me!

comment:25 Changed 14 years ago by drkp (Dan Ports)

Here is the portfile patch I used, following the suggestions above. It builds and installs successfully for me.

Unfortunately I am not (knowingly) a Mono user so I haven't verified it works -- if someone can point me towards a test program or a port that uses Mono, I'll give it a try.

Changed 14 years ago by drkp (Dan Ports)

Attachment: mono-Portfile.patch added

comment:26 Changed 14 years ago by kibiz0r@…

After that patch, I get the same output as rgabo.

--->  Computing dependencies for mono
--->  Fetching mono
--->  Verifying checksum(s) for mono
--->  Extracting mono
--->  Applying patches to mono
--->  Configuring mono
--->  Building mono
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.2.3" && /usr/bin/make -j2 all " returned error 2
Command output:       _setup_interface_offsets in libmonoruntime.a(class.o)
      _setup_interface_offsets in libmonoruntime.a(class.o)
      _setup_interface_offsets in libmonoruntime.a(class.o)
      _mono_method_add_generic_virtual_invocation in libmonoruntime.a(object.o)
      _build_imt_slots in libmonoruntime.a(object.o)
      _mono_class_proxy_vtable in libmonoruntime.a(object.o)
      _mono_reflection_free_type_info in libmonoruntime.a(reflection.o)
      _mono_dynamic_image_free in libmonoruntime.a(reflection.o)
      _mono_image_build_metadata in libmonoruntime.a(reflection.o)
      __wapi_thread_set_termination_details in libwapi.a(threads.o)
      __wapi_thread_set_termination_details in libwapi.a(threads.o)
      _cominterop_can_support_dispatch in libmonoruntime.a(marshal.o)
      _cominterop_can_support_dispatch in libmonoruntime.a(marshal.o)
      _cominterop_get_method_interface in libmonoruntime.a(marshal.o)
      _cominterop_ccw_queryinterface in libmonoruntime.a(marshal.o)
      _cominterop_ccw_queryinterface in libmonoruntime.a(marshal.o)
      _ves_icall_System_AppDomain_GetAssemblies in libmonoruntime.a(appdomain.o)
      _ves_icall_Type_GetInterfaces in libmonoruntime.a(icall.o)
      _ves_icall_Type_GetInterfaces in libmonoruntime.a(icall.o)
      _finalizer_thread in libmonoruntime.a(gc.o)
      _ves_icall_System_IO_MonoIO_GetFileSystemEntries in libmonoruntime.a(file-io.o)
      _ves_icall_System_Diagnostics_Process_GetModules_internal in libmonoruntime.a(process.o)
      __wapi_io_scandir in libwapi.a(io-portability.o)
      __wapi_io_scandir in libwapi.a(io-portability.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [pedump] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Error: Status 1 encountered during processing.

comment:27 Changed 14 years ago by rob@…

Cc: rob@… added

Cc Me!

comment:28 Changed 14 years ago by drkp (Dan Ports)

The patch I provided makes a 32-bit build work for me (previously, that didn't work either).

I am unfortunately unable to test 64-bit compilation, for a rather embarrassing reason: after screwing around for a while trying to figure out why 64-bit binaries never worked for me, I discovered that, to my surprise, my laptop has a 32-bit CPU. Oops. Fail.

comment:29 in reply to:  28 ; Changed 14 years ago by ps@…

I'm sorry but your patch doesn't work. I get the following linker errors. Could you care to explain how you got your patch to work ?

--->  Computing dependencies for mono
--->  Verifying checksum(s) for mono
--->  Extracting mono
--->  Applying patches to mono
--->  Configuring mono
--->  Building mono
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.2.3" && /usr/bin/make -j2 all " returned error 2
Command output:       _setup_interface_offsets in libmonoruntime.a(class.o)
      _setup_interface_offsets in libmonoruntime.a(class.o)
      _setup_interface_offsets in libmonoruntime.a(class.o)
      _mono_method_add_generic_virtual_invocation in libmonoruntime.a(object.o)
      _build_imt_slots in libmonoruntime.a(object.o)
      _mono_class_proxy_vtable in libmonoruntime.a(object.o)
      _mono_reflection_free_type_info in libmonoruntime.a(reflection.o)
      _mono_dynamic_image_free in libmonoruntime.a(reflection.o)
      _mono_image_build_metadata in libmonoruntime.a(reflection.o)
      __wapi_thread_set_termination_details in libwapi.a(threads.o)
      __wapi_thread_set_termination_details in libwapi.a(threads.o)
      _cominterop_can_support_dispatch in libmonoruntime.a(marshal.o)
      _cominterop_can_support_dispatch in libmonoruntime.a(marshal.o)
      _cominterop_get_method_interface in libmonoruntime.a(marshal.o)
      _cominterop_ccw_queryinterface in libmonoruntime.a(marshal.o)
      _cominterop_ccw_queryinterface in libmonoruntime.a(marshal.o)
      _ves_icall_System_AppDomain_GetAssemblies in libmonoruntime.a(appdomain.o)
      _ves_icall_Type_GetInterfaces in libmonoruntime.a(icall.o)
      _ves_icall_Type_GetInterfaces in libmonoruntime.a(icall.o)
      _finalizer_thread in libmonoruntime.a(gc.o)
      _ves_icall_System_IO_MonoIO_GetFileSystemEntries in libmonoruntime.a(file-io.o)
      _ves_icall_System_Diagnostics_Process_GetModules_internal in libmonoruntime.a(process.o)
      __wapi_io_scandir in libwapi.a(io-portability.o)
      __wapi_io_scandir in libwapi.a(io-portability.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [pedump] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Replying to dports@…:

The patch I provided makes a 32-bit build work for me (previously, that didn't work either).

I am unfortunately unable to test 64-bit compilation, for a rather embarrassing reason: after screwing around for a while trying to figure out why 64-bit binaries never worked for me, I discovered that, to my surprise, my laptop has a 32-bit CPU. Oops. Fail.

comment:30 in reply to:  29 ; Changed 14 years ago by drkp (Dan Ports)

Replying to ps@…:

I'm sorry but your patch doesn't work. I get the following linker errors. Could you care to explain how you got your patch to work ?

Interesting. I see that's the same error a couple other people posted above, but I didn't run into it even without the patch. I'm guessing there's more than one bug at work here, but I'm not sure why I'm not seeing that one.

Perhaps it's because I'm running on a 32-bit machine? I'll see if I can borrow a 64-bit machine and try it there.

comment:31 in reply to:  30 Changed 14 years ago by rob@…

Replying to dports@…:

Replying to ps@…:

I'm sorry but your patch doesn't work. I get the following linker errors. Could you care to explain how you got your patch to work ?

Interesting. I see that's the same error a couple other people posted above, but I didn't run into it even without the patch. I'm guessing there's more than one bug at work here, but I'm not sure why I'm not seeing that one.

Perhaps it's because I'm running on a 32-bit machine? I'll see if I can borrow a 64-bit machine and try it there.

I can confirm that the patch works on a 32bit platform but not a 64bit platform

comment:32 Changed 14 years ago by rob@…

The build of mono fails on x86_64 because it can't find the 32bit dynamic librares

if you look at the debug output you will get messages similar to

ld: warning: in /opt/local/lib/libgthread-2.0.dylib, file is not of required architecture
ld: warning: in /opt/local/lib/libglib-2.0.dylib, file is not of required architecture
ld: warning: in /opt/local/lib/libintl.dylib, file is not of required architecture
ld: warning: in /opt/local/lib/libiconv.dylib, file is not of required architecture

If you get the output

/opt/local/lib/libiconv.dylib: Mach-O 64-bit dynamically linked shared library x86_64

Then you will need to uninstall glib2, gettext and libiconv and reinstall using the universal variant

# port -f uninstall glib2
# port -f uninstall gettext
# port -f uninstall libiconv
# port install glib2 +universal
# port install zlib +universal 
# file -L /opt/local/lib/libglib-2.0.dylib 

/opt/local/lib/libglib-2.0.dylib: Mach-O universal binary with 2 architectures
/opt/local/lib/libglib-2.0.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64
/opt/local/lib/libglib-2.0.dylib (for architecture i386):	Mach-O dynamically linked shared library i386

This shows that the libraries are universal

Then mono should build and install

Rob

Changed 14 years ago by deesto (John S. De Stefano Jr.)

Attachment: port-mono.log added

comment:33 in reply to:  32 Changed 14 years ago by deesto (John S. De Stefano Jr.)

My build is currently failing as well, with a seemingly different error; please see attached port-mono.log .

comment:34 Changed 14 years ago by deesto (John S. De Stefano Jr.)

Cc: deesto@… added

Cc Me!

comment:35 Changed 14 years ago by matt@…

Cc: matt@… added

Cc Me!

Changed 14 years ago by rob@…

Attachment: Portfile added

Portfile for mono build on Snow Leopard with x86_64 patch

comment:36 Changed 14 years ago by rob@…

I think the error is caused by the __X86_64__ symbol not being picked up properly in

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.2.3/libgc/include/private/gcconfig.h

This probably needs to be reported to the mono project upstream

Here is the procedure that I used to get mono installed on a 64 bit Macbook Pro. YMMV.

  • Clean up all installed ports
    # port -f clean --all installed
    
  • Uninstall all ports
    # port -f uninstall installed 
    
  • Update the macports tree
    # port selfupdate 
    
  • Install the glib2 universal port
    # port install glib2 +universal 
    
  • Install the zlib universal port
    # port install zlib +universal
    
  • Replace the current Portfile for mono with the one attached to this ticket
  • Install mono
    # port install mono 
    

Rob.

comment:37 Changed 14 years ago by domiman@…

Cc: domiman@… added

Cc Me!

comment:38 Changed 14 years ago by andreas@…

Cc: andreas@… added

Cc Me!

comment:39 Changed 14 years ago by p_ansell@…

Cc: p_ansell@… added

Cc Me!

comment:40 Changed 14 years ago by p_ansell@…

Has anyone tried bumping versions to 2.4.3?

http://www.mono-project.com/Release_Notes_Mono_2.4.3

comment:41 Changed 14 years ago by p_ansell@…

I just tried bumping the version in the Portfile to 2.4.3 and removing all of the patchfiles and it fails with exactly the same error as in 2.4.2.3

/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.2 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.3/libgc/include -DPACKAGE_NAME=\"libgc-mono\" -DPACKAGE_TARNAME=\"libgc-mono\" -DPACKAGE_VERSION=\"6.6\" -DPACKAGE_STRING=\"libgc-mono\ 6.6\" -DPACKAGE_BUGREPORT=\"Hans_Boehm@hp.com\" -DGC_DARWIN_THREADS=1 -DTHREAD_LOCAL_ALLOC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSILENT=1 -DNO_SIGNALS=1 -DNO_EXECUTE_PERMISSION=1 -DJAVA_FINALIZATION=1 -DGC_GCJ_SUPPORT=1 -DATOMIC_UNCOLLECTABLE=1 -D_IN_LIBGC=1 -I./.. -I./.. -I./include  -I/opt/local/include -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP -DGetCurrentProcess=MonoGetCurrentProcess -DGetCurrentThread=MonoGetCurrentThread -DCreateEvent=MonoCreateEvent   -O2 -arch x86_64 -g   -MT allchblk.lo -MD -MP -MF .deps/allchblk.Tpo -c -o allchblk.lo allchblk.c
/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.2 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.3/libgc/include -DPACKAGE_NAME=\"libgc-mono\" -DPACKAGE_TARNAME=\"libgc-mono\" -DPACKAGE_VERSION=\"6.6\" -DPACKAGE_STRING=\"libgc-mono\ 6.6\" -DPACKAGE_BUGREPORT=\"Hans_Boehm@hp.com\" -DGC_DARWIN_THREADS=1 -DTHREAD_LOCAL_ALLOC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSILENT=1 -DNO_SIGNALS=1 -DNO_EXECUTE_PERMISSION=1 -DJAVA_FINALIZATION=1 -DGC_GCJ_SUPPORT=1 -DATOMIC_UNCOLLECTABLE=1 -D_IN_LIBGC=1 -I./.. -I./.. -I./include  -I/opt/local/include -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP -DGetCurrentProcess=MonoGetCurrentProcess -DGetCurrentThread=MonoGetCurrentThread -DCreateEvent=MonoCreateEvent   -O2 -arch x86_64 -g   -MT alloc.lo -MD -MP -MF .deps/alloc.Tpo -c -o alloc.lo alloc.c
libtool: compile:  /usr/bin/gcc-4.2 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.3/libgc/include -DPACKAGE_NAME=\"libgc-mono\" -DPACKAGE_TARNAME=\"libgc-mono\" -DPACKAGE_VERSION=\"6.6\" "-DPACKAGE_STRING=\"libgc-mono 6.6\"" -DPACKAGE_BUGREPORT=\"Hans_Boehm@hp.com\" -DGC_DARWIN_THREADS=1 -DTHREAD_LOCAL_ALLOC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSILENT=1 -DNO_SIGNALS=1 -DNO_EXECUTE_PERMISSION=1 -DJAVA_FINALIZATION=1 -DGC_GCJ_SUPPORT=1 -DATOMIC_UNCOLLECTABLE=1 -D_IN_LIBGC=1 -I./.. -I./.. -I./include -I/opt/local/include -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP -DGetCurrentProcess=MonoGetCurrentProcess -DGetCurrentThread=MonoGetCurrentThread -DCreateEvent=MonoCreateEvent -O2 -arch x86_64 -g -MT allchblk.lo -MD -MP -MF .deps/allchblk.Tpo -c allchblk.c  -fno-common -DPIC -o .libs/allchblk.o
libtool: compile:  /usr/bin/gcc-4.2 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.3/libgc/include -DPACKAGE_NAME=\"libgc-mono\" -DPACKAGE_TARNAME=\"libgc-mono\" -DPACKAGE_VERSION=\"6.6\" "-DPACKAGE_STRING=\"libgc-mono 6.6\"" -DPACKAGE_BUGREPORT=\"Hans_Boehm@hp.com\" -DGC_DARWIN_THREADS=1 -DTHREAD_LOCAL_ALLOC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSILENT=1 -DNO_SIGNALS=1 -DNO_EXECUTE_PERMISSION=1 -DJAVA_FINALIZATION=1 -DGC_GCJ_SUPPORT=1 -DATOMIC_UNCOLLECTABLE=1 -D_IN_LIBGC=1 -I./.. -I./.. -I./include -I/opt/local/include -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP -DGetCurrentProcess=MonoGetCurrentProcess -DGetCurrentThread=MonoGetCurrentThread -DCreateEvent=MonoCreateEvent -O2 -arch x86_64 -g -MT alloc.lo -MD -MP -MF .deps/alloc.Tpo -c alloc.c  -fno-common -DPIC -o .libs/alloc.o
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.3/libgc/include/private/gc_priv.h:66,
                 from allchblk.c:19:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.3/libgc/include/private/gcconfig.h:499: error: expected identifier or '(' before '--' tokenIn file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.3/libgc/include/private/gc_priv.h:66,
                 from alloc.c:19:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.3/libgc/include/private/gcconfig.h:499: error: expected identifier or '(' before '--' token

comment:42 Changed 14 years ago by rob@…

Hi Guys,

mono 2.6 is released

I have downloaded the source from http://ftp.novell.com/pub/mono/sources/mono/mono-2.6.tar.bz2

I have managed to build mono 2.6 from source and it seems ok

However when I do a standard port install mono from my modified portfile I get the error

gcc4.2 -E, -S, -save-temps and -M options are not allowed with multiple -arch flags

Any Ideas ??

comment:43 in reply to:  42 Changed 14 years ago by mww@…

Replying to rob@…:

I have managed to build mono 2.6 from source and it seems ok

However when I do a standard port install mono from my modified portfile I get the error

gcc4.2 -E, -S, -save-temps and -M options are not allowed with multiple -arch flags

Any Ideas ??

The mono folks seem to have "fixed" the build by simply forcing all builds of mono on 10.6 to be 32 bit. If port tries to build a 64 bit version, well, it fails. :(

comment:44 Changed 14 years ago by reid@…

Cc: reid@… added

Cc Me!

comment:45 Changed 14 years ago by motya@…

Cc: motya@… added

Cc Me!

comment:46 Changed 14 years ago by sgaragagghu@…

Cc: sgaragagghu@… added

Cc Me!

comment:47 Changed 14 years ago by mf2k (Frank Schima)

Cc: s.bonczkowski@… added

Cc reporter of dup #23873.

comment:48 in reply to:  36 Changed 14 years ago by puddingpop@…

Thanks Rob! This was really helpful, but I didn't want to uninstall and reinstall all of my ports. Starting with your instructions (and your Portfile), I found an easier alternative:

  • Install the glib2 and zlib universal ports
    # port upgrade --enforce-variants glib2 +universal zlib +universal 
    
  • Replace the current Portfile for mono with the one attached to this ticket
  • Install mono
    # port install mono 
    

--brian

Replying to rob@…:

I think the error is caused by the __X86_64__ symbol not being picked up properly in

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.4.2.3/libgc/include/private/gcconfig.h

This probably needs to be reported to the mono project upstream

Here is the procedure that I used to get mono installed on a 64 bit Macbook Pro. YMMV.

Clean up all installed ports

# port -f clean --all installed

Uninstall all ports

# port -f uninstall installed

Update the macports tree

# port selfupdate

Install the glib2 universal port

# port install glib2 +universal

Install the zlib universal port

# port install zlib +universal

Replace the current Portfile for mono with the one attached to this ticket

Install mono

# port install mono

Rob.

comment:49 Changed 14 years ago by leafyoung@…

Cc: leafyoung@… added

Cc Me!

comment:50 in reply to:  7 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

Replying to mighty_ernie@…:

Oh, I lied. The latest mono does not support x86_64 fully. Someone is working on it, but suggests configuring for 32bit for the time being:

I forced the port to 32-bit mode in r66141. It's a start, anyway. And the update to 2.6.3 in #24371 seems to build on Snow Leopard without any further modifications.

comment:51 Changed 14 years ago by deesto (John S. De Stefano Jr.)

Hmm ... after a fresh 'port selfupdate && port clean mono':

$ sudo port install -d mono
--->  Computing dependencies for mono
--->  Fetching mono
--->  Verifying checksum(s) for mono
--->  Extracting mono
--->  Applying patches to mono
--->  Configuring mono
--->  Building mono
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_mono/work/mono-2.6.3" && /usr/bin/make -j2 all " returned error 2
Command output:       _initialize_imt_slot in libmonoruntime.a(object.o)
      _mono_method_add_generic_virtual_invocation in libmonoruntime.a(object.o)
      _mono_class_proxy_vtable in libmonoruntime.a(object.o)
      _ves_icall_System_AppDomain_GetAssemblies in libmonoruntime.a(appdomain.o)
      _mono_reflection_free_type_info in libmonoruntime.a(reflection.o)
      _mono_dynamic_image_free in libmonoruntime.a(reflection.o)
      _mono_image_build_metadata in libmonoruntime.a(reflection.o)
      __wapi_thread_set_termination_details in libwapi.a(wthreads.o)
      __wapi_thread_set_termination_details in libwapi.a(wthreads.o)
      _cominterop_can_support_dispatch in libmonoruntime.a(cominterop.o)
      _cominterop_can_support_dispatch in libmonoruntime.a(cominterop.o)
      _cominterop_get_method_interface in libmonoruntime.a(cominterop.o)
      _cominterop_ccw_queryinterface in libmonoruntime.a(cominterop.o)
      _cominterop_ccw_queryinterface in libmonoruntime.a(cominterop.o)
      _ves_icall_Type_GetInterfaces in libmonoruntime.a(icall.o)
      _ves_icall_Type_GetInterfaces in libmonoruntime.a(icall.o)
      _mono_basic_block_split in libmonoruntime.a(mono-basic-block.o)
      _finalizer_thread in libmonoruntime.a(gc.o)
      _ves_icall_System_IO_MonoIO_GetFileSystemEntries in libmonoruntime.a(file-io.o)
      _ves_icall_System_Diagnostics_Process_GetModules_internal in libmonoruntime.a(process.o)
      _mono_debug_symfile_get_line_numbers in libmonoruntime.a(debug-mono-symfile.o)
      _mono_debug_symfile_get_line_numbers in libmonoruntime.a(debug-mono-symfile.o)
      __wapi_io_scandir in libwapi.a(io-portability.o)
      __wapi_io_scandir in libwapi.a(io-portability.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [pedump] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Error: Status 1 encountered during processing.
Before reporting a bug, first run the command again with the -d flag to get complete output.

comment:52 in reply to:  51 ; Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to deesto@…:

Hmm ... after a fresh 'port selfupdate && port clean mono':

$ sudo port install -d mono

Insufficient information. We need to see the full debug output. To get it, you need to use the "-d" switch, in the right place -- between "port" and "install", not after "install". Please clean and try again.

sudo port clean mono
sudo port -d install mono build.jobs=1 2>&1 | tee ~/Desktop/mono-2.6.3.txt
bzip2 ~/Desktop/mono-2.6.3.txt

Assuming this fails again, attach mono-2.6.3.txt.bz2 from your desktop to this ticket.

comment:53 in reply to:  52 Changed 14 years ago by deesto (John S. De Stefano Jr.)

Replying to ryandesign@…:

Replying to deesto@…:

Hmm ... after a fresh 'port selfupdate && port clean mono':

$ sudo port install -d mono

Insufficient information. We need to see the full debug output. To get it, you need to use the "-d" switch, in the right place -- between "port" and "install", not after "install". Please clean and try again.

sudo port clean mono
sudo port -d install mono build.jobs=1 2>&1 | tee ~/Desktop/mono-2.6.3.txt
bzip2 ~/Desktop/mono-2.6.3.txt

Assuming this fails again, attach mono-2.6.3.txt.bz2 from your desktop to this ticket.

Thanks for the debug syntax correction. The installation still fails. Please see (newest) attached log.

Changed 14 years ago by deesto (John S. De Stefano Jr.)

Attachment: mono-port-log.txt.bz2 added

deesto's newest install log

comment:54 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Ok, the log says:

ld: warning: in /opt/local/lib/libgthread-2.0.dylib, file is not of required architecture
ld: warning: in /opt/local/lib/libglib-2.0.dylib, file is not of required architecture
ld: warning: in /opt/local/lib/libintl.dylib, file is not of required architecture
ld: warning: in /opt/local/lib/libiconv.dylib, file is not of required architecture

mono builds for i386, but software builds for x86_64 by default on Snow Leopard. So you must first build all mono's dependencies universal before you will be able to build mono. I added the archcheck portgroup to mono in r66341 to provide more meaningful error messages and advice in this situation.

Note: See TracTickets for help on using tickets.