Excerpts from Iain Sandoe's message of Januar 14, 2025 9:10 pm:
> Tested on x86_64, i686 darwin17 and aarch64 darwin21,
> OK for trunk, or alternate solution?
> thanks,
> Iain
> 

Thank Iain,

Could a pull request be made upstream here?

https://github.com/dlang/dmd/pulls

Location of this module is

https://github.com/dlang/dmd/blob/master/druntime/src/core/thread/osthread.d

> --- 8< ---
> --- a/libphobos/libdruntime/core/thread/osthread.d
> +++ b/libphobos/libdruntime/core/thread/osthread.d
> @@ -81,6 +81,13 @@ else version (PPC)
>          version = AsmExternal;
>      }
>  }
> +else version (PPC64)
> +{
> +    version (Posix)
> +    {
> +        version = AsmExternal;
> +    }
> +}
>  else version (MIPS_O32)
>  {
>      version (Posix)

On reviewing this section, I'm not sure why this entire block for 
defining the AsmExternal version is here in the first place - ucontext 
is not used anywhere throughout the module.

I'd elect to just remove it all.

Everything else looks OK to me.

```
--- a/libphobos/libdruntime/core/thread/osthread.d
+++ b/libphobos/libdruntime/core/thread/osthread.d
@@ -59,67 +59,6 @@ else version (D_InlineAsm_X86_64)
         version = AsmX86_64_Posix;
     }
 }
-else version (X86)
-{
-    version (CET) {} else
-    {
-        version = AsmExternal;
-    }
-}
-else version (X86_64)
-{
-    version (CET)   {} else
-    version (D_X32) {} else
-    {
-        version = AsmExternal;
-    }
-}
-else version (PPC)
-{
-    version (Posix)
-    {
-        version = AsmExternal;
-    }
-}
-else version (MIPS_O32)
-{
-    version (Posix)
-    {
-        version = AsmExternal;
-    }
-}
-else version (AArch64)
-{
-    version (Posix)
-    {
-        version = AsmExternal;
-    }
-}
-else version (ARM)
-{
-    version (Posix)
-    {
-        version = AsmExternal;
-    }
-}
-
-version (Posix)
-{
-    version (AsmX86_Windows)    {} else
-    version (AsmX86_Posix)      {} else
-    version (AsmX86_64_Windows) {} else
-    version (AsmX86_64_Posix)   {} else
-    version (AsmExternal)       {} else
-    {
-        // NOTE: The ucontext implementation requires architecture specific
-        //       data definitions to operate so testing for it must be done
-        //       by checking for the existence of ucontext_t rather than by
-        //       a version identifier.  Please note that this is considered
-        //       an obsolescent feature according to the POSIX spec, so a
-        //       custom solution is still preferred.
-        static import core.sys.posix.ucontext;
-    }
-}
 
 version (Windows)
 {
```

Regards,
Iain.

Reply via email to