Blame SOURCES/gcc44-i386-libgomp.patch

f28b6a
Build i386.rpm libgomp and libsupc++.a(guard.o) as i486+, pre-i486
f28b6a
hardware isn't supported because NPTL doesn't support it anyway.
f28b6a
f28b6a
--- libgomp/configure.tgt.jj	2008-01-10 20:53:48.000000000 +0100
f28b6a
+++ libgomp/configure.tgt	2008-03-27 12:44:51.000000000 +0100
f28b6a
@@ -44,14 +44,14 @@ if test $enable_linux_futex = yes; then
f28b6a
 	;;
f28b6a
 
f28b6a
     # Note that bare i386 is not included here.  We need cmpxchg.
f28b6a
-    i[456]86-*-linux*)
f28b6a
+    i[3456]86-*-linux*)
f28b6a
 	config_path="linux/x86 linux posix"
f28b6a
 	case " ${CC} ${CFLAGS} " in
f28b6a
 	  *" -m64 "*)
f28b6a
 	    ;;
f28b6a
 	  *)
f28b6a
 	    if test -z "$with_arch"; then
f28b6a
-	      XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
f28b6a
+	      XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
f28b6a
 	    fi
f28b6a
 	esac
f28b6a
 	;;
f28b6a
@@ -63,7 +63,7 @@ if test $enable_linux_futex = yes; then
f28b6a
 	config_path="linux/x86 linux posix"
f28b6a
 	case " ${CC} ${CFLAGS} " in
f28b6a
 	  *" -m32 "*)
f28b6a
-	    XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686"
f28b6a
+	    XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
f28b6a
 	    ;;
f28b6a
 	esac
f28b6a
 	;;
f28b6a
--- libstdc++-v3/libsupc++/guard.cc.jj	2008-03-01 00:58:24.000000000 +0100
f28b6a
+++ libstdc++-v3/libsupc++/guard.cc	2008-03-27 14:08:44.000000000 +0100
f28b6a
@@ -35,6 +35,27 @@
f28b6a
 #include <new>
f28b6a
 #include <ext/atomicity.h>
f28b6a
 #include <ext/concurrence.h>
f28b6a
+#if defined __i386__ && !defined _GLIBCXX_ATOMIC_BUILTINS_4
f28b6a
+# define _GLIBCXX_ATOMIC_BUILTINS_4 1
f28b6a
+# define __sync_val_compare_and_swap(a, b, c) \
f28b6a
+  ({								\
f28b6a
+     typedef char sltast[sizeof (*a) == sizeof (int) ? 1 : -1];	\
f28b6a
+     int sltas;							\
f28b6a
+     __asm __volatile ("lock; cmpxchgl %3, (%1)"		\
f28b6a
+		       : "=a" (sltas)				\
f28b6a
+		       : "r" (a), "0" (b), "r" (c) : "memory");	\
f28b6a
+     sltas;							\
f28b6a
+   })
f28b6a
+# define __sync_lock_test_and_set(a, b) \
f28b6a
+  ({								\
f28b6a
+     typedef char sltast[sizeof (*a) == sizeof (int) ? 1 : -1];	\
f28b6a
+     int sltas;							\
f28b6a
+     __asm __volatile ("xchgl (%1), %0"				\
f28b6a
+		       : "=r" (sltas)				\
f28b6a
+		       : "r" (a), "0" (b) : "memory");		\
f28b6a
+     sltas;							\
f28b6a
+   })
f28b6a
+#endif
f28b6a
 #if defined(__GTHREADS) && defined(__GTHREAD_HAS_COND) \
f28b6a
     && defined(_GLIBCXX_ATOMIC_BUILTINS_4) && defined(_GLIBCXX_HAVE_LINUX_FUTEX)
f28b6a
 # include <climits>