rpms/mysql/devel mysql-sparc-gcc-bug.patch, NONE, 1.1 my_config.h, 1.3, 1.4 mysql.spec, 1.130, 1.131 ndb_types.h, 1.1, 1.2

Tom Lane tgl at fedoraproject.org
Fri Oct 16 04:26:47 UTC 2009


Author: tgl

Update of /cvs/pkgs/rpms/mysql/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv6312

Modified Files:
	my_config.h mysql.spec ndb_types.h 
Added Files:
	mysql-sparc-gcc-bug.patch 
Log Message:
assorted fixes for sparc

mysql-sparc-gcc-bug.patch:
 DbaccMain.cpp |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

--- NEW FILE mysql-sparc-gcc-bug.patch ---
This is a temporary workaround for what is surely a gcc bug on Sparc.
Submitted as bz #529299


diff -Naur mysql-5.1.39.orig/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp mysql-5.1.39/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
--- mysql-5.1.39.orig/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp	2009-09-04 12:21:16.000000000 -0400
+++ mysql-5.1.39/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp	2009-10-15 22:19:07.000000000 -0400
@@ -8538,11 +8538,7 @@
   default:
     tmp = 0;
   }
-  memcpy(signal->theData, &tmp, 8); /* must be memcpy, gives strange results on
-				     * ithanium gcc (GCC) 3.4.1 smp linux 2.4
-				     * otherwise
-				     */
-  //  Uint32 * src = (Uint32*)&tmp;
-  //  signal->theData[0] = src[0];
-  //  signal->theData[1] = src[1];
+  Uint32 * src = (Uint32*)&tmp;
+  signal->theData[0] = src[0];
+  signal->theData[1] = src[1];
 }


Index: my_config.h
===================================================================
RCS file: /cvs/pkgs/rpms/mysql/devel/my_config.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- my_config.h	15 Dec 2005 17:04:25 -0000	1.3
+++ my_config.h	16 Oct 2009 04:26:47 -0000	1.4
@@ -4,13 +4,14 @@
  * identical.  Hence, this file is architecture-independent and calls
  * in an arch-dependent file that will appear in just one RPM.
  *
+ * To avoid breaking arches not explicitly supported by Red Hat, we
+ * use this indirection file *only* on known multilib arches.
+ *
  * Note: this may well fail if user tries to use gcc's -I- option.
  * But that option is deprecated anyway.
  */
 #if defined(__x86_64__)
 #include "my_config_x86_64.h"
-#elif defined(__ia64__)
-#include "my_config_ia64.h"
 #elif defined(__i386__)
 #include "my_config_i386.h"
 #elif defined(__ppc64__) || defined(__powerpc64__)
@@ -21,4 +22,8 @@
 #include "my_config_s390x.h"
 #elif defined(__s390__)
 #include "my_config_s390.h"
+#elif defined(__sparc__) && defined(__arch64__)
+#include "my_config_sparc64.h"
+#elif defined(__sparc__)
+#include "my_config_sparc.h"
 #endif


Index: mysql.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mysql/devel/mysql.spec,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -p -r1.130 -r1.131
--- mysql.spec	23 Sep 2009 23:32:00 -0000	1.130
+++ mysql.spec	16 Oct 2009 04:26:47 -0000	1.131
@@ -1,6 +1,6 @@
 Name: mysql
 Version: 5.1.39
-Release: 2%{?dist}
+Release: 3%{?dist}
 Summary: MySQL client programs and shared libraries
 Group: Applications/Databases
 URL: http://www.mysql.com
@@ -33,6 +33,7 @@ Patch7: mysql-plugin-bug.patch
 Patch8: mysql-setschedparam.patch
 Patch9: mysql-ndb-stacksize.patch
 Patch10: mysql-strmov.patch
+Patch11: mysql-sparc-gcc-bug.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 BuildRequires: gperf, perl, readline-devel, openssl-devel
@@ -176,6 +177,7 @@ the MySQL sources.
 %patch8 -p1
 %patch9 -p1
 %patch10 -p1
+%patch11 -p1
 
 libtoolize --force
 aclocal
@@ -190,6 +192,11 @@ CFLAGS="%{optflags} -D_GNU_SOURCE -D_FIL
 CFLAGS="$CFLAGS -fno-strict-aliasing -fwrapv"
 # force PIC mode so that we can build libmysqld.so
 CFLAGS="$CFLAGS -fPIC"
+# gcc seems to have some bugs on sparc as of 4.4.1, back off optimization
+# submitted as bz #529298
+%ifarch sparc sparcv9 sparc64
+CFLAGS=`echo $CFLAGS| sed -e "s|-O2|-O1|g" `
+%endif
 # extra C++ flags as per recommendations in mysql's INSTALL-SOURCE doc
 CXXFLAGS="$CFLAGS -felide-constructors -fno-rtti -fno-exceptions"
 export CFLAGS CXXFLAGS
@@ -263,7 +270,7 @@ rm -rf $RPM_BUILD_ROOT
 # multilib header hacks
 # we only apply this to known Red Hat multilib arches, per bug #181335
 case `uname -i` in
-  i386 | x86_64 | ppc | ppc64 | s390 | s390x | sparc | sparcv9 | sparc64 )
+  i386 | x86_64 | ppc | ppc64 | s390 | s390x | sparc | sparc64 )
     mv $RPM_BUILD_ROOT/usr/include/mysql/my_config.h $RPM_BUILD_ROOT/usr/include/mysql/my_config_`uname -i`.h
     install -m 644 %{SOURCE5} $RPM_BUILD_ROOT/usr/include/mysql/
     mv $RPM_BUILD_ROOT/usr/include/mysql/storage/ndb/ndb_types.h $RPM_BUILD_ROOT/usr/include/mysql/storage/ndb/ndb_types_`uname -i`.h
@@ -642,6 +649,13 @@ fi
 %{_mandir}/man1/mysql_client_test.1*
 
 %changelog
+* Thu Oct 15 2009 Tom Lane <tgl at redhat.com> 5.1.39-3
+- Work around two different compiler bugs on sparc, one by backing off
+  optimization from -O2 to -O1, and the other with a klugy patch
+Related: #529298, #529299
+- Clean up bogosity in multilib stub header support: ia64 should not be
+  listed (it's not multilib), sparc and sparc64 should be
+
 * Wed Sep 23 2009 Tom Lane <tgl at redhat.com> 5.1.39-2
 - Work around upstream bug 46895 by disabling outfile_loaddata test
 


Index: ndb_types.h
===================================================================
RCS file: /cvs/pkgs/rpms/mysql/devel/ndb_types.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- ndb_types.h	27 Jul 2008 17:54:30 -0000	1.1
+++ ndb_types.h	16 Oct 2009 04:26:47 -0000	1.2
@@ -22,4 +22,8 @@
 #include "ndb_types_s390x.h"
 #elif defined(__s390__)
 #include "ndb_types_s390.h"
+#elif defined(__sparc__) && defined(__arch64__)
+#include "ndb_types_sparc64.h"
+#elif defined(__sparc__)
+#include "ndb_types_sparc.h"
 #endif




More information about the fedora-extras-commits mailing list