public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Fix broken ucontext implementation, and other small test fixes
@ 2021-04-19 18:06 Iain Buclaw
  0 siblings, 0 replies; 11+ messages in thread
From: Iain Buclaw @ 2021-04-19 18:06 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f45187ad23fbd59022e0cfa42f89569b638f5279

commit f45187ad23fbd59022e0cfa42f89569b638f5279
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Dec 9 10:49:34 2020 +0100

    libphobos: Fix broken ucontext implementation, and other small test fixes

Diff:
---
 libphobos/src/std/experimental/allocator/package.d | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libphobos/src/std/experimental/allocator/package.d b/libphobos/src/std/experimental/allocator/package.d
index 11c85474365..7c404070ffa 100644
--- a/libphobos/src/std/experimental/allocator/package.d
+++ b/libphobos/src/std/experimental/allocator/package.d
@@ -622,7 +622,8 @@ allocator can be cast to $(D shared).
 
     testAllocatorObject(processAllocator);
     testAllocatorObject(theAllocator);
-    assertThrown!AssertError(processAllocator = null);
+    // XBUG: Asserts are not thrown in release code, so is a pointless check.
+    //assertThrown!AssertError(processAllocator = null);
 
     // Restore initial processAllocator state
     processAllocator = oldProcessAllocator;


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Fix broken ucontext implementation, and other small test fixes
@ 2021-09-17 14:34 Iain Buclaw
  0 siblings, 0 replies; 11+ messages in thread
From: Iain Buclaw @ 2021-09-17 14:34 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f9a24cd33f7930180de363dddfdced0cecd95eb9

commit f9a24cd33f7930180de363dddfdced0cecd95eb9
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Dec 9 10:49:34 2020 +0100

    libphobos: Fix broken ucontext implementation, and other small test fixes

Diff:
---
 libphobos/src/std/experimental/allocator/package.d | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libphobos/src/std/experimental/allocator/package.d b/libphobos/src/std/experimental/allocator/package.d
index 11c85474365..7c404070ffa 100644
--- a/libphobos/src/std/experimental/allocator/package.d
+++ b/libphobos/src/std/experimental/allocator/package.d
@@ -622,7 +622,8 @@ allocator can be cast to $(D shared).
 
     testAllocatorObject(processAllocator);
     testAllocatorObject(theAllocator);
-    assertThrown!AssertError(processAllocator = null);
+    // XBUG: Asserts are not thrown in release code, so is a pointless check.
+    //assertThrown!AssertError(processAllocator = null);
 
     // Restore initial processAllocator state
     processAllocator = oldProcessAllocator;


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Fix broken ucontext implementation, and other small test fixes
@ 2021-04-10 17:01 Iain Buclaw
  0 siblings, 0 replies; 11+ messages in thread
From: Iain Buclaw @ 2021-04-10 17:01 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:3bbe5f9a4edf81a0ac13ebc9e1813dbb91225438

commit 3bbe5f9a4edf81a0ac13ebc9e1813dbb91225438
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Dec 9 10:49:34 2020 +0100

    libphobos: Fix broken ucontext implementation, and other small test fixes

Diff:
---
 libphobos/libdruntime/core/thread/fiber.d               | 1 +
 libphobos/libdruntime/core/thread/threadbase.d          | 1 +
 libphobos/src/std/experimental/allocator/package.d      | 3 ++-
 libphobos/testsuite/libphobos.thread/fiber_guard_page.d | 6 ++++--
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/libphobos/libdruntime/core/thread/fiber.d b/libphobos/libdruntime/core/thread/fiber.d
index 3270f2e7094..2b475ca82cb 100644
--- a/libphobos/libdruntime/core/thread/fiber.d
+++ b/libphobos/libdruntime/core/thread/fiber.d
@@ -883,6 +883,7 @@ class Fiber
      */
     static Fiber getThis() @safe nothrow @nogc
     {
+        version (GNU) pragma(inline, false);
         return sm_this;
     }
 
diff --git a/libphobos/libdruntime/core/thread/threadbase.d b/libphobos/libdruntime/core/thread/threadbase.d
index c2c2333efe9..50795e444be 100644
--- a/libphobos/libdruntime/core/thread/threadbase.d
+++ b/libphobos/libdruntime/core/thread/threadbase.d
@@ -313,6 +313,7 @@ class ThreadBase
         // NOTE: This function may not be called until thread_init has
         //       completed.  See thread_suspendAll for more information
         //       on why this might occur.
+        version (GNU) pragma(inline, false);
         return sm_this;
     }
 
diff --git a/libphobos/src/std/experimental/allocator/package.d b/libphobos/src/std/experimental/allocator/package.d
index 11c85474365..7c404070ffa 100644
--- a/libphobos/src/std/experimental/allocator/package.d
+++ b/libphobos/src/std/experimental/allocator/package.d
@@ -622,7 +622,8 @@ allocator can be cast to $(D shared).
 
     testAllocatorObject(processAllocator);
     testAllocatorObject(theAllocator);
-    assertThrown!AssertError(processAllocator = null);
+    // XBUG: Asserts are not thrown in release code, so is a pointless check.
+    //assertThrown!AssertError(processAllocator = null);
 
     // Restore initial processAllocator state
     processAllocator = oldProcessAllocator;
diff --git a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
index 9f754e155d2..ca54a19857f 100644
--- a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
+++ b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
@@ -1,13 +1,15 @@
 // { dg-options "-O0" }
 // { dg-shouldfail "segv or bus error" }
 import core.thread;
+import core.sys.posix.signal;
 import core.sys.posix.sys.mman;
 
 // this should be true for most architectures
 // (taken from core.thread)
-version = StackGrowsDown;
+version (GNU_StackGrowsDown)
+    version = StackGrowsDown;
 
-enum stackSize = 4096;
+enum stackSize = MINSIGSTKSZ;
 
 // Simple method that causes a stack overflow
 void stackMethod()


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Fix broken ucontext implementation, and other small test fixes
@ 2021-04-10 15:04 Iain Buclaw
  0 siblings, 0 replies; 11+ messages in thread
From: Iain Buclaw @ 2021-04-10 15:04 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5646288fb9f20cbcb6ca3aa704bc686d6a24759f

commit 5646288fb9f20cbcb6ca3aa704bc686d6a24759f
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Dec 9 10:49:34 2020 +0100

    libphobos: Fix broken ucontext implementation, and other small test fixes

Diff:
---
 libphobos/libdruntime/core/thread/fiber.d               | 1 +
 libphobos/libdruntime/core/thread/threadbase.d          | 1 +
 libphobos/src/std/experimental/allocator/package.d      | 3 ++-
 libphobos/testsuite/libphobos.thread/fiber_guard_page.d | 6 ++++--
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/libphobos/libdruntime/core/thread/fiber.d b/libphobos/libdruntime/core/thread/fiber.d
index 3270f2e7094..2b475ca82cb 100644
--- a/libphobos/libdruntime/core/thread/fiber.d
+++ b/libphobos/libdruntime/core/thread/fiber.d
@@ -883,6 +883,7 @@ class Fiber
      */
     static Fiber getThis() @safe nothrow @nogc
     {
+        version (GNU) pragma(inline, false);
         return sm_this;
     }
 
diff --git a/libphobos/libdruntime/core/thread/threadbase.d b/libphobos/libdruntime/core/thread/threadbase.d
index c2c2333efe9..50795e444be 100644
--- a/libphobos/libdruntime/core/thread/threadbase.d
+++ b/libphobos/libdruntime/core/thread/threadbase.d
@@ -313,6 +313,7 @@ class ThreadBase
         // NOTE: This function may not be called until thread_init has
         //       completed.  See thread_suspendAll for more information
         //       on why this might occur.
+        version (GNU) pragma(inline, false);
         return sm_this;
     }
 
diff --git a/libphobos/src/std/experimental/allocator/package.d b/libphobos/src/std/experimental/allocator/package.d
index 11c85474365..7c404070ffa 100644
--- a/libphobos/src/std/experimental/allocator/package.d
+++ b/libphobos/src/std/experimental/allocator/package.d
@@ -622,7 +622,8 @@ allocator can be cast to $(D shared).
 
     testAllocatorObject(processAllocator);
     testAllocatorObject(theAllocator);
-    assertThrown!AssertError(processAllocator = null);
+    // XBUG: Asserts are not thrown in release code, so is a pointless check.
+    //assertThrown!AssertError(processAllocator = null);
 
     // Restore initial processAllocator state
     processAllocator = oldProcessAllocator;
diff --git a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
index 9f754e155d2..ca54a19857f 100644
--- a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
+++ b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
@@ -1,13 +1,15 @@
 // { dg-options "-O0" }
 // { dg-shouldfail "segv or bus error" }
 import core.thread;
+import core.sys.posix.signal;
 import core.sys.posix.sys.mman;
 
 // this should be true for most architectures
 // (taken from core.thread)
-version = StackGrowsDown;
+version (GNU_StackGrowsDown)
+    version = StackGrowsDown;
 
-enum stackSize = 4096;
+enum stackSize = MINSIGSTKSZ;
 
 // Simple method that causes a stack overflow
 void stackMethod()


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Fix broken ucontext implementation, and other small test fixes
@ 2021-03-14 22:00 Iain Buclaw
  0 siblings, 0 replies; 11+ messages in thread
From: Iain Buclaw @ 2021-03-14 22:00 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:20170842858f4e205844cfb121f0a9092d8e4717

commit 20170842858f4e205844cfb121f0a9092d8e4717
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Dec 9 10:49:34 2020 +0100

    libphobos: Fix broken ucontext implementation, and other small test fixes

Diff:
---
 libphobos/libdruntime/core/thread/fiber.d               | 1 +
 libphobos/libdruntime/core/thread/threadbase.d          | 1 +
 libphobos/src/std/experimental/allocator/package.d      | 3 ++-
 libphobos/testsuite/libphobos.thread/fiber_guard_page.d | 6 ++++--
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/libphobos/libdruntime/core/thread/fiber.d b/libphobos/libdruntime/core/thread/fiber.d
index 3270f2e7094..2b475ca82cb 100644
--- a/libphobos/libdruntime/core/thread/fiber.d
+++ b/libphobos/libdruntime/core/thread/fiber.d
@@ -883,6 +883,7 @@ class Fiber
      */
     static Fiber getThis() @safe nothrow @nogc
     {
+        version (GNU) pragma(inline, false);
         return sm_this;
     }
 
diff --git a/libphobos/libdruntime/core/thread/threadbase.d b/libphobos/libdruntime/core/thread/threadbase.d
index c2c2333efe9..50795e444be 100644
--- a/libphobos/libdruntime/core/thread/threadbase.d
+++ b/libphobos/libdruntime/core/thread/threadbase.d
@@ -313,6 +313,7 @@ class ThreadBase
         // NOTE: This function may not be called until thread_init has
         //       completed.  See thread_suspendAll for more information
         //       on why this might occur.
+        version (GNU) pragma(inline, false);
         return sm_this;
     }
 
diff --git a/libphobos/src/std/experimental/allocator/package.d b/libphobos/src/std/experimental/allocator/package.d
index 11c85474365..7c404070ffa 100644
--- a/libphobos/src/std/experimental/allocator/package.d
+++ b/libphobos/src/std/experimental/allocator/package.d
@@ -622,7 +622,8 @@ allocator can be cast to $(D shared).
 
     testAllocatorObject(processAllocator);
     testAllocatorObject(theAllocator);
-    assertThrown!AssertError(processAllocator = null);
+    // XBUG: Asserts are not thrown in release code, so is a pointless check.
+    //assertThrown!AssertError(processAllocator = null);
 
     // Restore initial processAllocator state
     processAllocator = oldProcessAllocator;
diff --git a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
index 9f754e155d2..ca54a19857f 100644
--- a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
+++ b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
@@ -1,13 +1,15 @@
 // { dg-options "-O0" }
 // { dg-shouldfail "segv or bus error" }
 import core.thread;
+import core.sys.posix.signal;
 import core.sys.posix.sys.mman;
 
 // this should be true for most architectures
 // (taken from core.thread)
-version = StackGrowsDown;
+version (GNU_StackGrowsDown)
+    version = StackGrowsDown;
 
-enum stackSize = 4096;
+enum stackSize = MINSIGSTKSZ;
 
 // Simple method that causes a stack overflow
 void stackMethod()


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Fix broken ucontext implementation, and other small test fixes
@ 2021-03-07 17:02 Iain Buclaw
  0 siblings, 0 replies; 11+ messages in thread
From: Iain Buclaw @ 2021-03-07 17:02 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b18860dc1d347a423dcefccb782a44459d921bb2

commit b18860dc1d347a423dcefccb782a44459d921bb2
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Dec 9 10:49:34 2020 +0100

    libphobos: Fix broken ucontext implementation, and other small test fixes

Diff:
---
 libphobos/libdruntime/core/thread/fiber.d               | 1 +
 libphobos/libdruntime/core/thread/threadbase.d          | 1 +
 libphobos/src/std/experimental/allocator/package.d      | 3 ++-
 libphobos/testsuite/libphobos.thread/fiber_guard_page.d | 6 ++++--
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/libphobos/libdruntime/core/thread/fiber.d b/libphobos/libdruntime/core/thread/fiber.d
index 3270f2e7094..2b475ca82cb 100644
--- a/libphobos/libdruntime/core/thread/fiber.d
+++ b/libphobos/libdruntime/core/thread/fiber.d
@@ -883,6 +883,7 @@ class Fiber
      */
     static Fiber getThis() @safe nothrow @nogc
     {
+        version (GNU) pragma(inline, false);
         return sm_this;
     }
 
diff --git a/libphobos/libdruntime/core/thread/threadbase.d b/libphobos/libdruntime/core/thread/threadbase.d
index c2c2333efe9..50795e444be 100644
--- a/libphobos/libdruntime/core/thread/threadbase.d
+++ b/libphobos/libdruntime/core/thread/threadbase.d
@@ -313,6 +313,7 @@ class ThreadBase
         // NOTE: This function may not be called until thread_init has
         //       completed.  See thread_suspendAll for more information
         //       on why this might occur.
+        version (GNU) pragma(inline, false);
         return sm_this;
     }
 
diff --git a/libphobos/src/std/experimental/allocator/package.d b/libphobos/src/std/experimental/allocator/package.d
index 11c85474365..7c404070ffa 100644
--- a/libphobos/src/std/experimental/allocator/package.d
+++ b/libphobos/src/std/experimental/allocator/package.d
@@ -622,7 +622,8 @@ allocator can be cast to $(D shared).
 
     testAllocatorObject(processAllocator);
     testAllocatorObject(theAllocator);
-    assertThrown!AssertError(processAllocator = null);
+    // XBUG: Asserts are not thrown in release code, so is a pointless check.
+    //assertThrown!AssertError(processAllocator = null);
 
     // Restore initial processAllocator state
     processAllocator = oldProcessAllocator;
diff --git a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
index 9f754e155d2..ca54a19857f 100644
--- a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
+++ b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
@@ -1,13 +1,15 @@
 // { dg-options "-O0" }
 // { dg-shouldfail "segv or bus error" }
 import core.thread;
+import core.sys.posix.signal;
 import core.sys.posix.sys.mman;
 
 // this should be true for most architectures
 // (taken from core.thread)
-version = StackGrowsDown;
+version (GNU_StackGrowsDown)
+    version = StackGrowsDown;
 
-enum stackSize = 4096;
+enum stackSize = MINSIGSTKSZ;
 
 // Simple method that causes a stack overflow
 void stackMethod()


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Fix broken ucontext implementation, and other small test fixes
@ 2021-01-30 19:09 Iain Buclaw
  0 siblings, 0 replies; 11+ messages in thread
From: Iain Buclaw @ 2021-01-30 19:09 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0bf2aa45a9969de106b2b36d1581ae04ec837b56

commit 0bf2aa45a9969de106b2b36d1581ae04ec837b56
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Dec 9 10:49:34 2020 +0100

    libphobos: Fix broken ucontext implementation, and other small test fixes

Diff:
---
 libphobos/libdruntime/core/thread/fiber.d               | 1 +
 libphobos/libdruntime/core/thread/threadbase.d          | 1 +
 libphobos/src/std/experimental/allocator/package.d      | 3 ++-
 libphobos/testsuite/libphobos.thread/fiber_guard_page.d | 6 ++++--
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/libphobos/libdruntime/core/thread/fiber.d b/libphobos/libdruntime/core/thread/fiber.d
index 3270f2e7094..2b475ca82cb 100644
--- a/libphobos/libdruntime/core/thread/fiber.d
+++ b/libphobos/libdruntime/core/thread/fiber.d
@@ -883,6 +883,7 @@ class Fiber
      */
     static Fiber getThis() @safe nothrow @nogc
     {
+        version (GNU) pragma(inline, false);
         return sm_this;
     }
 
diff --git a/libphobos/libdruntime/core/thread/threadbase.d b/libphobos/libdruntime/core/thread/threadbase.d
index c2c2333efe9..50795e444be 100644
--- a/libphobos/libdruntime/core/thread/threadbase.d
+++ b/libphobos/libdruntime/core/thread/threadbase.d
@@ -313,6 +313,7 @@ class ThreadBase
         // NOTE: This function may not be called until thread_init has
         //       completed.  See thread_suspendAll for more information
         //       on why this might occur.
+        version (GNU) pragma(inline, false);
         return sm_this;
     }
 
diff --git a/libphobos/src/std/experimental/allocator/package.d b/libphobos/src/std/experimental/allocator/package.d
index 11c85474365..7c404070ffa 100644
--- a/libphobos/src/std/experimental/allocator/package.d
+++ b/libphobos/src/std/experimental/allocator/package.d
@@ -622,7 +622,8 @@ allocator can be cast to $(D shared).
 
     testAllocatorObject(processAllocator);
     testAllocatorObject(theAllocator);
-    assertThrown!AssertError(processAllocator = null);
+    // XBUG: Asserts are not thrown in release code, so is a pointless check.
+    //assertThrown!AssertError(processAllocator = null);
 
     // Restore initial processAllocator state
     processAllocator = oldProcessAllocator;
diff --git a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
index 9f754e155d2..ca54a19857f 100644
--- a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
+++ b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
@@ -1,13 +1,15 @@
 // { dg-options "-O0" }
 // { dg-shouldfail "segv or bus error" }
 import core.thread;
+import core.sys.posix.signal;
 import core.sys.posix.sys.mman;
 
 // this should be true for most architectures
 // (taken from core.thread)
-version = StackGrowsDown;
+version (GNU_StackGrowsDown)
+    version = StackGrowsDown;
 
-enum stackSize = 4096;
+enum stackSize = MINSIGSTKSZ;
 
 // Simple method that causes a stack overflow
 void stackMethod()


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Fix broken ucontext implementation, and other small test fixes
@ 2021-01-28 17:32 Iain Buclaw
  0 siblings, 0 replies; 11+ messages in thread
From: Iain Buclaw @ 2021-01-28 17:32 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:374d224413b80ef479c460e067f61b2937ba8e9f

commit 374d224413b80ef479c460e067f61b2937ba8e9f
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Dec 9 10:49:34 2020 +0100

    libphobos: Fix broken ucontext implementation, and other small test fixes

Diff:
---
 libphobos/libdruntime/core/thread/fiber.d               | 1 +
 libphobos/libdruntime/core/thread/threadbase.d          | 1 +
 libphobos/src/std/experimental/allocator/package.d      | 3 ++-
 libphobos/testsuite/libphobos.thread/fiber_guard_page.d | 6 ++++--
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/libphobos/libdruntime/core/thread/fiber.d b/libphobos/libdruntime/core/thread/fiber.d
index 3270f2e7094..2b475ca82cb 100644
--- a/libphobos/libdruntime/core/thread/fiber.d
+++ b/libphobos/libdruntime/core/thread/fiber.d
@@ -883,6 +883,7 @@ class Fiber
      */
     static Fiber getThis() @safe nothrow @nogc
     {
+        version (GNU) pragma(inline, false);
         return sm_this;
     }
 
diff --git a/libphobos/libdruntime/core/thread/threadbase.d b/libphobos/libdruntime/core/thread/threadbase.d
index c2c2333efe9..50795e444be 100644
--- a/libphobos/libdruntime/core/thread/threadbase.d
+++ b/libphobos/libdruntime/core/thread/threadbase.d
@@ -313,6 +313,7 @@ class ThreadBase
         // NOTE: This function may not be called until thread_init has
         //       completed.  See thread_suspendAll for more information
         //       on why this might occur.
+        version (GNU) pragma(inline, false);
         return sm_this;
     }
 
diff --git a/libphobos/src/std/experimental/allocator/package.d b/libphobos/src/std/experimental/allocator/package.d
index 11c85474365..7c404070ffa 100644
--- a/libphobos/src/std/experimental/allocator/package.d
+++ b/libphobos/src/std/experimental/allocator/package.d
@@ -622,7 +622,8 @@ allocator can be cast to $(D shared).
 
     testAllocatorObject(processAllocator);
     testAllocatorObject(theAllocator);
-    assertThrown!AssertError(processAllocator = null);
+    // XBUG: Asserts are not thrown in release code, so is a pointless check.
+    //assertThrown!AssertError(processAllocator = null);
 
     // Restore initial processAllocator state
     processAllocator = oldProcessAllocator;
diff --git a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
index 9f754e155d2..ca54a19857f 100644
--- a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
+++ b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
@@ -1,13 +1,15 @@
 // { dg-options "-O0" }
 // { dg-shouldfail "segv or bus error" }
 import core.thread;
+import core.sys.posix.signal;
 import core.sys.posix.sys.mman;
 
 // this should be true for most architectures
 // (taken from core.thread)
-version = StackGrowsDown;
+version (GNU_StackGrowsDown)
+    version = StackGrowsDown;
 
-enum stackSize = 4096;
+enum stackSize = MINSIGSTKSZ;
 
 // Simple method that causes a stack overflow
 void stackMethod()


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Fix broken ucontext implementation, and other small test fixes
@ 2021-01-11 11:40 Iain Buclaw
  0 siblings, 0 replies; 11+ messages in thread
From: Iain Buclaw @ 2021-01-11 11:40 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5b21f35ce3c78bd2104727750846e44b1ea298d1

commit 5b21f35ce3c78bd2104727750846e44b1ea298d1
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Dec 9 10:49:34 2020 +0100

    libphobos: Fix broken ucontext implementation, and other small test fixes

Diff:
---
 libphobos/libdruntime/core/sys/posix/ucontext.d    | 85 ++++++++++++++++++++--
 libphobos/libdruntime/core/thread.d                | 28 +++++--
 libphobos/src/std/experimental/allocator/package.d |  3 +-
 .../testsuite/libphobos.thread/fiber_guard_page.d  |  6 +-
 4 files changed, 106 insertions(+), 16 deletions(-)

diff --git a/libphobos/libdruntime/core/sys/posix/ucontext.d b/libphobos/libdruntime/core/sys/posix/ucontext.d
index 9400edd11f2..4e4365efda2 100644
--- a/libphobos/libdruntime/core/sys/posix/ucontext.d
+++ b/libphobos/libdruntime/core/sys/posix/ucontext.d
@@ -32,6 +32,8 @@ else version (TVOS)
 else version (WatchOS)
     version = Darwin;
 
+version (ARM)     version = ARM_Any;
+version (AArch64) version = ARM_Any;
 version (MIPS32)  version = MIPS_Any;
 version (MIPS64)  version = MIPS_Any;
 version (PPC)     version = PPC_Any;
@@ -657,7 +659,7 @@ version (CRuntime_Glibc)
             mcontext_t  uc_mcontext;
         }
     }
-    else version (SPARC64)
+    else version (SPARC_Any)
     {
         enum MC_NGREG = 19;
         alias mc_greg_t = c_ulong;
@@ -958,7 +960,17 @@ else version (Darwin)
                 int[2] __fpu_reserved;
                 ushort __fpu_fcw;
                 ushort __fpu_fsw;
-                uint[7] __fpu_regs;
+                ubyte  __fpu_ftw;
+                ubyte  __fpu_rsrv1;
+                ushort __fpu_fop;
+                uint   __fpu_ip;
+                ushort __fpu_cs;
+                ushort __fpu_rsrv2;
+                uint   __fpu_dp;
+                ushort __fpu_ds;
+                ushort __fpu_rsrv3;
+                uint   __fpu_mxcsr;
+                uint   __fpu_mxcsrmask;
                 __darwin_mmst_reg[8] __fpu_stmm;
                 version (X86_64)
                 {
@@ -980,6 +992,69 @@ else version (Darwin)
                 __darwin_float_state __fs;
             }
         }
+        else version (ARM_Any)
+        {
+            struct __darwin_exception_state
+            {
+                version (AArch64)
+                {
+                    ulong __far;
+                    uint __esr;
+                    uint __exception;
+                }
+                else
+                {
+                    uint __exception;
+                    uint __fsr;
+                    uint __far;
+                }
+            }
+
+            struct __darwin_thread_state
+            {
+                version (AArch64)
+                {
+                    ulong[29] x;
+                    ulong fp;
+                    ulong lr;
+                    ulong sp;
+                    ulong pc;
+                    uint cpsr;
+                    uint __pad;
+                }
+                else
+                {
+                    uint[13] r;
+                    uint sp;
+                    uint lr;
+                    uint pc;
+                    uint cpsr;
+                }
+            }
+
+            struct __darwin_vfp_state
+            {
+                uint[64] r;
+                uint fpscr;
+            }
+
+            struct __darwin_neon_state
+            {
+                align(16) ulong[64] __v;
+                uint __fpsr;
+                uint __fpcr;
+            }
+
+            struct __darwin_mcontext
+            {
+                __darwin_exception_state __es;
+                __darwin_thread_state __ss;
+                version (AArch64)
+                    __darwin_neon_state __ns;
+                else
+                    __darwin_vfp_state __fs;
+            }
+        }
         else version (PPC_Any)
         {
             struct __darwin_exception_state
@@ -1408,7 +1483,7 @@ else version (OpenBSD)
             int     sc_trapno;
             int     sc_err;
             void*   sc_fpstate; // union savefpu*
-        };
+        }
     }
     else version (PPC)
     {
@@ -1495,7 +1570,7 @@ else version (DragonFlyBSD)
         uint            mc_reserved;
         uint[8]         mc_unused;
         int[256]        mc_fpregs;
-      };  // __attribute__((aligned(64)));
+      }  // __attribute__((aligned(64)));
     }
     else
     {
@@ -1609,7 +1684,7 @@ else version (Solaris)
             {
                 uint[32]   fpu_regs;
                 double[16] fpu_dregs;
-            };
+            }
             fq    *fpu_q;
             uint  fpu_fsr;
             ubyte fpu_qcnt;
diff --git a/libphobos/libdruntime/core/thread.d b/libphobos/libdruntime/core/thread.d
index 7506a8b3ee3..5381cda103b 100644
--- a/libphobos/libdruntime/core/thread.d
+++ b/libphobos/libdruntime/core/thread.d
@@ -1343,6 +1343,7 @@ class Thread
         // NOTE: This function may not be called until thread_init has
         //       completed.  See thread_suspendAll for more information
         //       on why this might occur.
+        version (GNU) pragma(inline, false);
         return sm_this;
     }
 
@@ -2039,6 +2040,16 @@ extern (C) void thread_init()
 
     version (Darwin)
     {
+        // thread id different in forked child process
+        static extern(C) void initChildAfterFork()
+        {
+            auto thisThread = Thread.getThis();
+            thisThread.m_addr = pthread_self();
+            assert( thisThread.m_addr != thisThread.m_addr.init );
+            thisThread.m_tmach = pthread_mach_thread_np( thisThread.m_addr );
+            assert( thisThread.m_tmach != thisThread.m_tmach.init );
+        }
+        pthread_atfork(null, null, &initChildAfterFork);
     }
     else version (Posix)
     {
@@ -4463,6 +4474,7 @@ class Fiber
      */
     static Fiber getThis() @safe nothrow @nogc
     {
+        version(GNU) pragma(inline, false);
         return sm_this;
     }
 
@@ -4618,14 +4630,14 @@ private:
         }
         else
         {
-            version (Posix) import core.sys.posix.sys.mman; // mmap
-            version (FreeBSD) import core.sys.freebsd.sys.mman : MAP_ANON;
-            version (NetBSD) import core.sys.netbsd.sys.mman : MAP_ANON;
-            version (OpenBSD) import core.sys.openbsd.sys.mman : MAP_ANON;
-            version (DragonFlyBSD) import core.sys.dragonflybsd.sys.mman : MAP_ANON;
-            version (CRuntime_Glibc) import core.sys.linux.sys.mman : MAP_ANON;
-            version (Darwin) import core.sys.darwin.sys.mman : MAP_ANON;
-            version (CRuntime_UClibc) import core.sys.linux.sys.mman : MAP_ANON;
+            version (Posix) import core.sys.posix.sys.mman; // mmap, MAP_ANON
+
+            static if ( __traits( compiles, ucontext_t ) )
+            {
+                // Stack size must be at least the minimum allowable by the OS.
+                if (sz < MINSIGSTKSZ)
+                    sz = MINSIGSTKSZ;
+            }
 
             static if ( __traits( compiles, mmap ) )
             {
diff --git a/libphobos/src/std/experimental/allocator/package.d b/libphobos/src/std/experimental/allocator/package.d
index 11c85474365..7c404070ffa 100644
--- a/libphobos/src/std/experimental/allocator/package.d
+++ b/libphobos/src/std/experimental/allocator/package.d
@@ -622,7 +622,8 @@ allocator can be cast to $(D shared).
 
     testAllocatorObject(processAllocator);
     testAllocatorObject(theAllocator);
-    assertThrown!AssertError(processAllocator = null);
+    // XBUG: Asserts are not thrown in release code, so is a pointless check.
+    //assertThrown!AssertError(processAllocator = null);
 
     // Restore initial processAllocator state
     processAllocator = oldProcessAllocator;
diff --git a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
index 61a616acd8e..ca3ff2afca0 100644
--- a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
+++ b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
@@ -1,13 +1,15 @@
 // { dg-options "-O0" }
 // { dg-shouldfail "segv or bus error" }
 import core.thread;
+import core.sys.posix.signal;
 import core.sys.posix.sys.mman;
 
 // this should be true for most architectures
 // (taken from core.thread)
-version = StackGrowsDown;
+version (GNU_StackGrowsDown)
+    version = StackGrowsDown;
 
-enum stackSize = 4096;
+enum stackSize = MINSIGSTKSZ;
 
 // Simple method that causes a stack overflow
 void stackMethod()


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Fix broken ucontext implementation, and other small test fixes
@ 2020-12-22 13:41 Iain Buclaw
  0 siblings, 0 replies; 11+ messages in thread
From: Iain Buclaw @ 2020-12-22 13:41 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:379fe34b3ee6cf2f2876f162a2c3b0a93e278bd8

commit 379fe34b3ee6cf2f2876f162a2c3b0a93e278bd8
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Dec 9 10:49:34 2020 +0100

    libphobos: Fix broken ucontext implementation, and other small test fixes

Diff:
---
 libphobos/libdruntime/core/sys/posix/ucontext.d    | 85 ++++++++++++++++++++--
 libphobos/libdruntime/core/thread.d                | 28 +++++--
 libphobos/src/std/experimental/allocator/package.d |  3 +-
 .../testsuite/libphobos.thread/fiber_guard_page.d  |  6 +-
 4 files changed, 106 insertions(+), 16 deletions(-)

diff --git a/libphobos/libdruntime/core/sys/posix/ucontext.d b/libphobos/libdruntime/core/sys/posix/ucontext.d
index 9400edd11f2..4e4365efda2 100644
--- a/libphobos/libdruntime/core/sys/posix/ucontext.d
+++ b/libphobos/libdruntime/core/sys/posix/ucontext.d
@@ -32,6 +32,8 @@ else version (TVOS)
 else version (WatchOS)
     version = Darwin;
 
+version (ARM)     version = ARM_Any;
+version (AArch64) version = ARM_Any;
 version (MIPS32)  version = MIPS_Any;
 version (MIPS64)  version = MIPS_Any;
 version (PPC)     version = PPC_Any;
@@ -657,7 +659,7 @@ version (CRuntime_Glibc)
             mcontext_t  uc_mcontext;
         }
     }
-    else version (SPARC64)
+    else version (SPARC_Any)
     {
         enum MC_NGREG = 19;
         alias mc_greg_t = c_ulong;
@@ -958,7 +960,17 @@ else version (Darwin)
                 int[2] __fpu_reserved;
                 ushort __fpu_fcw;
                 ushort __fpu_fsw;
-                uint[7] __fpu_regs;
+                ubyte  __fpu_ftw;
+                ubyte  __fpu_rsrv1;
+                ushort __fpu_fop;
+                uint   __fpu_ip;
+                ushort __fpu_cs;
+                ushort __fpu_rsrv2;
+                uint   __fpu_dp;
+                ushort __fpu_ds;
+                ushort __fpu_rsrv3;
+                uint   __fpu_mxcsr;
+                uint   __fpu_mxcsrmask;
                 __darwin_mmst_reg[8] __fpu_stmm;
                 version (X86_64)
                 {
@@ -980,6 +992,69 @@ else version (Darwin)
                 __darwin_float_state __fs;
             }
         }
+        else version (ARM_Any)
+        {
+            struct __darwin_exception_state
+            {
+                version (AArch64)
+                {
+                    ulong __far;
+                    uint __esr;
+                    uint __exception;
+                }
+                else
+                {
+                    uint __exception;
+                    uint __fsr;
+                    uint __far;
+                }
+            }
+
+            struct __darwin_thread_state
+            {
+                version (AArch64)
+                {
+                    ulong[29] x;
+                    ulong fp;
+                    ulong lr;
+                    ulong sp;
+                    ulong pc;
+                    uint cpsr;
+                    uint __pad;
+                }
+                else
+                {
+                    uint[13] r;
+                    uint sp;
+                    uint lr;
+                    uint pc;
+                    uint cpsr;
+                }
+            }
+
+            struct __darwin_vfp_state
+            {
+                uint[64] r;
+                uint fpscr;
+            }
+
+            struct __darwin_neon_state
+            {
+                align(16) ulong[64] __v;
+                uint __fpsr;
+                uint __fpcr;
+            }
+
+            struct __darwin_mcontext
+            {
+                __darwin_exception_state __es;
+                __darwin_thread_state __ss;
+                version (AArch64)
+                    __darwin_neon_state __ns;
+                else
+                    __darwin_vfp_state __fs;
+            }
+        }
         else version (PPC_Any)
         {
             struct __darwin_exception_state
@@ -1408,7 +1483,7 @@ else version (OpenBSD)
             int     sc_trapno;
             int     sc_err;
             void*   sc_fpstate; // union savefpu*
-        };
+        }
     }
     else version (PPC)
     {
@@ -1495,7 +1570,7 @@ else version (DragonFlyBSD)
         uint            mc_reserved;
         uint[8]         mc_unused;
         int[256]        mc_fpregs;
-      };  // __attribute__((aligned(64)));
+      }  // __attribute__((aligned(64)));
     }
     else
     {
@@ -1609,7 +1684,7 @@ else version (Solaris)
             {
                 uint[32]   fpu_regs;
                 double[16] fpu_dregs;
-            };
+            }
             fq    *fpu_q;
             uint  fpu_fsr;
             ubyte fpu_qcnt;
diff --git a/libphobos/libdruntime/core/thread.d b/libphobos/libdruntime/core/thread.d
index 7506a8b3ee3..5381cda103b 100644
--- a/libphobos/libdruntime/core/thread.d
+++ b/libphobos/libdruntime/core/thread.d
@@ -1343,6 +1343,7 @@ class Thread
         // NOTE: This function may not be called until thread_init has
         //       completed.  See thread_suspendAll for more information
         //       on why this might occur.
+        version (GNU) pragma(inline, false);
         return sm_this;
     }
 
@@ -2039,6 +2040,16 @@ extern (C) void thread_init()
 
     version (Darwin)
     {
+        // thread id different in forked child process
+        static extern(C) void initChildAfterFork()
+        {
+            auto thisThread = Thread.getThis();
+            thisThread.m_addr = pthread_self();
+            assert( thisThread.m_addr != thisThread.m_addr.init );
+            thisThread.m_tmach = pthread_mach_thread_np( thisThread.m_addr );
+            assert( thisThread.m_tmach != thisThread.m_tmach.init );
+        }
+        pthread_atfork(null, null, &initChildAfterFork);
     }
     else version (Posix)
     {
@@ -4463,6 +4474,7 @@ class Fiber
      */
     static Fiber getThis() @safe nothrow @nogc
     {
+        version(GNU) pragma(inline, false);
         return sm_this;
     }
 
@@ -4618,14 +4630,14 @@ private:
         }
         else
         {
-            version (Posix) import core.sys.posix.sys.mman; // mmap
-            version (FreeBSD) import core.sys.freebsd.sys.mman : MAP_ANON;
-            version (NetBSD) import core.sys.netbsd.sys.mman : MAP_ANON;
-            version (OpenBSD) import core.sys.openbsd.sys.mman : MAP_ANON;
-            version (DragonFlyBSD) import core.sys.dragonflybsd.sys.mman : MAP_ANON;
-            version (CRuntime_Glibc) import core.sys.linux.sys.mman : MAP_ANON;
-            version (Darwin) import core.sys.darwin.sys.mman : MAP_ANON;
-            version (CRuntime_UClibc) import core.sys.linux.sys.mman : MAP_ANON;
+            version (Posix) import core.sys.posix.sys.mman; // mmap, MAP_ANON
+
+            static if ( __traits( compiles, ucontext_t ) )
+            {
+                // Stack size must be at least the minimum allowable by the OS.
+                if (sz < MINSIGSTKSZ)
+                    sz = MINSIGSTKSZ;
+            }
 
             static if ( __traits( compiles, mmap ) )
             {
diff --git a/libphobos/src/std/experimental/allocator/package.d b/libphobos/src/std/experimental/allocator/package.d
index 11c85474365..7c404070ffa 100644
--- a/libphobos/src/std/experimental/allocator/package.d
+++ b/libphobos/src/std/experimental/allocator/package.d
@@ -622,7 +622,8 @@ allocator can be cast to $(D shared).
 
     testAllocatorObject(processAllocator);
     testAllocatorObject(theAllocator);
-    assertThrown!AssertError(processAllocator = null);
+    // XBUG: Asserts are not thrown in release code, so is a pointless check.
+    //assertThrown!AssertError(processAllocator = null);
 
     // Restore initial processAllocator state
     processAllocator = oldProcessAllocator;
diff --git a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
index 61a616acd8e..ca3ff2afca0 100644
--- a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
+++ b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
@@ -1,13 +1,15 @@
 // { dg-options "-O0" }
 // { dg-shouldfail "segv or bus error" }
 import core.thread;
+import core.sys.posix.signal;
 import core.sys.posix.sys.mman;
 
 // this should be true for most architectures
 // (taken from core.thread)
-version = StackGrowsDown;
+version (GNU_StackGrowsDown)
+    version = StackGrowsDown;
 
-enum stackSize = 4096;
+enum stackSize = MINSIGSTKSZ;
 
 // Simple method that causes a stack overflow
 void stackMethod()


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Fix broken ucontext implementation, and other small test fixes
@ 2020-12-09  9:51 Iain Buclaw
  0 siblings, 0 replies; 11+ messages in thread
From: Iain Buclaw @ 2020-12-09  9:51 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d9c274c762d1d77c5979b5f896396006965d103f

commit d9c274c762d1d77c5979b5f896396006965d103f
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Dec 9 10:49:34 2020 +0100

    libphobos: Fix broken ucontext implementation, and other small test fixes

Diff:
---
 libphobos/libdruntime/core/sys/posix/ucontext.d    | 85 ++++++++++++++++++++--
 libphobos/libdruntime/core/thread.d                | 28 +++++--
 libphobos/src/std/experimental/allocator/package.d |  3 +-
 .../testsuite/libphobos.thread/fiber_guard_page.d  |  6 +-
 4 files changed, 106 insertions(+), 16 deletions(-)

diff --git a/libphobos/libdruntime/core/sys/posix/ucontext.d b/libphobos/libdruntime/core/sys/posix/ucontext.d
index 9400edd11f2..4e4365efda2 100644
--- a/libphobos/libdruntime/core/sys/posix/ucontext.d
+++ b/libphobos/libdruntime/core/sys/posix/ucontext.d
@@ -32,6 +32,8 @@ else version (TVOS)
 else version (WatchOS)
     version = Darwin;
 
+version (ARM)     version = ARM_Any;
+version (AArch64) version = ARM_Any;
 version (MIPS32)  version = MIPS_Any;
 version (MIPS64)  version = MIPS_Any;
 version (PPC)     version = PPC_Any;
@@ -657,7 +659,7 @@ version (CRuntime_Glibc)
             mcontext_t  uc_mcontext;
         }
     }
-    else version (SPARC64)
+    else version (SPARC_Any)
     {
         enum MC_NGREG = 19;
         alias mc_greg_t = c_ulong;
@@ -958,7 +960,17 @@ else version (Darwin)
                 int[2] __fpu_reserved;
                 ushort __fpu_fcw;
                 ushort __fpu_fsw;
-                uint[7] __fpu_regs;
+                ubyte  __fpu_ftw;
+                ubyte  __fpu_rsrv1;
+                ushort __fpu_fop;
+                uint   __fpu_ip;
+                ushort __fpu_cs;
+                ushort __fpu_rsrv2;
+                uint   __fpu_dp;
+                ushort __fpu_ds;
+                ushort __fpu_rsrv3;
+                uint   __fpu_mxcsr;
+                uint   __fpu_mxcsrmask;
                 __darwin_mmst_reg[8] __fpu_stmm;
                 version (X86_64)
                 {
@@ -980,6 +992,69 @@ else version (Darwin)
                 __darwin_float_state __fs;
             }
         }
+        else version (ARM_Any)
+        {
+            struct __darwin_exception_state
+            {
+                version (AArch64)
+                {
+                    ulong __far;
+                    uint __esr;
+                    uint __exception;
+                }
+                else
+                {
+                    uint __exception;
+                    uint __fsr;
+                    uint __far;
+                }
+            }
+
+            struct __darwin_thread_state
+            {
+                version (AArch64)
+                {
+                    ulong[29] x;
+                    ulong fp;
+                    ulong lr;
+                    ulong sp;
+                    ulong pc;
+                    uint cpsr;
+                    uint __pad;
+                }
+                else
+                {
+                    uint[13] r;
+                    uint sp;
+                    uint lr;
+                    uint pc;
+                    uint cpsr;
+                }
+            }
+
+            struct __darwin_vfp_state
+            {
+                uint[64] r;
+                uint fpscr;
+            }
+
+            struct __darwin_neon_state
+            {
+                align(16) ulong[64] __v;
+                uint __fpsr;
+                uint __fpcr;
+            }
+
+            struct __darwin_mcontext
+            {
+                __darwin_exception_state __es;
+                __darwin_thread_state __ss;
+                version (AArch64)
+                    __darwin_neon_state __ns;
+                else
+                    __darwin_vfp_state __fs;
+            }
+        }
         else version (PPC_Any)
         {
             struct __darwin_exception_state
@@ -1408,7 +1483,7 @@ else version (OpenBSD)
             int     sc_trapno;
             int     sc_err;
             void*   sc_fpstate; // union savefpu*
-        };
+        }
     }
     else version (PPC)
     {
@@ -1495,7 +1570,7 @@ else version (DragonFlyBSD)
         uint            mc_reserved;
         uint[8]         mc_unused;
         int[256]        mc_fpregs;
-      };  // __attribute__((aligned(64)));
+      }  // __attribute__((aligned(64)));
     }
     else
     {
@@ -1609,7 +1684,7 @@ else version (Solaris)
             {
                 uint[32]   fpu_regs;
                 double[16] fpu_dregs;
-            };
+            }
             fq    *fpu_q;
             uint  fpu_fsr;
             ubyte fpu_qcnt;
diff --git a/libphobos/libdruntime/core/thread.d b/libphobos/libdruntime/core/thread.d
index 7506a8b3ee3..5381cda103b 100644
--- a/libphobos/libdruntime/core/thread.d
+++ b/libphobos/libdruntime/core/thread.d
@@ -1343,6 +1343,7 @@ class Thread
         // NOTE: This function may not be called until thread_init has
         //       completed.  See thread_suspendAll for more information
         //       on why this might occur.
+        version (GNU) pragma(inline, false);
         return sm_this;
     }
 
@@ -2039,6 +2040,16 @@ extern (C) void thread_init()
 
     version (Darwin)
     {
+        // thread id different in forked child process
+        static extern(C) void initChildAfterFork()
+        {
+            auto thisThread = Thread.getThis();
+            thisThread.m_addr = pthread_self();
+            assert( thisThread.m_addr != thisThread.m_addr.init );
+            thisThread.m_tmach = pthread_mach_thread_np( thisThread.m_addr );
+            assert( thisThread.m_tmach != thisThread.m_tmach.init );
+        }
+        pthread_atfork(null, null, &initChildAfterFork);
     }
     else version (Posix)
     {
@@ -4463,6 +4474,7 @@ class Fiber
      */
     static Fiber getThis() @safe nothrow @nogc
     {
+        version(GNU) pragma(inline, false);
         return sm_this;
     }
 
@@ -4618,14 +4630,14 @@ private:
         }
         else
         {
-            version (Posix) import core.sys.posix.sys.mman; // mmap
-            version (FreeBSD) import core.sys.freebsd.sys.mman : MAP_ANON;
-            version (NetBSD) import core.sys.netbsd.sys.mman : MAP_ANON;
-            version (OpenBSD) import core.sys.openbsd.sys.mman : MAP_ANON;
-            version (DragonFlyBSD) import core.sys.dragonflybsd.sys.mman : MAP_ANON;
-            version (CRuntime_Glibc) import core.sys.linux.sys.mman : MAP_ANON;
-            version (Darwin) import core.sys.darwin.sys.mman : MAP_ANON;
-            version (CRuntime_UClibc) import core.sys.linux.sys.mman : MAP_ANON;
+            version (Posix) import core.sys.posix.sys.mman; // mmap, MAP_ANON
+
+            static if ( __traits( compiles, ucontext_t ) )
+            {
+                // Stack size must be at least the minimum allowable by the OS.
+                if (sz < MINSIGSTKSZ)
+                    sz = MINSIGSTKSZ;
+            }
 
             static if ( __traits( compiles, mmap ) )
             {
diff --git a/libphobos/src/std/experimental/allocator/package.d b/libphobos/src/std/experimental/allocator/package.d
index 11c85474365..7c404070ffa 100644
--- a/libphobos/src/std/experimental/allocator/package.d
+++ b/libphobos/src/std/experimental/allocator/package.d
@@ -622,7 +622,8 @@ allocator can be cast to $(D shared).
 
     testAllocatorObject(processAllocator);
     testAllocatorObject(theAllocator);
-    assertThrown!AssertError(processAllocator = null);
+    // XBUG: Asserts are not thrown in release code, so is a pointless check.
+    //assertThrown!AssertError(processAllocator = null);
 
     // Restore initial processAllocator state
     processAllocator = oldProcessAllocator;
diff --git a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
index 61a616acd8e..ca3ff2afca0 100644
--- a/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
+++ b/libphobos/testsuite/libphobos.thread/fiber_guard_page.d
@@ -1,13 +1,15 @@
 // { dg-options "-O0" }
 // { dg-shouldfail "segv or bus error" }
 import core.thread;
+import core.sys.posix.signal;
 import core.sys.posix.sys.mman;
 
 // this should be true for most architectures
 // (taken from core.thread)
-version = StackGrowsDown;
+version (GNU_StackGrowsDown)
+    version = StackGrowsDown;
 
-enum stackSize = 4096;
+enum stackSize = MINSIGSTKSZ;
 
 // Simple method that causes a stack overflow
 void stackMethod()


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-09-17 14:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19 18:06 [gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Fix broken ucontext implementation, and other small test fixes Iain Buclaw
  -- strict thread matches above, loose matches on Subject: below --
2021-09-17 14:34 Iain Buclaw
2021-04-10 17:01 Iain Buclaw
2021-04-10 15:04 Iain Buclaw
2021-03-14 22:00 Iain Buclaw
2021-03-07 17:02 Iain Buclaw
2021-01-30 19:09 Iain Buclaw
2021-01-28 17:32 Iain Buclaw
2021-01-11 11:40 Iain Buclaw
2020-12-22 13:41 Iain Buclaw
2020-12-09  9:51 Iain Buclaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).