tstellar / rpms / gcc

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