Disable optimisations for sha1.c on UltraSPARC cpu if using GCC 2.x.
authorLubomir Sedlacik <salo@silcnet.org>
Wed, 23 Jul 2003 21:03:17 +0000 (21:03 +0000)
committerLubomir Sedlacik <salo@silcnet.org>
Wed, 23 Jul 2003 21:03:17 +0000 (21:03 +0000)
Works around a compiler bug which results in memory exhaustion.

configure.in.pre
lib/silccrypt/Makefile.am

index ea80702fa00d0a44e380d84a38a68df27326f7eb..9b3979f7638de6b0263530cff1690328fe1bc85e 100644 (file)
@@ -361,6 +361,29 @@ else
   fi
 fi
 
+#
+# Workaround a bug in GCC 2.x which causes memory exhaustion
+# when compiling sha1 with optimizations on UltraSPARC.
+#
+FIX_SHA1='#'
+if test "$GCC" -a "$host_cpu" = "sparc64"; then
+  AC_MSG_CHECKING(whether to enable GCC 2.x workaround for SHA1)
+  AC_TRY_COMPILE(
+    [
+      #if defined(__sparc64__) && (__GNUC__ == 2)
+      #else
+      choke me
+      #endif
+    ],
+    [],
+    [
+      FIX_SHA1=''
+      AC_MSG_RESULT(yes)
+    ],
+      AC_MSG_RESULT(no)
+    )
+fi
+AC_SUBST(FIX_SHA1)
 
 ##
 ##  Installation
index 47f7204491e8e6810f2b9556744055b1bb07944b..3dd281ca453b60687de3d847b636417272633bcf 100644 (file)
@@ -73,3 +73,10 @@ endif
 EXTRA_DIST = *.h tests
 
 include $(top_srcdir)/Makefile.defines.in
+
+# Workaround a bug in GCC 2.x which causes memory exhaustion
+# when compiling sha1 with optimizations on UltraSPARC.
+#
+@FIX_SHA1@sha1.lo:
+@FIX_SHA1@     $(LTCOMPILE) -O0 -c -o $@ `test -f 'sha1.c' || echo '$(srcdir)/'`sha1.c
+@FIX_SHA1@