diff --git a/compiler/src/dmd/cond.d b/compiler/src/dmd/cond.d index 76cef77d8eda..f5d7c5e1009b 100644 --- a/compiler/src/dmd/cond.d +++ b/compiler/src/dmd/cond.d @@ -691,6 +691,9 @@ extern (C++) final class VersionCondition : DVCondition case "LDC": case "linux": case "LittleEndian": + case "LoongArch64": + case "LoongArch_HardFloat": + case "LoongArch_SoftFloat": case "MinGW": case "MIPS32": case "MIPS64": diff --git a/druntime/src/core/stdc/errno.d b/druntime/src/core/stdc/errno.d index c992a5ff0de1..e503dd96195c 100644 --- a/druntime/src/core/stdc/errno.d +++ b/druntime/src/core/stdc/errno.d @@ -1117,6 +1117,109 @@ else version (linux) enum ERFKILL = 132; /// enum EHWPOISON = 133; /// } + else version (LoongArch64) + { + enum EDEADLK = 35; /// + enum ENAMETOOLONG = 36; /// + enum ENOLCK = 37; /// + enum ENOSYS = 38; /// + enum ENOTEMPTY = 39; /// + enum ELOOP = 40; /// + enum EWOULDBLOCK = EAGAIN; /// + enum ENOMSG = 42; /// + enum EIDRM = 43; /// + enum ECHRNG = 44; /// + enum EL2NSYNC = 45; /// + enum EL3HLT = 46; /// + enum EL3RST = 47; /// + enum ELNRNG = 48; /// + enum EUNATCH = 49; /// + enum ENOCSI = 50; /// + enum EL2HLT = 51; /// + enum EBADE = 52; /// + enum EBADR = 53; /// + enum EXFULL = 54; /// + enum ENOANO = 55; /// + enum EBADRQC = 56; /// + enum EBADSLT = 57; /// + enum EDEADLOCK = EDEADLK; /// + enum EBFONT = 59; /// + enum ENOSTR = 60; /// + enum ENODATA = 61; /// + enum ETIME = 62; /// + enum ENOSR = 63; /// + enum ENONET = 64; /// + enum ENOPKG = 65; /// + enum EREMOTE = 66; /// + enum ENOLINK = 67; /// + enum EADV = 68; /// + enum ESRMNT = 69; /// + enum ECOMM = 70; /// + enum EPROTO = 71; /// + enum EMULTIHOP = 72; /// + enum EDOTDOT = 73; /// + enum EBADMSG = 74; /// + enum EOVERFLOW = 75; /// + enum ENOTUNIQ = 76; /// + enum EBADFD = 77; /// + enum EREMCHG = 78; /// + enum ELIBACC = 79; /// + enum ELIBBAD = 80; /// + enum ELIBSCN = 81; /// + enum ELIBMAX = 82; /// + enum ELIBEXEC = 83; /// + enum EILSEQ = 84; /// + enum ERESTART = 85; /// + enum ESTRPIPE = 86; /// + enum EUSERS = 87; /// + enum ENOTSOCK = 88; /// + enum EDESTADDRREQ = 89; /// + enum EMSGSIZE = 90; /// + enum EPROTOTYPE = 91; /// + enum ENOPROTOOPT = 92; /// + enum EPROTONOSUPPORT = 93; /// + enum ESOCKTNOSUPPORT = 94; /// + enum EOPNOTSUPP = 95; /// + enum ENOTSUP = EOPNOTSUPP; /// + enum EPFNOSUPPORT = 96; /// + enum EAFNOSUPPORT = 97; /// + enum EADDRINUSE = 98; /// + enum EADDRNOTAVAIL = 99; /// + enum ENETDOWN = 100; /// + enum ENETUNREACH = 101; /// + enum ENETRESET = 102; /// + enum ECONNABORTED = 103; /// + enum ECONNRESET = 104; /// + enum ENOBUFS = 105; /// + enum EISCONN = 106; /// + enum ENOTCONN = 107; /// + enum ESHUTDOWN = 108; /// + enum ETOOMANYREFS = 109; /// + enum ETIMEDOUT = 110; /// + enum ECONNREFUSED = 111; /// + enum EHOSTDOWN = 112; /// + enum EHOSTUNREACH = 113; /// + enum EALREADY = 114; /// + enum EINPROGRESS = 115; /// + enum ESTALE = 116; /// + enum EUCLEAN = 117; /// + enum ENOTNAM = 118; /// + enum ENAVAIL = 119; /// + enum EISNAM = 120; /// + enum EREMOTEIO = 121; /// + enum EDQUOT = 122; /// + enum ENOMEDIUM = 123; /// + enum EMEDIUMTYPE = 124; /// + enum ECANCELED = 125; /// + enum ENOKEY = 126; /// + enum EKEYEXPIRED = 127; /// + enum EKEYREVOKED = 128; /// + enum EKEYREJECTED = 129; /// + enum EOWNERDEAD = 130; /// + enum ENOTRECOVERABLE = 131; /// + enum ERFKILL = 132; /// + enum EHWPOISON = 133; /// + } else { static assert(false, "Architecture not supported."); diff --git a/druntime/src/core/stdc/fenv.d b/druntime/src/core/stdc/fenv.d index dbe7daa77911..288f9c25dc69 100644 --- a/druntime/src/core/stdc/fenv.d +++ b/druntime/src/core/stdc/fenv.d @@ -166,6 +166,15 @@ version (GNUFP) alias fexcept_t = uint; } + else version (LoongArch64) + { + struct fenv_t + { + uint __fp_control_register; + } + + alias fexcept_t = uint; + } else { static assert(0, "Unimplemented architecture"); @@ -786,6 +795,28 @@ else FE_TOWARDZERO = 0x1, /// } } + else version (LoongArch64) + { + // Define bits representing exceptions in the FPSR status word. + enum + { + FE_INEXACT = 0x010000, /// + FE_UNDERFLOW = 0x020000, /// + FE_OVERFLOW = 0x040000, /// + FE_DIVBYZERO = 0x080000, /// + FE_INVALID = 0x100000, /// + FE_ALL_EXCEPT = 0x1f0000, /// + } + + // Define bits representing rounding modes in the FPCR Rmode field. + enum + { + FE_TONEAREST = 0x000, /// + FE_TOWARDZERO = 0x100, /// + FE_DOWNWARD = 0x200, /// + FE_UPWARD = 0x300, /// + } + } else { static assert(0, "Unimplemented architecture"); diff --git a/druntime/src/core/stdc/math.d b/druntime/src/core/stdc/math.d index 76b32b44de1f..c5eaf79a8273 100644 --- a/druntime/src/core/stdc/math.d +++ b/druntime/src/core/stdc/math.d @@ -190,6 +190,13 @@ else version (CRuntime_Glibc) /// enum int FP_ILOGBNAN = int.max; } + else version (LoongArch64) + { + /// + enum int FP_ILOGB0 = -int.max; + /// + enum int FP_ILOGBNAN = int.max; + } else { static assert(false, "Architecture not supported."); diff --git a/druntime/src/core/sys/linux/dlfcn.d b/druntime/src/core/sys/linux/dlfcn.d index a13bae76631a..9d86d8915556 100644 --- a/druntime/src/core/sys/linux/dlfcn.d +++ b/druntime/src/core/sys/linux/dlfcn.d @@ -142,6 +142,20 @@ else version (IBMZ_Any) void _dl_mcount_wrapper_check(void* __selfpc); } } +else version (LoongArch64) +{ + // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h + static if (_GNU_SOURCE) + { + RT DL_CALL_FCT(RT, Args...)(RT function(Args) fctp, auto ref Args args) + { + _dl_mcount_wrapper_check(cast(void*)fctp); + return fctp(args); + } + + void _dl_mcount_wrapper_check(void* __selfpc); + } +} else static assert(0, "unimplemented"); diff --git a/druntime/src/core/sys/linux/epoll.d b/druntime/src/core/sys/linux/epoll.d index 99099b52417e..55b4f5e7fd6d 100644 --- a/druntime/src/core/sys/linux/epoll.d +++ b/druntime/src/core/sys/linux/epoll.d @@ -132,6 +132,14 @@ else version (IBMZ_Any) epoll_data_t data; } } +else version (LoongArch64) +{ + struct epoll_event + { + uint events; + epoll_data_t data; + } +} else { static assert(false, "Platform not supported"); diff --git a/druntime/src/core/sys/linux/link.d b/druntime/src/core/sys/linux/link.d index 4d7eb1eb7d39..ebb5771f705d 100644 --- a/druntime/src/core/sys/linux/link.d +++ b/druntime/src/core/sys/linux/link.d @@ -90,6 +90,12 @@ else version (IBMZ_Any) else alias uint32_t Elf_Symndx; } +else version (LoongArch64) +{ + // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/elfclass.h + alias __WORDSIZE __ELF_NATIVE_CLASS; + alias uint32_t Elf_Symndx; +} else static assert(0, "unimplemented"); // diff --git a/druntime/src/core/sys/linux/perf_event.d b/druntime/src/core/sys/linux/perf_event.d index b9993a784133..e0a0c99514cb 100644 --- a/druntime/src/core/sys/linux/perf_event.d +++ b/druntime/src/core/sys/linux/perf_event.d @@ -76,6 +76,10 @@ else version (SPARC_Any) { enum __NR_perf_event_open = 327; } +else version (LoongArch64) +{ + enum __NR_perf_event_open = 241; +} else { static assert(0, "Architecture not supported"); diff --git a/druntime/src/core/sys/linux/sys/eventfd.d b/druntime/src/core/sys/linux/sys/eventfd.d index a35d71479d86..bb2d1371faa6 100644 --- a/druntime/src/core/sys/linux/sys/eventfd.d +++ b/druntime/src/core/sys/linux/sys/eventfd.d @@ -111,5 +111,11 @@ else version (IBMZ_Any) enum EFD_CLOEXEC = 0x80000; // octal!2000000 enum EFD_NONBLOCK = 0x800; // octal!4000 } +else version (LoongArch64) +{ + enum EFD_SEMAPHORE = 1; + enum EFD_CLOEXEC = 0x80000; // octal!2000000 + enum EFD_NONBLOCK = 0x800; // octal!4000 +} else static assert(0, "unimplemented"); diff --git a/druntime/src/core/sys/linux/sys/inotify.d b/druntime/src/core/sys/linux/sys/inotify.d index c74aaa6e7e24..727471e45552 100644 --- a/druntime/src/core/sys/linux/sys/inotify.d +++ b/druntime/src/core/sys/linux/sys/inotify.d @@ -123,6 +123,11 @@ else version (IBMZ_Any) enum IN_CLOEXEC = 0x80000; // octal!2000000 enum IN_NONBLOCK = 0x800; // octal!4000 } +else version (LoongArch64) +{ + enum IN_CLOEXEC = 0x80000; // octal!2000000 + enum IN_NONBLOCK = 0x800; // octal!4000 +} else static assert(0, "unimplemented"); diff --git a/druntime/src/core/sys/linux/sys/mman.d b/druntime/src/core/sys/linux/sys/mman.d index 43a1aec1f946..7ed78ef64364 100644 --- a/druntime/src/core/sys/linux/sys/mman.d +++ b/druntime/src/core/sys/linux/sys/mman.d @@ -432,6 +432,30 @@ else version (MIPS_Any) MAP_HUGETLB = 0x80000, } } +else version (LoongArch64) +{ + static if (_DEFAULT_SOURCE) enum + { + MAP_GROWSDOWN = 0x00100, + MAP_DENYWRITE = 0x00800, + MAP_EXECUTABLE = 0x01000, + MAP_LOCKED = 0x02000, + MAP_NORESERVE = 0x04000, + MAP_POPULATE = 0x08000, + MAP_NONBLOCK = 0x10000, + MAP_STACK = 0x20000, + MAP_HUGETLB = 0x40000, + MAP_SYNC = 0x80000, + MAP_FIXED_NOREPLACE = 0x100000, + } + + // in core.sys.posix.sys.mman + // enum + // { + // MCL_CURRENT = 0x1, + // MCL_FUTURE = 0x2, + // } +} else { static assert(0, "unimplemented"); diff --git a/druntime/src/core/sys/posix/dlfcn.d b/druntime/src/core/sys/posix/dlfcn.d index f4bd2d8ba92f..f457c1f22b77 100644 --- a/druntime/src/core/sys/posix/dlfcn.d +++ b/druntime/src/core/sys/posix/dlfcn.d @@ -160,6 +160,18 @@ version (CRuntime_Glibc) enum RTLD_LOCAL = 0; enum RTLD_NODELETE = 0x01000; } + else version (LoongArch64) + { + // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h + enum RTLD_LAZY = 0x00001; + enum RTLD_NOW = 0x00002; + enum RTLD_BINDING_MASK = 0x3; + enum RTLD_NOLOAD = 0x00004; + enum RTLD_DEEPBIND = 0x00008; + enum RTLD_GLOBAL = 0x00100; + enum RTLD_LOCAL = 0; + enum RTLD_NODELETE = 0x01000; + } else static assert(0, "unimplemented"); diff --git a/druntime/src/core/sys/posix/fcntl.d b/druntime/src/core/sys/posix/fcntl.d index df66b27f723b..c0e9006a0438 100644 --- a/druntime/src/core/sys/posix/fcntl.d +++ b/druntime/src/core/sys/posix/fcntl.d @@ -156,7 +156,13 @@ version (linux) enum F_SETLKW = 7; } } - else + else version (LoongArch64) + { + static assert(off_t.sizeof == 8); + enum F_GETLK = 5; + enum F_SETLK = 6; + enum F_SETLKW = 7; + } else static if ( __USE_FILE_OFFSET64 ) { enum F_GETLK = 12; @@ -391,6 +397,33 @@ version (linux) enum O_PATH = 0x200000; // octal 010000000 enum O_NDELAY = O_NONBLOCK; } + else version (LoongArch64) + { + enum O_CREAT = 0x40; // octal 0100 + enum O_EXCL = 0x80; // octal 0200 + enum O_NOCTTY = 0x100; // octal 0400 + enum O_TRUNC = 0x200; // octal 01000 + + enum O_APPEND = 0x400; // octal 02000 + enum O_NONBLOCK = 0x800; // octal 04000 + enum O_CLOEXEC = 0x80000; // octal 02000000 + enum O_SYNC = 0x101000; // octal 04010000 + enum O_DSYNC = 0x1000; // octal 010000 + enum O_RSYNC = O_SYNC; + + enum O_DIRECTORY = 0x010000; // octal 200000 + enum O_NOFOLLOW = 0x020000; // octal 400000 + enum O_DIRECT = 0x004000; // octal 040000 + version (D_LP64) + enum O_LARGEFILE = 0; + else + enum O_LARGEFILE = 0x8000; // octal 0100000 + enum O_TMPFILE = 0x404000; // octal 020040000 + enum O_ASYNC = 0x2000; // octal 020000 + enum O_NOATIME = 0x40000; // octal 01000000 + enum O_PATH = 0x200000; // octal 010000000 + enum O_NDELAY = O_NONBLOCK; + } else static assert(0, "unimplemented"); diff --git a/druntime/src/core/sys/posix/setjmp.d b/druntime/src/core/sys/posix/setjmp.d index 0d43c61389be..cd378ce03a74 100644 --- a/druntime/src/core/sys/posix/setjmp.d +++ b/druntime/src/core/sys/posix/setjmp.d @@ -174,6 +174,21 @@ version (CRuntime_Glibc) } alias __jmp_buf = __s390_jmp_buf[1]; } + else version (LoongArch64) + { + struct __loongarch_jmp_buf + { + long __pc; + long __sp; + // reserved + long __r21; + long __fp; + long[9] __regs; + static if (__traits(getTargetInfo, "floatAbi") != "soft_float") + double[8] __fpregs; + } + alias __jmp_buf = __loongarch_jmp_buf[1]; + } else static assert(0, "unimplemented"); diff --git a/druntime/src/core/sys/posix/signal.d b/druntime/src/core/sys/posix/signal.d index a2e229f60185..a8b7f7511a92 100644 --- a/druntime/src/core/sys/posix/signal.d +++ b/druntime/src/core/sys/posix/signal.d @@ -390,6 +390,30 @@ version (linux) enum SIGUSR2 = 12; enum SIGURG = 23; } + else version (LoongArch64) + { + //SIGABRT (defined in core.stdc.signal) + enum SIGALRM = 14; + enum SIGBUS = 7; + enum SIGCHLD = 17; + enum SIGCONT = 18; + //SIGFPE (defined in core.stdc.signal) + enum SIGHUP = 1; + //SIGILL (defined in core.stdc.signal) + //SIGINT (defined in core.stdc.signal) + enum SIGKILL = 9; + enum SIGPIPE = 13; + enum SIGQUIT = 3; + //SIGSEGV (defined in core.stdc.signal) + enum SIGSTOP = 19; + //SIGTERM (defined in core.stdc.signal) + enum SIGTSTP = 20; + enum SIGTTIN = 21; + enum SIGTTOU = 22; + enum SIGUSR1 = 10; + enum SIGUSR2 = 12; + enum SIGURG = 23; + } else static assert(0, "unimplemented"); } @@ -1750,6 +1774,16 @@ version (linux) enum SIGXCPU = 24; enum SIGXFSZ = 25; } + else version (LoongArch64) + { + enum SIGPOLL = 29; + enum SIGPROF = 27; + enum SIGSYS = 31; + enum SIGTRAP = 5; + enum SIGVTALRM = 26; + enum SIGXCPU = 24; + enum SIGXFSZ = 25; + } else static assert(0, "unimplemented"); diff --git a/druntime/src/core/sys/posix/sys/mman.d b/druntime/src/core/sys/posix/sys/mman.d index 0d3d517d69a5..b1eb9fa81073 100644 --- a/druntime/src/core/sys/posix/sys/mman.d +++ b/druntime/src/core/sys/posix/sys/mman.d @@ -382,6 +382,8 @@ version (linux) private enum DEFAULTS = true; else version (PPC_Any) private enum DEFAULTS = true; + else version (LoongArch64) + private enum DEFAULTS = true; else static assert(0, "unimplemented"); diff --git a/druntime/src/core/sys/posix/sys/msg.d b/druntime/src/core/sys/posix/sys/msg.d index 208e5c2dd47f..19e07bd64680 100644 --- a/druntime/src/core/sys/posix/sys/msg.d +++ b/druntime/src/core/sys/posix/sys/msg.d @@ -56,6 +56,7 @@ version (linux) version (IA64) version = GENERICMSQ; version (IBMZ_Any) version = GENERICMSQ; version (RISCV_Any) version = GENERICMSQ; + version (LoongArch64) version = GENERICMSQ; version (GENERICMSQ) { diff --git a/druntime/src/core/sys/posix/sys/socket.d b/druntime/src/core/sys/posix/sys/socket.d index 340f3ce93bb1..7c6fab6315a4 100644 --- a/druntime/src/core/sys/posix/sys/socket.d +++ b/druntime/src/core/sys/posix/sys/socket.d @@ -528,6 +528,40 @@ version (linux) SO_TYPE = 3 } } + else version (LoongArch64) + { + enum + { + SOCK_DGRAM = 2, + SOCK_SEQPACKET = 5, + SOCK_STREAM = 1 + } + + enum + { + SOL_SOCKET = 1 + } + + enum + { + SO_ACCEPTCONN = 30, + SO_BROADCAST = 6, + SO_DEBUG = 1, + SO_DONTROUTE = 5, + SO_ERROR = 4, + SO_KEEPALIVE = 9, + SO_LINGER = 13, + SO_OOBINLINE = 10, + SO_RCVBUF = 8, + SO_RCVLOWAT = 18, + SO_RCVTIMEO = 20, + SO_REUSEADDR = 2, + SO_SNDBUF = 7, + SO_SNDLOWAT = 19, + SO_SNDTIMEO = 21, + SO_TYPE = 3 + } + } else static assert(0, "unimplemented"); diff --git a/druntime/src/core/sys/posix/sys/stat.d b/druntime/src/core/sys/posix/sys/stat.d index ee9e5da2feb5..b89478fe7d75 100644 --- a/druntime/src/core/sys/posix/sys/stat.d +++ b/druntime/src/core/sys/posix/sys/stat.d @@ -966,6 +966,66 @@ version (linux) else static assert(stat_t.sizeof == 144); } + else version (LoongArch64) + { + private + { + alias __dev_t = ulong; + alias __ino_t = c_ulong; + alias __ino64_t = ulong; + alias __mode_t = uint; + alias __nlink_t = uint; + alias __uid_t = uint; + alias __gid_t = uint; + alias __off_t = c_long; + alias __off64_t = long; + alias __blksize_t = int; + alias __blkcnt_t = c_long; + alias __blkcnt64_t = long; + alias __timespec = timespec; + alias __time_t = time_t; + } + struct stat_t + { + __dev_t st_dev; + __ino_t st_ino; + __mode_t st_mode; + __nlink_t st_nlink; + __uid_t st_uid; + __gid_t st_gid; + __dev_t st_rdev; + __dev_t __pad1; + // la64 always uses 64-bit file offsets + __off64_t st_size; + __blksize_t st_blksize; + int __pad2; + // la64 always uses 64-bit block counts + __blkcnt64_t st_blocks; + static if (_XOPEN_SOURCE >= 700) + { + __timespec st_atim; + __timespec st_mtim; + __timespec st_ctim; + extern(D) @safe @property inout pure nothrow + { + ref inout(time_t) st_atime() return { return st_atim.tv_sec; } + ref inout(time_t) st_mtime() return { return st_mtim.tv_sec; } + ref inout(time_t) st_ctime() return { return st_ctim.tv_sec; } + } + } + else + { + __time_t st_atime; + c_ulong st_atimensec; + __time_t st_mtime; + c_ulong st_mtimensec; + __time_t st_ctime; + c_ulong st_ctimensec; + } + int[2] __glibc_reserved; + } + static assert(stat_t.sizeof == 128); + } else static assert(0, "unimplemented"); diff --git a/druntime/src/core/sys/posix/sys/types.d b/druntime/src/core/sys/posix/sys/types.d index cd11b0d30923..f0ce29f39254 100644 --- a/druntime/src/core/sys/posix/sys/types.d +++ b/druntime/src/core/sys/posix/sys/types.d @@ -620,6 +620,18 @@ version (CRuntime_Glibc) enum __SIZEOF_PTHREAD_BARRIER_T = 32; enum __SIZEOF_PTHREAD_BARRIERATTR_T = 4; } + else version (LoongArch64) + { + enum __SIZEOF_PTHREAD_ATTR_T = 56; + enum __SIZEOF_PTHREAD_MUTEX_T = 40; + enum __SIZEOF_PTHREAD_MUTEXATTR_T = 4; + enum __SIZEOF_PTHREAD_COND_T = 48; + enum __SIZEOF_PTHREAD_CONDATTR_T = 4; + enum __SIZEOF_PTHREAD_RWLOCK_T = 56; + enum __SIZEOF_PTHREAD_RWLOCKATTR_T = 8; + enum __SIZEOF_PTHREAD_BARRIER_T = 32; + enum __SIZEOF_PTHREAD_BARRIERATTR_T = 4; + } else { static assert (false, "Unsupported platform"); diff --git a/druntime/src/core/sys/posix/ucontext.d b/druntime/src/core/sys/posix/ucontext.d index 512d7301e9bb..ce2166307531 100644 --- a/druntime/src/core/sys/posix/ucontext.d +++ b/druntime/src/core/sys/posix/ucontext.d @@ -785,6 +785,33 @@ version (linux) alias ucontext_t = ucontext; } + else version (LoongArch64) + { + private + { + enum LARCH_NGREG = 32; + + alias ulong greg_t; + alias greg_t[LARCH_NGREG] gregset_t; + } + + struct mcontext_t + { + c_ulong __pc; + c_ulong[32] __gregs; + int __flags; + align(16) c_ulong[0] __extcontext; + } + + struct ucontext_t + { + c_ulong __uc_flags; + ucontext_t* uc_link; + stack_t uc_stack; + sigset_t uc_sigmask; + mcontext_t uc_mcontext; + } + } else static assert(0, "unimplemented"); } diff --git a/druntime/src/rt/dwarfeh.d b/druntime/src/rt/dwarfeh.d index 05900ec3aeef..c3a79ad8a52b 100644 --- a/druntime/src/rt/dwarfeh.d +++ b/druntime/src/rt/dwarfeh.d @@ -83,6 +83,11 @@ else version (RISCV32) enum eh_exception_regno = 10; enum eh_selector_regno = 11; } +else version (LoongArch64) +{ + enum eh_exception_regno = 4; + enum eh_selector_regno = 5; +} else { static assert(0, "Unknown EH register numbers for this architecture"); diff --git a/druntime/src/rt/sections_elf_shared.d b/druntime/src/rt/sections_elf_shared.d index 080d58acea9d..5ef467efb281 100644 --- a/druntime/src/rt/sections_elf_shared.d +++ b/druntime/src/rt/sections_elf_shared.d @@ -906,6 +906,8 @@ else version (PPC64) enum TLS_DTV_OFFSET = 0x8000; else version (MIPS_Any) enum TLS_DTV_OFFSET = 0x8000; +else version (LoongArch64) + enum TLS_DTV_OFFSET = 0x0; else static assert( false, "Platform not supported." );