From ca0ddb398fb6173eb97c5d70265e79b9ea2bdc9d Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Mon, 29 Apr 2019 05:42:48 +0000 Subject: libphobos: Fix multilib builds for s390x-linux-gnu Merges upstream druntime aab44549, phobos 3dc363783. Reviewed-on: https://github.com/dlang/druntime/pull/2590 https://github.com/dlang/phobos/pull/6983 libphobos/ChangeLog: 2019-04-28 Iain Buclaw * libdruntime/gcc/sections/elf_shared.d (IBMZ_Any): Define when version S390 or SystemZ. Use condition instead of SystemZ. (getTLSRange): Return null on GNU_EMUTLS targets. From-SVN: r270639 --- libphobos/libdruntime/gcc/sections/elf_shared.d | 35 +++++++++++++++---------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'libphobos/libdruntime/gcc') diff --git a/libphobos/libdruntime/gcc/sections/elf_shared.d b/libphobos/libdruntime/gcc/sections/elf_shared.d index 1eafecd..7f9036b 100644 --- a/libphobos/libdruntime/gcc/sections/elf_shared.d +++ b/libphobos/libdruntime/gcc/sections/elf_shared.d @@ -24,6 +24,8 @@ module gcc.sections.elf_shared; version (RISCV32) version = RISCV_Any; version (RISCV64) version = RISCV_Any; +version (S390) version = IBMZ_Any; +version (SystemZ) version = IBMZ_Any; version (CRuntime_Glibc) enum SharedELF = true; else version (CRuntime_Musl) enum SharedELF = true; @@ -1060,7 +1062,7 @@ else version (MIPS32) enum TLS_DTV_OFFSET = 0x8000; else version (MIPS64) enum TLS_DTV_OFFSET = 0x8000; -else version (SystemZ) +else version (IBMZ_Any) enum TLS_DTV_OFFSET = 0x0; else static assert( false, "Platform not supported." ); @@ -1070,20 +1072,25 @@ void[] getTLSRange(size_t mod, size_t sz) nothrow @nogc if (mod == 0) return null; - version (Solaris) + version (GNU_EMUTLS) + return null; // Handled in scanTLSRanges(). + else { - static if (!OS_Have_Dlpi_Tls_Modid) - mod -= 1; - } + version (Solaris) + { + static if (!OS_Have_Dlpi_Tls_Modid) + mod -= 1; + } - // base offset - auto ti = tls_index(mod, 0); - version (SystemZ) - { - auto idx = cast(void *)__tls_get_addr_internal(&ti) - + cast(ulong)__builtin_thread_pointer(); - return idx[0 .. sz]; + // base offset + auto ti = tls_index(mod, 0); + version (IBMZ_Any) + { + auto idx = cast(void *)__tls_get_addr_internal(&ti) + + cast(ulong)__builtin_thread_pointer(); + return idx[0 .. sz]; + } + else + return (__tls_get_addr(&ti)-TLS_DTV_OFFSET)[0 .. sz]; } - else - return (__tls_get_addr(&ti)-TLS_DTV_OFFSET)[0 .. sz]; } -- cgit v1.1