diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
 # Revision history for libBF-hs
 
+## 0.6.5.1 -- 2022.08.29
+
+* Fix a build error on non-Windows OSes accidentally introduced in version
+  0.6.5.
+
 ## 0.6.5 -- 2022.08.29
 
 * Force static linking against `gcc_s` on Windows to avoid portability issues.
diff --git a/libBF.cabal b/libBF.cabal
--- a/libBF.cabal
+++ b/libBF.cabal
@@ -1,7 +1,7 @@
 cabal-version:       2.2
 
 name:                libBF
-version:             0.6.5
+version:             0.6.5.1
 synopsis:            A binding to the libBF library.
 description:         LibBF is a C library for working with arbitray precision
                      IEEE 754 floating point numbers.
@@ -49,10 +49,11 @@
   -- optimizations don't appear to require linking against anything in
   -- particular, so it just works out of the box.
   if !impl(ghc >= 9.4)
-    if arch(x86_64)
-      extra-libraries: gcc_s_seh-1
-    else
-      extra-libraries: gcc_s_dw2-1
+    if os(windows)
+      if arch(x86_64)
+        extra-libraries: gcc_s_seh-1
+      else
+        extra-libraries: gcc_s_dw2-1
 
   if flag(system-libbf)
     extra-libraries: bf
