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)

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


Attachments

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.

Note You need to log in before you can comment on or make changes to this bug.