From 236309d462fe7a345d5e895a73da409a29947d30 Mon Sep 17 00:00:00 2001
From: Ben Gamari <ben@smart-cactus.org>
Date: Wed, 20 Sep 2023 14:17:01 -0400
Subject: [PATCH] Use system-cxx-std-lib instead of extra-libraries when
 available

---
 stub/ghc-debug-stub.cabal | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/stub/ghc-debug-stub.cabal b/stub/ghc-debug-stub.cabal
index 73cf65c8..d1b90336 100644
--- a/stub/ghc-debug-stub.cabal
+++ b/stub/ghc-debug-stub.cabal
@@ -31,7 +31,10 @@ library
   default-language:    Haskell2010
   cxx-sources:         cbits/stub.cpp, cbits/socket.cpp, cbits/trace.cpp
   cxx-options:         -std=gnu++11 -pthread -O3 -g3 -DTHREADED_RTS
-  extra-libraries:     stdc++
+  if impl(ghc > 9.4)
+    build-builds:      system-cxx-std-lib
+  else
+    extra-libraries:   stdc++
   cpp-options: -DTHREADED_RTS
   if flag(trace)
     cxx-options: -DTRACE
-- 
GitLab