Bug 49218 - Fails to link with lld
Summary: Fails to link with lld
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-12-07 13:29 UTC by rafael.espindola
Modified: 2017-05-13 07:21 UTC (History)
4 users (show)

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


Attachments

Description rafael.espindola 2016-12-07 13:29:21 UTC
Trying to link all freebsd packages with lld I found that mono is one of the packages that fails.

The problem is from

#define MONO_TLS_FAST __attribute__((tls_model("local-dynamic")))

being used at

extern __thread MONO_TLS_FAST void* GC_thread_tls;

That requests that the variable be accessed using the local dynamic model. That only works if the variable is defined in the local DSO. The problem is that the variable has default visibility, so it is legal for the dynamic linker to preempt it and lld, being more strict than the gnu linker, complains.

Changing the visibility to hidden or protected solves the problem.
Comment 1 David Naylor 2017-05-13 07:21:51 UTC
Is this still an issue with commit 7f76306?  That commit removed the local dynamic model from GC_thread_tls.

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