summaryrefslogtreecommitdiff
path: root/libphobos/libdruntime
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2019-04-23 22:53:25 +0000
committerIain Buclaw <ibuclaw@gcc.gnu.org>2019-04-23 22:53:25 +0000
commit130cc10e2178fd7dcd9b6cabd64008f7c24821c7 (patch)
treeb07fa89734c6f2b88d692e3c6de1be7495b87174 /libphobos/libdruntime
parentd9392bfa032b448839abadb523aff65b8ccb3dba (diff)
libphobos: Add D support for S/390 Linux
gcc/d/ChangeLog: 2019-04-23 Iain Buclaw <ibuclaw@gdcproject.org> Robin Dapp <rdapp@linux.ibm.com> * typeinfo.cc (create_typeinfo): Write typeinfo flags as uint. gcc/testsuite/ChangeLog: 2019-04-23 Iain Buclaw <ibuclaw@gdcproject.org> Robin Dapp <rdapp@linux.ibm.com> * gdc.dg/link.d: Test if target d_runtime. * gdc.dg/runnable.d: Fix tests to work on BigEndian. * gdc.dg/simd.d: Likewise. libphobos/ChangeLog: 2019-04-23 Iain Buclaw <ibuclaw@gdcproject.org> Robin Dapp <rdapp@linux.ibm.com> * configure.tgt: Add s390*-linux* as a supported target. * libdruntime/gcc/sections/elf_shared.d: import gcc.builtins. (__tls_get_addr_internal): Declare. (TLS_DTV_OFFSET): Define as zero on SystemZ. (getTLSRange): Support getting TLS on SystemZ. * testsuite/libphobos.typeinfo/struct-align.d: New test. Co-Authored-By: Robin Dapp <rdapp@linux.ibm.com> From-SVN: r270523
Diffstat (limited to 'libphobos/libdruntime')
-rw-r--r--libphobos/libdruntime/gcc/sections/elf_shared.d13
1 files changed, 12 insertions, 1 deletions
diff --git a/libphobos/libdruntime/gcc/sections/elf_shared.d b/libphobos/libdruntime/gcc/sections/elf_shared.d
index 89adcea889e..d92e4cd9c4e 100644
--- a/libphobos/libdruntime/gcc/sections/elf_shared.d
+++ b/libphobos/libdruntime/gcc/sections/elf_shared.d
@@ -77,6 +77,7 @@ else
static assert(0, "unimplemented");
}
import core.sys.posix.pthread;
+import gcc.builtins;
import gcc.config;
import rt.deh;
import rt.dmain2;
@@ -992,6 +993,7 @@ struct tls_index
}
extern(C) void* __tls_get_addr(tls_index* ti) nothrow @nogc;
+extern(C) void* __tls_get_addr_internal(tls_index* ti) nothrow @nogc;
/* The dynamic thread vector (DTV) pointers may point 0x8000 past the start of
* each TLS block. This is at least true for PowerPC and Mips platforms.
@@ -1025,6 +1027,8 @@ else version (MIPS32)
enum TLS_DTV_OFFSET = 0x8000;
else version (MIPS64)
enum TLS_DTV_OFFSET = 0x8000;
+else version (SystemZ)
+ enum TLS_DTV_OFFSET = 0x0;
else
static assert( false, "Platform not supported." );
@@ -1041,5 +1045,12 @@ void[] getTLSRange(size_t mod, size_t sz) nothrow @nogc
// base offset
auto ti = tls_index(mod, 0);
- return (__tls_get_addr(&ti)-TLS_DTV_OFFSET)[0 .. sz];
+ version (SystemZ)
+ {
+ 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];
}