From: Simon McVittie <smcv@debian.org>
Date: Sun, 3 Oct 2021 23:32:24 +0100
Subject: build: Don't use SSE on i386

As of 2021, Debian's i386 baseline is still i686 minus one instruction,
so it does not guarantee MMX or SSE.

Forwarded: not-needed, Debian-specific
---
 Makefile     | 5 ++++-
 ctf/Makefile | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 0a58fb5..a56c0bf 100644
--- a/Makefile
+++ b/Makefile
@@ -229,8 +229,11 @@ endif
 # -ffloat-store could work around that, but the better solution is to
 # just enforce SSE - every x86 CPU since Pentium3 supports that
 # and this should even improve the performance on old CPUs
+# However, as of 2021, Debian's baseline for i386 is still officially a
+# 20+ year old Geode, so we have to reduce performance on newer i386 CPUs
+# to comply with that baseline.
 ifeq ($(YQ2_ARCH), i386)
-override CFLAGS += -msse -mfpmath=sse
+override CFLAGS += -ffloat-store
 endif
 
 # Force SSE math on x86_64. All sane compilers should do this
diff --git a/ctf/Makefile b/ctf/Makefile
index d616d6f..de47880 100755
--- a/ctf/Makefile
+++ b/ctf/Makefile
@@ -132,8 +132,11 @@ endif
 # -ffloat-store could work around that, but the better solution is to
 # just enforce SSE - every x86 CPU since Pentium3 supports that
 # and this should even improve the performance on old CPUs
+# However, as of 2021, Debian's baseline for i386 is still officially a
+# 20+ year old Geode, so we have to reduce performance on newer i386 CPUs
+# to comply with that baseline.
 ifeq ($(YQ2_ARCH), i386)
-override CFLAGS += -msse -mfpmath=sse
+override CFLAGS += -ffloat-store
 endif
 
 # Force SSE math on x86_64. All sane compilers should do this
