Improve TLS link test for cross-compiling

H.J. Lu hjl.tools@gmail.com
Fri Jul 17 13:58:00 GMT 2009


On Thu, Jul 2, 2009 at 12:44 PM, Joseph S. Myers<joseph@codesourcery.com> wrote:
> When cross-compiling, GCC_CHECK_TLS uses a link-time test for TLS
> support.  However, code built for an executable, or linked into an
> executable, can link OK when libc in fact lacks TLS support, even if
> code linked into a shared library would not, because of the different
> TLS access models and linker optimizations used in the different
> cases.
>
> This patch adds an additional link-time test for linking with -shared
> -Wl,--no-undefined in this case: if linking a non-TLS file with those
> options succeeds (so, in particular, they are appropriate options for the
> target in question), but linking TLS code with them fails, then TLS is not
> supported.  Tested with no regressions with cross to i686-pc-linux-gnu
> using a sysroot with pre-TLS libc.  OK to commit?
>
> config:
> 2009-07-02  Joseph Myers  <joseph@codesourcery.com>
>
>        * tls.m4 (GCC_CHECK_TLS): Also test TLS in a shared library when
>        cross-compiling.
>
> libgomp:
> 2009-07-02  Joseph Myers  <joseph@codesourcery.com>
>
>        * configure: Regenerate.
>
> libjava:
> 2009-07-02  Joseph Myers  <joseph@codesourcery.com>
>
>        * configure: Regenerate.
>
> libmudflap:
> 2009-07-02  Joseph Myers  <joseph@codesourcery.com>
>
>        * configure: Regenerate.
>
> libstdc++-v3:
> 2009-07-02  Joseph Myers  <joseph@codesourcery.com>
>
>        * configure: Regenerate.
>

This caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40784


-- 
H.J.



More information about the Java-patches mailing list