Bug 41340 - Mono 4.2.3.4 fails to build with "undefined reference to `mono_jit_tls'"
Summary: Mono 4.2.3.4 fails to build with "undefined reference to `mono_jit_tls'"
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: 4.2.0 (C6)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-05-26 17:52 UTC by Thomas Petazzoni
Modified: 2017-04-04 13:31 UTC (History)
4 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 for Bug 41340 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Thomas Petazzoni 2016-05-26 17:52:17 UTC
When configured with --with-mcs-docs=no --with-moonlight=no --with-ikvm-native=no --enable-minimal=aot,profiler,debug --disable-mcs-build --enable-static --disable-boehm --without-sigaltstack, Mono 4.2.3.4 fails to build with:

./.libs/libmini-static.a(libmini_static_la-mini-runtime.o): In function `mono_get_jit_tls_offset':
/home/thomas/projets/buildroot/output/build/mono-4.2.3.4/mono/mini/mini-runtime.c:714: undefined reference to `mono_jit_tls'
./.libs/libmini-static.a(libmini_static_la-mini-runtime.o): In function `mono_get_lmf_tls_offset':
/home/thomas/projets/buildroot/output/build/mono-4.2.3.4/mono/mini/mini-runtime.c:724: undefined reference to `mono_lmf'
./.libs/libmini-static.a(libmini_static_la-mini-runtime.o): In function `mono_get_lmf_addr_tls_offset':
/home/thomas/projets/buildroot/output/build/mono-4.2.3.4/mono/mini/mini-runtime.c:735: undefined reference to `mono_lmf_addr'
./.libs/libmini-static.a(libmini_static_la-mini-runtime.o): In function `mono_get_jit_tls_offset':
/home/thomas/projets/buildroot/output/build/mono-4.2.3.4/mono/mini/mini-runtime.c:714: undefined reference to `mono_jit_tls'
./.libs/libmini-static.a(libmini_static_la-mini-runtime.o): In function `mono_get_lmf_tls_offset':
/home/thomas/projets/buildroot/output/build/mono-4.2.3.4/mono/mini/mini-runtime.c:724: undefined reference to `mono_lmf'
./.libs/libmini-static.a(libmini_static_la-mini-runtime.o): In function `mono_get_lmf_addr_tls_offset':
/home/thomas/projets/buildroot/output/build/mono-4.2.3.4/mono/mini/mini-runtime.c:735: undefined reference to `mono_lmf_addr'
../../mono/metadata/.libs/libmonoruntimesgen-static.a(libmonoruntimesgen_static_la-threads.o): In function `mono_thread_get_tls_offset':
/home/thomas/projets/buildroot/output/build/mono-4.2.3.4/mono/metadata/threads.c:263: undefined reference to `tls_current_object'
../../mono/metadata/.libs/libmonoruntimesgen-static.a(libmonoruntimesgen_static_la-domain.o): In function `mono_domain_get_tls_offset':
/home/thomas/projets/buildroot/output/build/mono-4.2.3.4/mono/metadata/domain.c:159: undefined reference to `tls_appdomain'
../../mono/metadata/.libs/libmonoruntimesgen-static.a(libmonoruntimesgen_static_la-sgen-mono.o): In function `sgen_client_init':
/home/thomas/projets/buildroot/output/build/mono-4.2.3.4/mono/metadata/sgen-mono.c:2770: undefined reference to `sgen_thread_info'
../../mono/sgen/.libs/libmonosgen-static.a(libmonosgen_static_la-sgen-alloc.o): In function `sgen_init_allocator':
/home/thomas/projets/buildroot/output/build/mono-4.2.3.4/mono/sgen/sgen-alloc.c:552: undefined reference to `tlab_next_addr'
/home/thomas/projets/buildroot/output/build/mono-4.2.3.4/mono/sgen/sgen-alloc.c:553: undefined reference to `tlab_temp_end'

All those variables are declared with MONO_FAST_TLS_DECLARE(), which includes __attribute__ ((used)), but still I get those undefined references.

This is happening with a gcc 4.9.3 compiler.
Comment 1 Anton Voyl 2016-06-10 07:09:13 UTC
I encounter the same problem when I attempt to cross compile mono 4.2.3.4 and 4.4.0.182 for arm and x86_64.

Please let me know if you need further information.

Thank you in advance for your support.
Comment 2 Anton Voyl 2016-07-15 14:17:09 UTC
This problem remains with mono 4.4.1.0 (and gcc 5.4).
I would be very grateful to get any feedback about this issue.
Thank you in advance, and regards.