diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,3 +22,8 @@
 ## 0.1.2.1 - 2023-09-19
 
 - Fixed link to image in README.
+
+
+## 0.1.2.2 - 2023-09-19
+
+- Updated the cabal file so that the Github actions for Mac work with a recent version of GHC.
diff --git a/numerical-integration.cabal b/numerical-integration.cabal
--- a/numerical-integration.cabal
+++ b/numerical-integration.cabal
@@ -1,6 +1,6 @@
 cabal-version:       2.2
 name:                numerical-integration
-version:             0.1.2.1
+version:             0.1.2.2
 synopsis:            Numerical integration.
 description:         One-dimensional numerical integration using the 'NumericalIntegration' C++ library.
 homepage:            https://github.com/stla/numerical-integration#readme
@@ -20,6 +20,12 @@
   hs-source-dirs:      src
   exposed-modules:     Numerical.Integration
   build-depends:       base >= 4.7 && < 5
+  if impl(ghc >= 9.4)
+    build-depends:     system-cxx-std-lib == 1.0
+  elif os(darwin) || os(freebsd)
+    extra-libraries:   c++11
+  else
+    extra-libraries:   stdc++
   other-extensions:    ForeignFunctionInterface
   include-dirs:        cpp
   C-sources:           cpp/integration.cpp
@@ -270,7 +276,6 @@
                      , cpp/Monegato.h
                      , cpp/NumericalIntegration.h
                      , cpp/Piessens.h  
-  extra-libraries:     stdc++
   default-language:    Haskell2010
   ghc-options:         -Wall
                        -Wcompat
@@ -281,10 +286,9 @@
                        -Wmissing-home-modules
                        -Wpartial-fields
                        -Wredundant-constraints
-  if os(darwin)
-    cxx-options:       -fPIC -std=gnu++11
-  else
-    cxx-options:       -fPIC -std=c++11
+                       -optcxx-std=c++11
+  if os(darwin) || os(freebsd)
+    ghc-options:       -optcxx-stdlib=libc++
 
 source-repository head
   type:     git
