On 8 Dec 2008, at 21:09, Andrew Pinski wrote:

On Mon, Dec 8, 2008 at 1:04 PM, IainS <[EMAIL PROTECTED] acoustics.co.uk> wrote:
following on from http://gcc.gnu.org/ml/gcc/2008-05/msg00202.html

As I mentioned; it is emulated.  So it works, by default, though it is

hm.  At the moment it doesn't appear to work.

with configure options "--enable-threads" (or default options) we get the situation described below. with configure options "--enable-threads --enable-tls" we get an assembler fault instead.

===== with "--enable-threads" (and also default options).

(see also PR32765 and http://gcc.gnu.org/ml/fortran/2008-12/ msg00118.html)

___emutls_get_address is defined in libgcc_s.1.dylib (and libgcc_eh.a)

As you suggest in the PR32765 thread, the problem is that libgcc_s.1 is not searched unless this is forced on the options line.

However, the problem is much wider than those two tests.

check_effective_target_tls_runtime in target-supports.exp also fails with the same error - this "UNSUPPORTS" pretty much all TLS tests across gcc on darwin8/9.

The only reason that the PR32765 issue was visible is that the two test cases do not use { dg-require-effective-target tls_runtime }

====

The workaround used to close PR32765 no longer functions on darwin8 (unless the the compiler is installed before checking) - although it does still work on darwin9.

The ___emutls_get_address in libgcc_s.1 also appears to have some issues on 64bit processors, both PPC and Intel (at least when running 32 bit code).

The version in libgcc_eh does work (which is why the --static-libgcc approach is succeeding on darwin9).

so a more closely targeted workaround is to use -lgcc_eh in any darwin code that requires TLS (this works on darwin8 and darwin9).

However, this seems like a pretty messy solution - and prone to all sorts of symbol conflicts when more than ___emutls_get_address is involved.

=====

I'm afraid I'm out of my depth here.... gcc has quite a learning curve...

... is the problem one of SPECs ?
.. or does every single TLS case need a darwin-specific addition to reference -lgcc_eh ? .. I guess also that target-supports.exp would need some modification to account for this...

cheers,
Iain

Reply via email to