--- a/libphobos/libdruntime/core/sys/posix/sys/stat.d
+++ b/libphobos/libdruntime/core/sys/posix/sys/stat.d
@@ -67,6 +67,39 @@ version (linux)
 {
     version (X86)
     {
+      version (CRuntime_Musl)
+      {
+        struct stat_t
+        {
+            dev_t       st_dev;
+            int         __st_dev_pad;
+            c_long      __st_ino;
+            mode_t      st_mode;
+            nlink_t     st_nlink;
+            uid_t       st_uid;
+            gid_t       st_gid;
+            dev_t       st_rdev;
+            int         __st_rdev_pad;
+            off_t       st_size;
+            blksize_t   st_blksize;
+            blkcnt_t    st_blocks;
+            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; }
+            }
+            ino_t       st_ino;
+        }
+        version (CRuntime_Musl_Pre_Time64) {
+            static assert(stat_t.sizeof == 96);
+        } else {
+            static assert(stat_t.sizeof == 120);
+        }
+      } else {
         struct stat_t
         {
             dev_t       st_dev;
@@ -119,6 +152,7 @@ version (linux)
                 c_ulong     __unused5;
             }
         }
+      }
     }
     else version (X86_64)
     {
@@ -256,6 +290,39 @@ version (linux)
     }
     else version (MIPS_O32)
     {
+      version (CRuntime_Musl) {
+        struct stat_t
+        {
+            dev_t       st_dev;
+            c_long[2]   __st_pad1;
+            ino_t       st_ino;
+            mode_t      st_mode;
+            nlink_t     st_nlink;
+            uid_t       st_uid;
+            gid_t       st_gid;
+            dev_t       st_rdev;
+            c_long[2]   __st_pad2;
+            off_t       st_size;
+            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; }
+            }
+            blksize_t   st_blksize;
+            c_long      __st_pad3;
+            blkcnt_t    st_blocks;
+            c_long[14]  __st_pad4;
+        }
+        version (CRuntime_Musl_Pre_Time64) {
+            static assert(stat_t.sizeof == 160);
+        } else {
+            static assert(stat_t.sizeof == 188);
+        }
+      } else {
         struct stat_t
         {
             c_ulong     st_dev;
@@ -314,6 +381,7 @@ version (linux)
             static assert(stat_t.sizeof == 144);
         else
             static assert(stat_t.sizeof == 160);
+      }
     }
     else version (MIPS64)
     {
@@ -385,6 +453,37 @@ version (linux)
     }
     else version (PPC)
     {
+      version (CRuntime_Musl) {
+        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;
+            ushort      __st_rdev_pad;
+            off_t       st_size;
+            blksize_t   st_blksize;
+            blkcnt_t    st_blocks;
+            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; }
+            }
+            uint[2]     __unused;
+        }
+        version (CRuntime_Musl_Pre_Time64) {
+            static assert(stat_t.sizeof == 104);
+        } else {
+            static assert(stat_t.sizeof == 128);
+        }
+      } else {
         struct stat_t
         {
             dev_t       st_dev;
@@ -432,6 +531,7 @@ version (linux)
             static assert(stat_t.sizeof == 104);
         else
             static assert(stat_t.sizeof == 88);
+      }
     }
     else version (PPC64)
     {
@@ -559,6 +659,39 @@ version (linux)
     }
     else version (ARM)
     {
+      version (CRuntime_Musl)
+      {
+        struct stat_t
+        {
+            dev_t       st_dev;
+            int         __st_dev_pad;
+            c_long      __st_ino;
+            mode_t      st_mode;
+            nlink_t     st_nlink;
+            uid_t       st_uid;
+            gid_t       st_gid;
+            dev_t       st_rdev;
+            int         __st_rdev_pad;
+            off_t       st_size;
+            blksize_t   st_blksize;
+            blkcnt_t    st_blocks;
+            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; }
+            }
+            ino_t       st_ino;
+        }
+        version (CRuntime_Musl_Pre_Time64) {
+            static assert(stat_t.sizeof == 104);
+        } else {
+            static assert(stat_t.sizeof == 128);
+        }
+      } else {
         private
         {
             alias __dev_t = ulong;
@@ -651,6 +784,7 @@ version (linux)
             static assert(stat_t.sizeof == 104);
         else
             static assert(stat_t.sizeof == 88);
+      }
     }
     else version (AArch64)
     {
