Skip to content

Commit a61c7c3

Browse files
author
Joerg Bruehe
committed
First version of supporting the build of RPMs for ULN
from the MySQL 5.5 source tree. This change adds the spec file for these ULN RPMs as well as several patches and additional sources, to be used only in ULN RPMs. All these files are in a new directory "SPECIFIC-ULN/". This commit is for internal tool tests only, not yet ready for publishing.
1 parent f29bfa7 commit a61c7c3

19 files changed

+1275
-0
lines changed

SPECIFIC-ULN/README-ULN

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
In order to have RPMs of MySQL which are distributed via ULN for Oracle Linux
2+
to be as closely compatible to such RPMs built and distributed by RedHat,
3+
this directory contains additional files which originated at RedHat
4+
and are used only for such RPMs intended for distribution via ULN.
5+
6+
Especially, this directory contains the spec file used to build these RPMs,
7+
named "mysql.spec". Please regard the following note:
8+
9+
You are receiving a copy of the Red Hat spec file.
10+
The terms of the Oracle license do NOT apply to the Red Hat spec file;
11+
it is licensed under the
12+
GNU GENERAL PUBLIC LICENSE Version 2, June 1991
13+
separately from the Oracle programs you receive.
14+
15+

SPECIFIC-ULN/README.mysql-docs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The official MySQL documentation is not freely redistributable, so we cannot
2+
include it in RHEL or Fedora. You can find it on-line at
3+
4+
http://dev.mysql.com/doc/

SPECIFIC-ULN/filter-requires-mysql.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
/usr/lib/rpm/perl.req $* | grep -v -e "perl(th" -e "perl(lib::mtr" -e "perl(mtr"

SPECIFIC-ULN/generate-tarball.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
VERSION=$1
4+
5+
rm -rf mysql-$VERSION
6+
7+
tar xfz mysql-$VERSION.tar.gz || exit 1
8+
9+
rm mysql-$VERSION/Docs/mysql.info
10+
11+
tar cfz mysql-$VERSION-nodocs.tar.gz mysql-$VERSION || exit 1
12+
13+
rm -rf mysql-$VERSION
14+
15+
exit 0

SPECIFIC-ULN/my.cnf

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[mysqld]
2+
datadir=/var/lib/mysql
3+
socket=/var/lib/mysql/mysql.sock
4+
user=mysql
5+
# Disabling symbolic-links is recommended to prevent assorted security risks
6+
symbolic-links=0
7+
8+
[mysqld_safe]
9+
log-error=/var/log/mysqld.log
10+
pid-file=/var/run/mysqld/mysqld.pid

SPECIFIC-ULN/my_config.h

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Kluge to support multilib installation of both 32- and 64-bit RPMS:
3+
* we need to arrange that header files that appear in both RPMs are
4+
* identical. Hence, this file is architecture-independent and calls
5+
* in an arch-dependent file that will appear in just one RPM.
6+
*
7+
* To avoid breaking arches not explicitly supported by Red Hat, we
8+
* use this indirection file *only* on known multilib arches.
9+
*
10+
* Note: this may well fail if user tries to use gcc's -I- option.
11+
* But that option is deprecated anyway.
12+
*/
13+
#if defined(__x86_64__)
14+
#include "my_config_x86_64.h"
15+
#elif defined(__i386__)
16+
#include "my_config_i386.h"
17+
#elif defined(__ppc64__) || defined(__powerpc64__)
18+
#include "my_config_ppc64.h"
19+
#elif defined(__ppc__) || defined(__powerpc__)
20+
#include "my_config_ppc.h"
21+
#elif defined(__s390x__)
22+
#include "my_config_s390x.h"
23+
#elif defined(__s390__)
24+
#include "my_config_s390.h"
25+
#elif defined(__sparc__) && defined(__arch64__)
26+
#include "my_config_sparc64.h"
27+
#elif defined(__sparc__)
28+
#include "my_config_sparc.h"
29+
#endif

SPECIFIC-ULN/mysql-5.5-errno.patch

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"extern int errno" is just a really bad idea.
2+
3+
4+
diff -Naur mysql-5.1.32.orig/include/my_sys.h mysql-5.1.32/include/my_sys.h
5+
--- mysql-5.1.32.orig/include/my_sys.h 2009-02-13 19:52:19.000000000 -0500
6+
+++ mysql-5.1.32/include/my_sys.h 2009-03-04 18:08:40.000000000 -0500
7+
@@ -199,13 +199,8 @@
8+
#define my_afree(PTR) my_free(PTR)
9+
#endif /* HAVE_ALLOCA */
10+
11+
-#ifndef errno /* did we already get it? */
12+
-#ifdef HAVE_ERRNO_AS_DEFINE
13+
#include <errno.h> /* errno is a define */
14+
-#else
15+
-extern int errno; /* declare errno */
16+
-#endif
17+
-#endif /* #ifndef errno */
18+
+
19+
extern char *home_dir; /* Home directory for user */
20+
extern const char *my_progname; /* program-name (printed in errors) */
21+
extern char curr_dir[]; /* Current directory for user */
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Adapt tests (where needed) to RedHat conventions.
2+
3+
1) The RedHat convention uses the package name "mysql*" whereas upstream uses "MySQL*".
4+
Test "file_contents" constructs path names and needs to be adapted.
5+
6+
=== modified file 'mysql-test/t/file_contents.test'
7+
--- mysql-5.5.17-orig/mysql-test/t/file_contents.test 2011-10-10 12:03:29 +0000
8+
+++ mysql-5.5.17/mysql-test/t/file_contents.test 2011-11-16 18:07:55 +0000
9+
@@ -17,20 +17,20 @@ if ($dir_bin =~ m|/usr/|) {
10+
$dir_docs =~ s|/lib|/share/doc|;
11+
if(-d "$dir_docs/packages") {
12+
# SuSE: "packages/" in the documentation path
13+
- $dir_docs = glob "$dir_docs/packages/MySQL-server*";
14+
+ $dir_docs = glob "$dir_docs/packages/mysql-server*";
15+
} else {
16+
# RedHat: version number in directory name
17+
- $dir_docs = glob "$dir_docs/MySQL-server*";
18+
+ $dir_docs = glob "$dir_docs/mysql-server*";
19+
}
20+
} elsif ($dir_bin =~ m|/usr$|) {
21+
# RPM build during development
22+
$dir_docs = "$dir_bin/share/doc";
23+
if(-d "$dir_docs/packages") {
24+
# SuSE: "packages/" in the documentation path
25+
- $dir_docs = glob "$dir_docs/packages/MySQL-server*";
26+
+ $dir_docs = glob "$dir_docs/packages/mysql-server*";
27+
} else {
28+
# RedHat: version number in directory name
29+
- $dir_docs = glob "$dir_docs/MySQL-server*";
30+
+ $dir_docs = glob "$dir_docs/mysql-server*";
31+
}
32+
} else {
33+
# tar.gz package, Windows, or developer work (in BZR)
34+

SPECIFIC-ULN/mysql-5.5-libdir.patch

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
The RPMs built by MySQL AB (-> Sun -> Oracle) put the libraries into "/usr/lib".
2+
Those built by RedHat put them into "/usr/lib/mysql".
3+
This patch is to modify the cmake files to follow the RedHat convention.
4+
Similar, the server is now in "/usr/libexec" (formerly "/usr/sbin").
5+
6+
7+
diff -Naur mysql-5.5.17.orig/cmake/install_layout.cmake mysql-5.5.17/cmake/install_layout.cmake
8+
--- mysql-5.5.17.orig/cmake/install_layout.cmake 2011-06-30 15:46:53 +0000
9+
+++ mysql-5.5.17/cmake/install_layout.cmake 2011-10-27 16:40:10 +0000
10+
@@ -135,14 +135,14 @@ SET(INSTALL_SBINDIR_RPM
11+
# RPM layout
12+
#
13+
SET(INSTALL_BINDIR_RPM "bin")
14+
-SET(INSTALL_SBINDIR_RPM "sbin")
15+
+SET(INSTALL_SBINDIR_RPM "libexec")
16+
SET(INSTALL_SCRIPTDIR_RPM "bin")
17+
#
18+
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
19+
- SET(INSTALL_LIBDIR_RPM "lib64")
20+
+ SET(INSTALL_LIBDIR_RPM "lib64/mysql")
21+
SET(INSTALL_PLUGINDIR_RPM "lib64/mysql/plugin")
22+
ELSE()
23+
- SET(INSTALL_LIBDIR_RPM "lib")
24+
+ SET(INSTALL_LIBDIR_RPM "lib/mysql")
25+
SET(INSTALL_PLUGINDIR_RPM "lib/mysql/plugin")
26+
ENDIF()
27+
#
28+

SPECIFIC-ULN/mysql-5.5-mtr1.patch

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Drop support for version 1 of "mysql-test-run.pl" from the RPMs:
2+
3+
1) The auto-generation of Perl dependencies will mishandle that code,
4+
probably because its run directory differs from its storage location.
5+
2) It does not provide several variables which are used in tests of MySQL 5.5
6+
7+
If you really need it, take it from the source tarball.
8+
9+
=== modified file 'mysql-test/mysql-test-run.pl'
10+
--- mysql-5.5.17-orig/mysql-test/mysql-test-run.pl 2011-10-03 11:16:40 +0000
11+
+++ mysql-5.5.17/mysql-test/mysql-test-run.pl 2011-11-16 19:06:38 +0000
12+
@@ -58,10 +58,9 @@ BEGIN {
13+
if ( $version == 1 )
14+
{
15+
print "=======================================================\n";
16+
- print " WARNING: Using mysql-test-run.pl version 1! \n";
17+
+ print " ERROR: Support for version 1 is dropped in this distribution! \n";
18+
print "=======================================================\n";
19+
- # Should use exec() here on *nix but this appears not to work on Windows
20+
- exit(system($^X, "lib/v1/mysql-test-run.pl", @ARGV) >> 8);
21+
+ exit(1);
22+
}
23+
elsif ( $version == 2 )
24+
{
25+
+140
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
mysql is not accounting for the "guard page" when setting thread stack size
2+
requests. This is fatal on PPC systems, which may use guard pages as large
3+
as 64K. This patch also documents the IA64 situation a bit better.
4+
5+
Note: there are quite a few other setstacksize calls besides the two in
6+
mysqld.cc; is it important to fix any of the others?
7+
8+
Filed upstream at http://bugs.mysql.com/bug.php?id=35019
9+
10+
11+
diff -Naur mysql-5.1.30.orig/sql/mysqld.cc mysql-5.1.30/sql/mysqld.cc
12+
--- mysql-5.1.30.orig/sql/mysqld.cc 2008-11-14 11:37:13.000000000 -0500
13+
+++ mysql-5.1.30/sql/mysqld.cc 2009-01-13 12:08:35.000000000 -0500
14+
@@ -2653,6 +2653,70 @@
15+
}
16+
17+
18+
+/* pthread_attr_setstacksize without so much platform-dependency */
19+
+/* returns the actual stack size if possible */
20+
+static size_t my_setstacksize(pthread_attr_t *attr, size_t stacksize)
21+
+{
22+
+ size_t guard_size = 0;
23+
+
24+
+#if defined(__ia64__) || defined(__ia64)
25+
+ /*
26+
+ On IA64, half of the requested stack size is used for "normal stack"
27+
+ and half for "register stack". The space measured by check_stack_overrun
28+
+ is the "normal stack", so double the request to make sure we have the
29+
+ caller-expected amount of normal stack.
30+
+
31+
+ NOTE: there is no guarantee that the register stack can't grow faster
32+
+ than normal stack, so it's very unclear that we won't dump core due to
33+
+ stack overrun despite check_stack_overrun's efforts. Experimentation
34+
+ shows that in the execution_constants test, the register stack grows
35+
+ less than half as fast as normal stack, but perhaps other scenarios are
36+
+ less forgiving. If it turns out that more space is needed for the
37+
+ register stack, that could be forced (rather inefficiently) by using a
38+
+ multiplier higher than 2 here.
39+
+ */
40+
+ stacksize *= 2;
41+
+#endif
42+
+
43+
+ /*
44+
+ On many machines, the "guard space" is subtracted from the requested
45+
+ stack size, and that space is quite large on some platforms. So add
46+
+ it to our request, if we can find out what it is.
47+
+
48+
+ FIXME: autoconfiscate use of pthread_attr_getguardsize
49+
+ */
50+
+ if (pthread_attr_getguardsize(attr, &guard_size))
51+
+ guard_size = 0; /* if can't find it out, treat as 0 */
52+
+
53+
+ pthread_attr_setstacksize(attr, stacksize + guard_size);
54+
+
55+
+ /* Retrieve actual stack size if possible */
56+
+#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
57+
+ {
58+
+ size_t real_stack_size= 0;
59+
+ /* We must ignore real_stack_size = 0 as Solaris 2.9 can return 0 here */
60+
+ if (pthread_attr_getstacksize(attr, &real_stack_size) == 0 &&
61+
+ real_stack_size > guard_size)
62+
+ {
63+
+ real_stack_size -= guard_size;
64+
+ if (real_stack_size < stacksize)
65+
+ {
66+
+ if (global_system_variables.log_warnings)
67+
+ sql_print_warning("Asked for %ld thread stack, but got %ld",
68+
+ (long) stacksize, (long) real_stack_size);
69+
+ stacksize= real_stack_size;
70+
+ }
71+
+ }
72+
+ }
73+
+#endif
74+
+
75+
+#if defined(__ia64__) || defined(__ia64)
76+
+ stacksize /= 2;
77+
+#endif
78+
+ return stacksize;
79+
+}
80+
+
81+
+
82+
static void start_signal_handler(void)
83+
{
84+
int error;
85+
@@ -2663,15 +2727,7 @@
86+
#if !defined(HAVE_DEC_3_2_THREADS)
87+
pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_SYSTEM);
88+
(void) pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
89+
-#if defined(__ia64__) || defined(__ia64)
90+
- /*
91+
- Peculiar things with ia64 platforms - it seems we only have half the
92+
- stack size in reality, so we have to double it here
93+
- */
94+
- pthread_attr_setstacksize(&thr_attr,my_thread_stack_size*2);
95+
-#else
96+
- pthread_attr_setstacksize(&thr_attr,my_thread_stack_size);
97+
-#endif
98+
+ (void) my_setstacksize(&thr_attr,my_thread_stack_size);
99+
#endif
100+
101+
mysql_mutex_lock(&LOCK_thread_count);
102+
@@ -4445,37 +4501,7 @@
103+
unireg_abort(1); // Will do exit
104+
105+
init_signals();
106+
-#if defined(__ia64__) || defined(__ia64)
107+
- /*
108+
- Peculiar things with ia64 platforms - it seems we only have half the
109+
- stack size in reality, so we have to double it here
110+
- */
111+
- pthread_attr_setstacksize(&connection_attrib,my_thread_stack_size*2);
112+
-#else
113+
- pthread_attr_setstacksize(&connection_attrib,my_thread_stack_size);
114+
-#endif
115+
-#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
116+
- {
117+
- /* Retrieve used stack size; Needed for checking stack overflows */
118+
- size_t stack_size= 0;
119+
- pthread_attr_getstacksize(&connection_attrib, &stack_size);
120+
-#if defined(__ia64__) || defined(__ia64)
121+
- stack_size/= 2;
122+
-#endif
123+
- /* We must check if stack_size = 0 as Solaris 2.9 can return 0 here */
124+
- if (stack_size && stack_size < my_thread_stack_size)
125+
- {
126+
- if (global_system_variables.log_warnings)
127+
- sql_print_warning("Asked for %lu thread stack, but got %ld",
128+
- my_thread_stack_size, (long) stack_size);
129+
-#if defined(__ia64__) || defined(__ia64)
130+
- my_thread_stack_size= stack_size*2;
131+
-#else
132+
- my_thread_stack_size= stack_size;
133+
-#endif
134+
- }
135+
- }
136+
-#endif
137+
+ my_thread_stack_size = my_setstacksize(&connection_attrib,my_thread_stack_size);
138+
139+
(void) thr_setconcurrency(concurrency); // 10 by default
140+

SPECIFIC-ULN/mysql-5.5-testing.patch

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Hack the top-level Makefile to enable the openssl regression tests.
2+
(Why doesn't this happen automatically given the configure option??)
3+
4+
Also, increase the overall timeout for the regression tests to 12 hours,
5+
because on a slow or heavily-loaded build machine sometimes the default of
6+
5 hours isn't enough. (This has been demonstrated to fail in mass-rebuild
7+
scenarios, which aren't that uncommon for Fedora.) Similarly increase the
8+
per-testcase timeout to 30 minutes, since the default of 15 hasn't got a
9+
great deal of headroom either.
10+
11+
12+
diff -Naur mysql-5.1.32.orig/Makefile.am mysql-5.1.32/Makefile.am
13+
--- mysql-5.1.32.orig/Makefile.am 2009-02-13 19:51:56.000000000 -0500
14+
+++ mysql-5.1.32/Makefile.am 2009-03-04 18:12:36.000000000 -0500
15+
@@ -98,7 +98,7 @@
16+
17+
test-ns:
18+
cd mysql-test ; \
19+
- @PERL@ ./mysql-test-run.pl $(force) $(mem) --mysqld=--binlog-format=mixed
20+
+ @PERL@ ./mysql-test-run.pl $(force) $(mem) --ssl --mysqld=--binlog-format=mixed --suite-timeout=720 --testcase-timeout=30
21+
22+
test-binlog-statement:
23+
cd mysql-test ; \

0 commit comments

Comments
 (0)