Bug 21520 - mono build is broken because of test-conc-hashtable failing to link
Summary: mono build is broken because of test-conc-hashtable failing to link
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: unspecified
Hardware: PC Linux
: High normal
Target Milestone: ---
Assignee: Bugzilla
URL:
: 21544 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-07-22 14:25 UTC by Dylan Borg
Modified: 2017-11-29 14:30 UTC (History)
9 users (show)

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


Attachments
config.log (563.03 KB, text/x-log)
2014-08-13 15:24 UTC, Dylan Borg
Details


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 Dylan Borg 2014-07-22 14:25:13 UTC
When trying to build the mono unit tests (part of normal build), test-conc-hashtable is failing to link breaking the build:
make[3]: Entering directory `/mnt/hdd/mono/mono/unit-tests'
  CCLD     test-conc-hashtable
../utils/.libs/libmonoutils.a(mono-threads.o): In function `is_thread_in_critical_region':
/mnt/hdd/mono/mono/utils/mono-threads.c:526: undefined reference to `mono_jit_info_table_find'
/mnt/hdd/mono/mono/utils/mono-threads.c:533: undefined reference to `mono_jit_info_get_method'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `inner_start_thread':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:71: undefined reference to `wapi_create_thread_handle'
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:110: undefined reference to `wapi_thread_handle_set_exited'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `mono_threads_core_exit':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:310: undefined reference to `wapi_thread_handle_set_exited'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `mono_threads_core_unregister':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:320: undefined reference to `wapi_thread_handle_set_exited'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `mono_threads_core_open_handle':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:336: undefined reference to `wapi_ref_thread_handle'
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:334: undefined reference to `wapi_create_thread_handle'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `mono_threads_core_open_thread_handle':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:357: undefined reference to `wapi_ref_thread_handle'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `mono_threads_init_platform':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:433: undefined reference to `mono_thread_get_abort_signal'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `mono_threads_core_abort_syscall':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:471: undefined reference to `mono_thread_get_abort_signal'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `mono_threads_core_suspend':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:484: undefined reference to `mono_thread_get_abort_signal'
../utils/.libs/libmonoutils.a(hazard-pointer.o): In function `mono_thread_smr_init':
/mnt/hdd/mono/mono/utils/hazard-pointer.c:348: undefined reference to `InitializeCriticalSection'
/usr/bin/ld: test-conc-hashtable: hidden symbol `mono_thread_get_abort_signal' isn't defined
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[3]: *** [test-conc-hashtable] Error 1
make[3]: Leaving directory `/mnt/hdd/mono/mono/unit-tests'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/mnt/hdd/mono/mono'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/hdd/mono'
make: *** [all] Error 2
Comment 1 Zoltan Varga 2014-07-23 12:53:26 UTC
*** Bug 21544 has been marked as a duplicate of this bug. ***
Comment 2 Zoltan Varga 2014-07-23 12:55:17 UTC
This happens because of circular dependencies between libmonoruntime/lbiwapi/libmonoutils. The osx linker can handle it, but the linux linker needs --start-group and --end-group flags to the linker to handle this. Unfortunately, its pretty hard to pass these to the linker since libtool has the habbit of reorganizing command line options.
Comment 3 Zoltan Varga 2014-07-23 13:01:41 UTC
Fixed by disabling the unit tests on linux.
Comment 4 Dylan Borg 2014-08-13 06:39:21 UTC
The build broke again because of this. Has the test been re-enabled?

  CCLD     test-conc-hashtable
../utils/.libs/libmonoutils.a(mono-threads.o): In function `is_thread_in_critical_region':
/mnt/hdd/mono/mono/utils/mono-threads.c:526: undefined reference to `mono_jit_info_table_find'
/mnt/hdd/mono/mono/utils/mono-threads.c:533: undefined reference to `mono_jit_info_get_method'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `inner_start_thread':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:71: undefined reference to `wapi_create_thread_handle'
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:110: undefined reference to `wapi_thread_handle_set_exited'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `mono_threads_core_exit':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:310: undefined reference to `wapi_thread_handle_set_exited'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `mono_threads_core_unregister':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:320: undefined reference to `wapi_thread_handle_set_exited'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `mono_threads_core_open_handle':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:336: undefined reference to `wapi_ref_thread_handle'
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:334: undefined reference to `wapi_create_thread_handle'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `mono_threads_core_open_thread_handle':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:357: undefined reference to `wapi_ref_thread_handle'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `mono_threads_init_platform':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:433: undefined reference to `mono_thread_get_abort_signal'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `mono_threads_core_abort_syscall':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:471: undefined reference to `mono_thread_get_abort_signal'
../utils/.libs/libmonoutils.a(mono-threads-posix.o): In function `mono_threads_core_suspend':
/mnt/hdd/mono/mono/utils/mono-threads-posix.c:484: undefined reference to `mono_thread_get_abort_signal'
/usr/bin/ld: test-conc-hashtable: hidden symbol `mono_thread_get_abort_signal' isn't defined
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Comment 5 Zoltan Varga 2014-08-13 12:37:11 UTC
Could you try re-running autogen.sh ?
Comment 6 Dylan Borg 2014-08-13 14:28:13 UTC
I did:
./autogen.sh --prefix=/usr --with-tls=__thread
make

The same thing happened.
Comment 7 Zoltan Varga 2014-08-13 14:44:19 UTC
At the end of configure output, what does Host:/Target: says ?
Comment 8 Dylan Borg 2014-08-13 15:24:39 UTC
Created attachment 7679 [details]
config.log

Attaching whole config.log
Comment 9 Zoltan Varga 2014-08-13 15:34:31 UTC
Should be fixed by mono master 2ceb43d38001755b59a1bcac389eb5d3cb38c990.
Comment 10 Ben Woods 2014-09-28 12:10:35 UTC
This problem also exists on FreeBSD (since it uses the GNU ld linker).

Since the variable "PLATFORM_GNU" is only used for bypassing this test, can we instead change this to "LINKER_GNU" and test for the GNU linker instead of target_os containing GNU?

https://github.com/mono/mono/search?utf8=%E2%9C%93&q=platform_gnu
Comment 11 Anders Jensen-Waud 2015-05-19 01:47:10 UTC
Confirming that this issue still persists with HEAD on FreeBSD 10.1.
Comment 12 Marcin Cieślak 2015-06-07 17:38:51 UTC
I'd like to propose a fix in https://github.com/mono/mono/pull/1859

This should fix FreeBSD and Linux builds as well - I went ahead to create a so-called "convenience" library that solves the interdependencies between static libraries.
Comment 13 Marcin Cieślak 2015-06-15 06:59:38 UTC
The fix has been merged into master, anyone to verify?