shithub: mc

Download patch

ref: 4cd2696347b1273dfc97c6733b7f01d9ccc81732
parent: 3665783a1d1fe03db70cca452c615b439310a329
author: Ori Bernstein <ori@eigenstate.org>
date: Wed May 9 15:21:57 EDT 2018

Turn off fancy stuff when we have an old assembler.

--- a/mbld/syssel.myr
+++ b/mbld/syssel.myr
@@ -162,13 +162,13 @@
 		match opt_arch
 		| "x64":	
 			tag(b, "x64")
-			if opt_cpufeatures & CpuidSSE2 == CpuidSSE2
+			if supports(CpuidSSE2)
 				tag(b, "sse2")
 			;;
-			if opt_cpufeatures & CpuidSSE4 == CpuidSSE4
+			if supports(CpuidSSE4)
 				tag(b, "sse4")
 			;;
-			if opt_cpufeatures & CpuidFMA == CpuidFMA
+			if supports(CpuidFMA)
 				tag(b, "fma")
 			;;
 		| unknown:
@@ -179,6 +179,15 @@
 			tag(b, t)
 		;;
 		loadtagfile(b, "bld.tag")
+	;;
+}
+
+const supports = {feat
+	match (opt_sys, opt_cpufeatures & feat)
+	/* The version of gas that's shipped with openbsd is too old. */
+	| ("openbsd", CpuidSSE4):	-> false
+	| ("openbsd", CpuidFMA):	-> false
+	| (_, f):			-> f == feat
 	;;
 }