[Mono-dev] help building mono x86_64 on OS X 10.9

Brian Reiter breiter at wolfereiter.com
Wed Dec 4 10:47:48 UTC 2013


I want to build mono-3.2.5 and mono-3.2.6-branch from git. I’m using libgdiplus built by MacPorts.

I’m attempting to use the x86_64 libraries from MacPorts but my own build of mono/llvm into prefix /opt/mono64. My build dies while linking to libmonoruntime.a. 

clang --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

[master] $ git checkout mono-3.2.5
[(mono-3.2.5)] $ MONO_USE_LLVM=1 CPPFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib -lintl -lcharset" PATH=/opt/mono64/bin:/opt/local/lib/pkgconfig:$PATH ./autogen.sh --prefix=/opt/mono64 --enable-llvm=yes --with-gc=sgen --enable-nls=no --with-libgdiplus=/opt/local/

...

[(mono-3.2.5)] $ make 

...

  CC       pedump.o
  CCLD     pedump
Undefined symbols for architecture x86_64:
  "_mono_gc_add_memory_pressure", referenced from:
      _icall_functions in libmonoruntime.a(libmonoruntime_la-icall.o)
  "_mono_gc_alloc_fixed", referenced from:
      _mono_domain_create in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_domain_foreach in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_domain_add_class_static_data in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_alloc_static_data in libmonoruntime.a(libmonoruntime_la-threads.o)
      _mono_class_vtable_full in libmonoruntime.a(libmonoruntime_la-object.o)
      _mono_image_build_metadata in libmonoruntime.a(libmonoruntime_la-reflection.o)
      _collect_types in libmonoruntime.a(libmonoruntime_la-reflection.o)
      ...
  "_mono_gc_base_init", referenced from:
      _mono_init_internal in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_debug_init in libmonoruntime.a(libmonoruntime_la-mono-debug.o)
      _mono_runtime_init in libmonoruntime.a(libmonoruntime_la-appdomain.o)
      _mono_gc_init in libmonoruntime.a(libmonoruntime_la-gc.o)
      _mono_profiler_load in libmonoruntime.a(libmonoruntime_la-profiler.o)
  "_mono_gc_clear_domain", referenced from:
      _mono_domain_free in libmonoruntime.a(libmonoruntime_la-domain.o)
  "_mono_gc_collect", referenced from:
      _unload_thread_main in libmonoruntime.a(libmonoruntime_la-appdomain.o)
      _mono_domain_finalize in libmonoruntime.a(libmonoruntime_la-gc.o)
      _ves_icall_System_GC_InternalCollect in libmonoruntime.a(libmonoruntime_la-gc.o)
      _ves_icall_System_GC_GetTotalMemory in libmonoruntime.a(libmonoruntime_la-gc.o)
  "_mono_gc_collection_count", referenced from:
      _icall_functions in libmonoruntime.a(libmonoruntime_la-icall.o)
  "_mono_gc_deregister_root", referenced from:
      _mono_domain_free in libmonoruntime.a(libmonoruntime_la-domain.o)
      _thread_cleanup in libmonoruntime.a(libmonoruntime_la-threads.o)
      _mono_dynamic_image_free in libmonoruntime.a(libmonoruntime_la-reflection.o)
      _mono_reflection_free_dynamic_generic_class in libmonoruntime.a(libmonoruntime_la-reflection.o)
      _mono_cq_destroy in libmonoruntime.a(libmonoruntime_la-mono-cq.o)
      _mono_wsq_destroy in libmonoruntime.a(libmonoruntime_la-mono-wsq.o)
  "_mono_gc_enable_events", referenced from:
      _mono_profiler_install_gc in libmonoruntime.a(libmonoruntime_la-profiler.o)
  "_mono_gc_free_fixed", referenced from:
      _mono_domain_create in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_domain_foreach in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_domain_free in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_domain_add_class_static_data in libmonoruntime.a(libmonoruntime_la-domain.o)
      _thread_cleanup in libmonoruntime.a(libmonoruntime_la-threads.o)
      _mono_image_build_metadata in libmonoruntime.a(libmonoruntime_la-reflection.o)
      _collect_types in libmonoruntime.a(libmonoruntime_la-reflection.o)
      ...
  "_mono_gc_get_generation", referenced from:
      _icall_functions in libmonoruntime.a(libmonoruntime_la-icall.o)
  "_mono_gc_get_los_limit", referenced from:
      _ves_icall_System_String_GetLOSLimit in libmonoruntime.a(libmonoruntime_la-string-icalls.o)
  "_mono_gc_get_used_size", referenced from:
      _ves_icall_System_GC_GetTotalMemory in libmonoruntime.a(libmonoruntime_la-gc.o)
  "_mono_gc_get_vtable_bits", referenced from:
      _mono_class_vtable_full in libmonoruntime.a(libmonoruntime_la-object.o)
  "_mono_gc_invoke_finalizers", referenced from:
      _finalizer_thread in libmonoruntime.a(libmonoruntime_la-gc.o)
  "_mono_gc_invoke_with_gc_lock", referenced from:
      _rehash in libmonoruntime.a(libmonoruntime_la-mono-hash.o)
  "_mono_gc_is_disabled", referenced from:
      _mono_gc_init in libmonoruntime.a(libmonoruntime_la-gc.o)
  "_mono_gc_is_moving", referenced from:
      _mono_class_layout_fields in libmonoruntime.a(libmonoruntime_la-class.o)
      _mono_init_internal in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_domain_free in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_domain_add_class_static_data in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_delegate_to_ftnptr in libmonoruntime.a(libmonoruntime_la-marshal.o)
      _mono_ftnptr_to_delegate in libmonoruntime.a(libmonoruntime_la-marshal.o)
      _mono_delegate_free_ftnptr in libmonoruntime.a(libmonoruntime_la-marshal.o)
      ...
  "_mono_gc_make_descr_for_array", referenced from:
      _mono_class_compute_gc_descriptor in libmonoruntime.a(libmonoruntime_la-object.o)
  "_mono_gc_make_descr_for_object", referenced from:
      _mono_class_compute_gc_descriptor in libmonoruntime.a(libmonoruntime_la-object.o)
  "_mono_gc_make_descr_for_string", referenced from:
      _mono_class_compute_gc_descriptor in libmonoruntime.a(libmonoruntime_la-object.o)
  "_mono_gc_make_descr_from_bitmap", referenced from:
      _mono_domain_create in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_class_vtable_full in libmonoruntime.a(libmonoruntime_la-object.o)
  "_mono_gc_make_root_descr_all_refs", referenced from:
      _mono_domain_add_class_static_data in libmonoruntime.a(libmonoruntime_la-domain.o)
      _emit_invoke_call in libmonoruntime.a(libmonoruntime_la-marshal.o)
      _mono_thread_set_main in libmonoruntime.a(libmonoruntime_la-object.o)
      _mono_class_vtable_full in libmonoruntime.a(libmonoruntime_la-object.o)
      _mono_runtime_run_main in libmonoruntime.a(libmonoruntime_la-object.o)
      _mono_image_build_metadata in libmonoruntime.a(libmonoruntime_la-reflection.o)
      _mono_image_get_method_info in libmonoruntime.a(libmonoruntime_la-reflection.o)
      ...
  "_mono_gc_make_root_descr_user", referenced from:
      _mono_alloc_static_data in libmonoruntime.a(libmonoruntime_la-threads.o)
  "_mono_gc_max_generation", referenced from:
      _icall_functions in libmonoruntime.a(libmonoruntime_la-icall.o)
      _unload_thread_main in libmonoruntime.a(libmonoruntime_la-appdomain.o)
      _mono_domain_finalize in libmonoruntime.a(libmonoruntime_la-gc.o)
      _ves_icall_System_GC_GetTotalMemory in libmonoruntime.a(libmonoruntime_la-gc.o)
  "_mono_gc_pending_finalizers", referenced from:
      _ves_icall_System_GC_WaitForPendingFinalizers in libmonoruntime.a(libmonoruntime_la-gc.o)
  "_mono_gc_pthread_detach", referenced from:
      _thread_start_routine in libwapi.a(wthreads.o)
  "_mono_gc_pthread_exit", referenced from:
      _thread_start_routine in libwapi.a(wthreads.o)
      _ExitThread in libwapi.a(wthreads.o)
      _thread_exit in libwapi.a(wthreads.o)
  "_mono_gc_register_root", referenced from:
      _mono_domain_create in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_init_internal in libmonoruntime.a(libmonoruntime_la-domain.o)
      _emit_invoke_call in libmonoruntime.a(libmonoruntime_la-marshal.o)
      _mono_thread_create_internal in libmonoruntime.a(libmonoruntime_la-threads.o)
      _handle_store in libmonoruntime.a(libmonoruntime_la-threads.o)
      _mono_thread_attach_full in libmonoruntime.a(libmonoruntime_la-threads.o)
      _ves_icall_System_Threading_Thread_Thread_internal in libmonoruntime.a(libmonoruntime_la-threads.o)
      ...
  "_mono_gc_register_thread", referenced from:
      _mono_thread_attach_full in libmonoruntime.a(libmonoruntime_la-threads.o)
  "_mono_gc_set_allow_synchronous_major", referenced from:
      _ves_icall_Mono_Runtime_SetGCAllowSynchronousMajor in libmonoruntime.a(libmonoruntime_la-gc.o)
  "_mono_gc_set_current_thread_appdomain", referenced from:
      _mono_init_internal in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_domain_unset in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_domain_set_internal_with_options in libmonoruntime.a(libmonoruntime_la-domain.o)
  "_mono_gc_set_skip_thread", referenced from:
      _async_invoke_thread in libmonoruntime.a(libmonoruntime_la-threadpool.o)
      _tp_poll_wait in libmonoruntime.a(libmonoruntime_la-threadpool.o)
  "_mono_gc_set_stack_end", referenced from:
      _start_wrapper in libmonoruntime.a(libmonoruntime_la-threads.o)
  "_mono_gc_user_markers_supported", referenced from:
      _thread_cleanup in libmonoruntime.a(libmonoruntime_la-threads.o)
      _mono_alloc_static_data in libmonoruntime.a(libmonoruntime_la-threads.o)
  "_mono_gc_wbarrier_arrayref_copy", referenced from:
      _ves_icall_System_Array_FastCopy in libmonoruntime.a(libmonoruntime_la-icall.o)
      _ves_icall_System_Reflection_Assembly_GetTypes in libmonoruntime.a(libmonoruntime_la-icall.o)
  "_mono_gc_wbarrier_generic_nostore", referenced from:
      _mono_marshal_init in libmonoruntime.a(libmonoruntime_la-marshal.o)
      _ves_icall_System_Threading_Interlocked_Exchange_Object in libmonoruntime.a(libmonoruntime_la-threads.o)
      _ves_icall_System_Threading_Interlocked_CompareExchange_Object in libmonoruntime.a(libmonoruntime_la-threads.o)
      _ves_icall_System_Threading_Interlocked_CompareExchange_T in libmonoruntime.a(libmonoruntime_la-threads.o)
      _ves_icall_System_Threading_Interlocked_Exchange_T in libmonoruntime.a(libmonoruntime_la-threads.o)
      _ves_icall_System_Threading_Volatile_Write_T in libmonoruntime.a(libmonoruntime_la-threads.o)
  "_mono_gc_wbarrier_generic_store", referenced from:
      _ves_icall_System_Threading_Thread_VolatileWriteObject in libmonoruntime.a(libmonoruntime_la-threads.o)
      _set_value in libmonoruntime.a(libmonoruntime_la-object.o)
      _mono_method_return_message_restore in libmonoruntime.a(libmonoruntime_la-object.o)
      _ves_icall_System_Array_SetGenericValueImpl in libmonoruntime.a(libmonoruntime_la-icall.o)
      _ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData in libmonoruntime.a(libmonoruntime_la-icall.o)
      _ves_icall_get_enum_info in libmonoruntime.a(libmonoruntime_la-icall.o)
      _ves_icall_System_Reflection_Assembly_GetManifestResourceInternal in libmonoruntime.a(libmonoruntime_la-icall.o)
      ...
  "_mono_gc_wbarrier_object_copy", referenced from:
      _mono_object_clone in libmonoruntime.a(libmonoruntime_la-object.o)
  "_mono_gc_wbarrier_set_arrayref", referenced from:
      _mono_marshal_xdomain_copy_value in libmonoruntime.a(libmonoruntime_la-marshal.o)
      _mono_marshal_xdomain_copy_out_value in libmonoruntime.a(libmonoruntime_la-marshal.o)
      _mono_perfcounter_category_names in libmonoruntime.a(libmonoruntime_la-mono-perfcounters.o)
      _mono_perfcounter_counter_names in libmonoruntime.a(libmonoruntime_la-mono-perfcounters.o)
      _mono_perfcounter_instance_names in libmonoruntime.a(libmonoruntime_la-mono-perfcounters.o)
      _get_string_array in libmonoruntime.a(libmonoruntime_la-mono-perfcounters.o)
      _mono_runtime_get_main_args in libmonoruntime.a(libmonoruntime_la-object.o)
      ...
  "_mono_gc_wbarrier_set_field", referenced from:
      _mono_domain_set_internal_with_options in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_context_set in libmonoruntime.a(libmonoruntime_la-domain.o)
      _mono_string_builder_to_utf8 in libmonoruntime.a(libmonoruntime_la-marshal.o)
      _mono_string_builder_to_utf16 in libmonoruntime.a(libmonoruntime_la-marshal.o)
      _mono_string_utf8_to_builder in libmonoruntime.a(libmonoruntime_la-marshal.o)
      _mono_delegate_begin_invoke in libmonoruntime.a(libmonoruntime_la-marshal.o)
      _mono_delegate_end_invoke in libmonoruntime.a(libmonoruntime_la-marshal.o)
      ...
  "_mono_gc_wbarrier_value_copy", referenced from:
      _set_value in libmonoruntime.a(libmonoruntime_la-object.o)
      _mono_nullable_box in libmonoruntime.a(libmonoruntime_la-object.o)
      _mono_nullable_init in libmonoruntime.a(libmonoruntime_la-object.o)
      _mono_value_copy in libmonoruntime.a(libmonoruntime_la-object.o)
      _mono_value_copy_array in libmonoruntime.a(libmonoruntime_la-object.o)
      _mono_method_return_message_restore in libmonoruntime.a(libmonoruntime_la-object.o)
      _ves_icall_System_Array_SetGenericValueImpl in libmonoruntime.a(libmonoruntime_la-icall.o)
      ...
  "_mono_gc_weak_link_add", referenced from:
      _ves_icall_System_GCHandle_GetTargetHandle in libmonoruntime.a(libmonoruntime_la-gc.o)
      _alloc_handle in libmonoruntime.a(libmonoruntime_la-gc.o)
      _mono_monitor_try_enter_internal in libmonoruntime.a(libmonoruntime_la-monitor.o)
  "_mono_gc_weak_link_get", referenced from:
      _mono_gchandle_get_target in libmonoruntime.a(libmonoruntime_la-gc.o)
      _alloc_handle in libmonoruntime.a(libmonoruntime_la-gc.o)
      _mono_locks_dump in libmonoruntime.a(libmonoruntime_la-monitor.o)
  "_mono_gc_weak_link_remove", referenced from:
      _ves_icall_System_GCHandle_GetTargetHandle in libmonoruntime.a(libmonoruntime_la-gc.o)
      _mono_gchandle_free in libmonoruntime.a(libmonoruntime_la-gc.o)
      _alloc_handle in libmonoruntime.a(libmonoruntime_la-gc.o)
      _mono_gchandle_free_domain in libmonoruntime.a(libmonoruntime_la-gc.o)
      _mono_monitor_try_enter_internal in libmonoruntime.a(libmonoruntime_la-monitor.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [pedump] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

All of the object files are x86_64:
[(mono-3.2.5)] $ find . -name *.o | xargs file | grep -v x86_64 | wc -l
       0

Thanks.

//brian reiter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20131204/d3dd33a0/attachment.pgp>


More information about the Mono-devel-list mailing list