It is not possible to use -ftls-model to set the tls-model to global-dynamic for code compiled without -fpic. Code compiled without -fpic uses initial-exec or local-exec.
This makes it impossible to link code that uses tls and is compiled without -fpic in shared libraries. -- Summary: -ftls-model can not be specified independently of - fpic/-fpie Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tom dot aernoudt at coware dot com GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39783