assorted fixes for sparc

This commit is contained in:
Tom Lane 2009-10-16 04:26:47 +00:00 committed by Michal Schorm
parent 07e69085bc
commit 996358c08e
4 changed files with 49 additions and 4 deletions

View File

@ -4,13 +4,14 @@
* identical. Hence, this file is architecture-independent and calls * identical. Hence, this file is architecture-independent and calls
* in an arch-dependent file that will appear in just one RPM. * 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. * Note: this may well fail if user tries to use gcc's -I- option.
* But that option is deprecated anyway. * But that option is deprecated anyway.
*/ */
#if defined(__x86_64__) #if defined(__x86_64__)
#include "my_config_x86_64.h" #include "my_config_x86_64.h"
#elif defined(__ia64__)
#include "my_config_ia64.h"
#elif defined(__i386__) #elif defined(__i386__)
#include "my_config_i386.h" #include "my_config_i386.h"
#elif defined(__ppc64__) || defined(__powerpc64__) #elif defined(__ppc64__) || defined(__powerpc64__)
@ -21,4 +22,8 @@
#include "my_config_s390x.h" #include "my_config_s390x.h"
#elif defined(__s390__) #elif defined(__s390__)
#include "my_config_s390.h" #include "my_config_s390.h"
#elif defined(__sparc__) && defined(__arch64__)
#include "my_config_sparc64.h"
#elif defined(__sparc__)
#include "my_config_sparc.h"
#endif #endif

22
mysql-sparc-gcc-bug.patch Normal file
View File

@ -0,0 +1,22 @@
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];
}

View File

@ -1,6 +1,6 @@
Name: mysql Name: mysql
Version: 5.1.39 Version: 5.1.39
Release: 2%{?dist} Release: 3%{?dist}
Summary: MySQL client programs and shared libraries Summary: MySQL client programs and shared libraries
Group: Applications/Databases Group: Applications/Databases
URL: http://www.mysql.com URL: http://www.mysql.com
@ -33,6 +33,7 @@ Patch7: mysql-plugin-bug.patch
Patch8: mysql-setschedparam.patch Patch8: mysql-setschedparam.patch
Patch9: mysql-ndb-stacksize.patch Patch9: mysql-ndb-stacksize.patch
Patch10: mysql-strmov.patch Patch10: mysql-strmov.patch
Patch11: mysql-sparc-gcc-bug.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: gperf, perl, readline-devel, openssl-devel BuildRequires: gperf, perl, readline-devel, openssl-devel
@ -176,6 +177,7 @@ the MySQL sources.
%patch8 -p1 %patch8 -p1
%patch9 -p1 %patch9 -p1
%patch10 -p1 %patch10 -p1
%patch11 -p1
libtoolize --force libtoolize --force
aclocal aclocal
@ -190,6 +192,11 @@ CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
CFLAGS="$CFLAGS -fno-strict-aliasing -fwrapv" CFLAGS="$CFLAGS -fno-strict-aliasing -fwrapv"
# force PIC mode so that we can build libmysqld.so # force PIC mode so that we can build libmysqld.so
CFLAGS="$CFLAGS -fPIC" 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 # extra C++ flags as per recommendations in mysql's INSTALL-SOURCE doc
CXXFLAGS="$CFLAGS -felide-constructors -fno-rtti -fno-exceptions" CXXFLAGS="$CFLAGS -felide-constructors -fno-rtti -fno-exceptions"
export CFLAGS CXXFLAGS export CFLAGS CXXFLAGS
@ -263,7 +270,7 @@ rm -rf $RPM_BUILD_ROOT
# multilib header hacks # multilib header hacks
# we only apply this to known Red Hat multilib arches, per bug #181335 # we only apply this to known Red Hat multilib arches, per bug #181335
case `uname -i` in 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 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/ 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 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* %{_mandir}/man1/mysql_client_test.1*
%changelog %changelog
* Thu Oct 15 2009 Tom Lane <tgl@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@redhat.com> 5.1.39-2 * Wed Sep 23 2009 Tom Lane <tgl@redhat.com> 5.1.39-2
- Work around upstream bug 46895 by disabling outfile_loaddata test - Work around upstream bug 46895 by disabling outfile_loaddata test

View File

@ -22,4 +22,8 @@
#include "ndb_types_s390x.h" #include "ndb_types_s390x.h"
#elif defined(__s390__) #elif defined(__s390__)
#include "ndb_types_s390.h" #include "ndb_types_s390.h"
#elif defined(__sparc__) && defined(__arch64__)
#include "ndb_types_sparc64.h"
#elif defined(__sparc__)
#include "ndb_types_sparc.h"
#endif #endif