aboutsummaryrefslogtreecommitdiff
path: root/libphobos
diff options
context:
space:
mode:
authorliushuyu <liushuyu011@gmail.com>2023-12-18 09:52:07 +0800
committerLulu Cheng <chenglulu@loongson.cn>2023-12-18 10:04:10 +0800
commit00d7c37df2e665d012e73a9d23ed02582ff93c81 (patch)
tree633ac4aa2e6021fd4ec3cc61dcaed38b7b20b2d6 /libphobos
parent73aeec31c5ef15b5a3877370353164a2a6aaa8a6 (diff)
downloadgcc-00d7c37df2e665d012e73a9d23ed02582ff93c81.zip
gcc-00d7c37df2e665d012e73a9d23ed02582ff93c81.tar.gz
gcc-00d7c37df2e665d012e73a9d23ed02582ff93c81.tar.bz2
LoongArch: Add support for D frontend.
gcc/ChangeLog: * config.gcc: Add loongarch-d.o to d_target_objs for LoongArch architecture. * config/loongarch/t-loongarch: Add object target for loongarch-d.cc. * config/loongarch/loongarch-d.cc (loongarch_d_target_versions): add interface function to define builtin D versions for LoongArch architecture. (loongarch_d_handle_target_float_abi): add interface function to define builtin D traits for LoongArch architecture. (loongarch_d_register_target_info): add interface function to register loongarch_d_handle_target_float_abi function. * config/loongarch/loongarch-d.h (loongarch_d_target_versions): add function prototype. (loongarch_d_register_target_info): Likewise. libphobos/ChangeLog: * configure.tgt: Enable libphobos for LoongArch architecture. * libdruntime/gcc/sections/elf.d: Add TLS_DTV_OFFSET constant for LoongArch64. * libdruntime/gcc/unwind/generic.d: Add __aligned__ constant for LoongArch64.
Diffstat (limited to 'libphobos')
-rw-r--r--libphobos/configure.tgt3
-rw-r--r--libphobos/libdruntime/gcc/sections/elf.d2
-rw-r--r--libphobos/libdruntime/gcc/unwind/generic.d1
3 files changed, 6 insertions, 0 deletions
diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt
index 1f21f63..297852f 100644
--- a/libphobos/configure.tgt
+++ b/libphobos/configure.tgt
@@ -36,6 +36,9 @@ case "${target}" in
hppa-*-linux*)
LIBPHOBOS_SUPPORTED=yes
;;
+ loongarch*-*-linux*)
+ LIBPHOBOS_SUPPORTED=yes
+ ;;
mips*-*-linux*)
LIBPHOBOS_SUPPORTED=yes
;;
diff --git a/libphobos/libdruntime/gcc/sections/elf.d b/libphobos/libdruntime/gcc/sections/elf.d
index 5376957..d1316b2 100644
--- a/libphobos/libdruntime/gcc/sections/elf.d
+++ b/libphobos/libdruntime/gcc/sections/elf.d
@@ -1061,6 +1061,8 @@ else version (MIPS64)
enum TLS_DTV_OFFSET = 0x8000;
else version (IBMZ_Any)
enum TLS_DTV_OFFSET = 0x0;
+else version (LoongArch64)
+ enum TLS_DTV_OFFSET = 0x0;
else
static assert( false, "Platform not supported." );
diff --git a/libphobos/libdruntime/gcc/unwind/generic.d b/libphobos/libdruntime/gcc/unwind/generic.d
index e4bbb4b..2e74b63 100644
--- a/libphobos/libdruntime/gcc/unwind/generic.d
+++ b/libphobos/libdruntime/gcc/unwind/generic.d
@@ -141,6 +141,7 @@ else version (SPARC64) private enum __aligned__ = 16;
else version (SystemZ) private enum __aligned__ = 8;
else version (X86) private enum __aligned__ = 16;
else version (X86_64) private enum __aligned__ = 16;
+else version (LoongArch64) private enum __aligned__ = 16;
else static assert( false, "Platform not supported.");
align(__aligned__) struct _Unwind_Exception