diff options
Diffstat (limited to 'libphobos')
-rw-r--r-- | libphobos/ChangeLog | 10 | ||||
-rw-r--r-- | libphobos/configure.tgt | 3 | ||||
-rw-r--r-- | libphobos/libdruntime/gcc/sections/elf_shared.d | 13 | ||||
-rw-r--r-- | libphobos/testsuite/libphobos.typeinfo/struct-align.d | 13 |
4 files changed, 38 insertions, 1 deletions
diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog index 1f5ea28..e7d3319 100644 --- a/libphobos/ChangeLog +++ b/libphobos/ChangeLog @@ -1,4 +1,14 @@ 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. + +2019-04-23 Iain Buclaw <ibuclaw@gdcproject.org> * configure.tgt: Add linux/riscv as supported target. * libdruntime/gcc/sections/elf_shared.d (getDependencies): Adjust diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt index 5deba2a..a53a3c3 100644 --- a/libphobos/configure.tgt +++ b/libphobos/configure.tgt @@ -32,6 +32,9 @@ case "${target}" in riscv*-*-linux*) LIBPHOBOS_SUPPORTED=yes ;; + s390*-linux*) + LIBPHOBOS_SUPPORTED=yes + ;; x86_64-*-kfreebsd*-gnu | i?86-*-kfreebsd*-gnu) LIBPHOBOS_SUPPORTED=yes ;; diff --git a/libphobos/libdruntime/gcc/sections/elf_shared.d b/libphobos/libdruntime/gcc/sections/elf_shared.d index 89adcea..d92e4cd 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]; } diff --git a/libphobos/testsuite/libphobos.typeinfo/struct-align.d b/libphobos/testsuite/libphobos.typeinfo/struct-align.d new file mode 100644 index 0000000..7286651 --- /dev/null +++ b/libphobos/testsuite/libphobos.typeinfo/struct-align.d @@ -0,0 +1,13 @@ +module structalign; + +void main () +{ + struct K { int *a; }; + K k; + auto ti = typeid (k); + + assert (ti.flags () == 1); + + auto ti2 = typeid (k.a); + assert (ti.talign () == ti2.talign ()); +} |