From a194717828103f1b15cac550d9e7e5436366202e Mon Sep 17 00:00:00 2001 From: Stefan Fiedler Date: Wed, 26 Jan 2005 15:56:50 +0000 Subject: [PATCH] Stefan Fiedler: mysql: patch for linux 2.6.10 - in client/mysqltest.c, mysqld/examples/mysqltest.c and extra/replace.c, rename set_bit() to set_bit_() and clear_bit() to clear_bit_(), to avoid conflicts with functions from /usr/include/asm/bitops.h - in includes/my_global.h, explicitly #define CONFIG_NR_CPUS; this should really be a command line option to gcc (-D CONFIG_NR_CPUS=1) and have the same value as in the linux config for SMP machines linux: rename the variable 'new' in include/asm-i386/system.h to something else to avoid errors with g++ Index: package/base/linux/linux26/76-no-new-variable.patch =================================================================== [2005010401052224873] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@5495 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- .../linux/linux26/76-no-new-variable.patch | 33 +++ package/clifford/mysql/linux-2.6.10.patch | 272 ++++++++++++++++++ 2 files changed, 305 insertions(+) create mode 100644 package/base/linux/linux26/76-no-new-variable.patch create mode 100644 package/clifford/mysql/linux-2.6.10.patch diff --git a/package/base/linux/linux26/76-no-new-variable.patch b/package/base/linux/linux26/76-no-new-variable.patch new file mode 100644 index 000000000..3bddbdffd --- /dev/null +++ b/package/base/linux/linux26/76-no-new-variable.patch @@ -0,0 +1,33 @@ +--- ./include/asm-i386/system.h 2004-12-29 20:54:20.072258656 +0000 ++++ ./include/asm-i386/system.h-p 2004-12-29 21:11:17.462591816 +0000 +@@ -244,26 +244,26 @@ + #endif + + static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, +- unsigned long new, int size) ++ unsigned long ulnew, int size) + { + unsigned long prev; + switch (size) { + case 1: + __asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2" + : "=a"(prev) +- : "q"(new), "m"(*__xg(ptr)), "0"(old) ++ : "q"(ulnew), "m"(*__xg(ptr)), "0"(old) + : "memory"); + return prev; + case 2: + __asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2" + : "=a"(prev) +- : "q"(new), "m"(*__xg(ptr)), "0"(old) ++ : "q"(ulnew), "m"(*__xg(ptr)), "0"(old) + : "memory"); + return prev; + case 4: + __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2" + : "=a"(prev) +- : "q"(new), "m"(*__xg(ptr)), "0"(old) ++ : "q"(ulnew), "m"(*__xg(ptr)), "0"(old) + : "memory"); + return prev; + } diff --git a/package/clifford/mysql/linux-2.6.10.patch b/package/clifford/mysql/linux-2.6.10.patch new file mode 100644 index 000000000..affbd3a4c --- /dev/null +++ b/package/clifford/mysql/linux-2.6.10.patch @@ -0,0 +1,272 @@ +diff -dur mysql-4.1.7/client/mysqltest.c src.mysql.1104350495.30814.396807788/mysql-4.1.7/client/mysqltest.c +--- mysql-4.1.7/client/mysqltest.c 2004-10-23 07:28:47.000000000 +0000 ++++ src.mysql.1104350495.30814.396807788/mysql-4.1.7/client/mysqltest.c 2004-12-30 02:35:57.000000000 +0000 +@@ -3272,8 +3272,8 @@ + static void make_sets_invisible(REP_SETS *sets); + static void free_last_set(REP_SETS *sets); + static void free_sets(REP_SETS *sets); +-static void set_bit(REP_SET *set, uint bit); +-static void clear_bit(REP_SET *set, uint bit); ++static void set_bit_(REP_SET *set, uint bit); ++static void clear_bit_(REP_SET *set, uint bit); + static void or_bits(REP_SET *to,REP_SET *from); + static void copy_bits(REP_SET *to,REP_SET *from); + static int cmp_bits(REP_SET *set1,REP_SET *set2); +@@ -3350,7 +3350,7 @@ + { + if (from[i][0] == '\\' && from[i][1] == '^') + { +- set_bit(start_states,states+1); ++ set_bit_(start_states,states+1); + if (!from[i][2]) + { + start_states->table_offset=i; +@@ -3359,8 +3359,8 @@ + } + else if (from[i][0] == '\\' && from[i][1] == '$') + { +- set_bit(start_states,states); +- set_bit(word_states,states); ++ set_bit_(start_states,states); ++ set_bit_(word_states,states); + if (!from[i][2] && start_states->table_offset == (uint) ~0) + { + start_states->table_offset=i; +@@ -3369,11 +3369,11 @@ + } + else + { +- set_bit(word_states,states); ++ set_bit_(word_states,states); + if (from[i][0] == '\\' && (from[i][1] == 'b' && from[i][2])) +- set_bit(start_states,states+1); ++ set_bit_(start_states,states+1); + else +- set_bit(start_states,states); ++ set_bit_(start_states,states); + } + for (pos=from[i], len=0; *pos ; pos++) + { +@@ -3479,9 +3479,9 @@ + follow[i].len > found_end) + found_end=follow[i].len; + if (chr && follow[i].chr) +- set_bit(new_set,i+1); /* To next set */ ++ set_bit_(new_set,i+1); /* To next set */ + else +- set_bit(new_set,i); ++ set_bit_(new_set,i); + } + } + if (found_end) +@@ -3498,7 +3498,7 @@ + if (follow[bit_nr-1].len < found_end || + (new_set->found_len && + (chr == 0 || !follow[bit_nr].chr))) +- clear_bit(new_set,i); ++ clear_bit_(new_set,i); + else + { + if (chr == 0 || !follow[bit_nr].chr) +@@ -3647,13 +3647,13 @@ + return; + } + +-static void set_bit(REP_SET *set, uint bit) ++static void set_bit_(REP_SET *set, uint bit) + { + set->bits[bit / WORD_BIT] |= 1 << (bit % WORD_BIT); + return; + } + +-static void clear_bit(REP_SET *set, uint bit) ++static void clear_bit_(REP_SET *set, uint bit) + { + set->bits[bit / WORD_BIT] &= ~ (1 << (bit % WORD_BIT)); + return; +diff -dur mysql-4.1.7/extra/replace.c src.mysql.1104350495.30814.396807788/mysql-4.1.7/extra/replace.c +--- mysql-4.1.7/extra/replace.c 2004-10-23 07:28:45.000000000 +0000 ++++ src.mysql.1104350495.30814.396807788/mysql-4.1.7/extra/replace.c 2004-12-29 21:06:28.000000000 +0000 +@@ -376,8 +376,8 @@ + static void make_sets_invisible(REP_SETS *sets); + static void free_last_set(REP_SETS *sets); + static void free_sets(REP_SETS *sets); +-static void set_bit(REP_SET *set, uint bit); +-static void clear_bit(REP_SET *set, uint bit); ++static void set_bit_(REP_SET *set, uint bit); ++static void clear_bit_(REP_SET *set, uint bit); + static void or_bits(REP_SET *to,REP_SET *from); + static void copy_bits(REP_SET *to,REP_SET *from); + static int cmp_bits(REP_SET *set1,REP_SET *set2); +@@ -454,7 +454,7 @@ + { + if (from[i][0] == '\\' && from[i][1] == '^') + { +- set_bit(start_states,states+1); ++ set_bit_(start_states,states+1); + if (!from[i][2]) + { + start_states->table_offset=i; +@@ -463,8 +463,8 @@ + } + else if (from[i][0] == '\\' && from[i][1] == '$') + { +- set_bit(start_states,states); +- set_bit(word_states,states); ++ set_bit_(start_states,states); ++ set_bit_(word_states,states); + if (!from[i][2] && start_states->table_offset == (uint) ~0) + { + start_states->table_offset=i; +@@ -473,11 +473,11 @@ + } + else + { +- set_bit(word_states,states); ++ set_bit_(word_states,states); + if (from[i][0] == '\\' && (from[i][1] == 'b' && from[i][2])) +- set_bit(start_states,states+1); ++ set_bit_(start_states,states+1); + else +- set_bit(start_states,states); ++ set_bit_(start_states,states); + } + for (pos=from[i], len=0; *pos ; pos++) + { +@@ -583,9 +583,9 @@ + follow[i].len > found_end) + found_end=follow[i].len; + if (chr && follow[i].chr) +- set_bit(new_set,i+1); /* To next set */ ++ set_bit_(new_set,i+1); /* To next set */ + else +- set_bit(new_set,i); ++ set_bit_(new_set,i); + } + } + if (found_end) +@@ -602,7 +602,7 @@ + if (follow[bit_nr-1].len < found_end || + (new_set->found_len && + (chr == 0 || !follow[bit_nr].chr))) +- clear_bit(new_set,i); ++ clear_bit_(new_set,i); + else + { + if (chr == 0 || !follow[bit_nr].chr) +@@ -751,13 +751,13 @@ + return; + } + +-static void set_bit(REP_SET *set, uint bit) ++static void set_bit_(REP_SET *set, uint bit) + { + set->bits[bit / WORD_BIT] |= 1 << (bit % WORD_BIT); + return; + } + +-static void clear_bit(REP_SET *set, uint bit) ++static void clear_bit_(REP_SET *set, uint bit) + { + set->bits[bit / WORD_BIT] &= ~ (1 << (bit % WORD_BIT)); + return; +diff -dur mysql-4.1.7/include/my_global.h src.mysql.1104350495.30814.396807788/mysql-4.1.7/include/my_global.h +--- mysql-4.1.7/include/my_global.h 2004-10-23 07:28:43.000000000 +0000 ++++ src.mysql.1104350495.30814.396807788/mysql-4.1.7/include/my_global.h 2004-12-29 20:48:37.000000000 +0000 +@@ -287,9 +287,8 @@ + #ifndef CONFIG_SMP + #define CONFIG_SMP + #endif +-C_MODE_START ++#define CONFIG_NR_CPUS 1 + #include +-C_MODE_END + #endif + #include /* Recommended by debian */ + /* We need the following to go around a problem with openssl on solaris */ +diff -dur mysql-4.1.7/libmysqld/examples/mysqltest.c src.mysql.1104350495.30814.396807788/mysql-4.1.7/libmysqld/examples/mysqltest.c +--- mysql-4.1.7/libmysqld/examples/mysqltest.c 2004-10-23 07:28:47.000000000 +0000 ++++ src.mysql.1104350495.30814.396807788/mysql-4.1.7/libmysqld/examples/mysqltest.c 2004-12-30 02:35:57.000000000 +0000 +@@ -3272,8 +3272,8 @@ + static void make_sets_invisible(REP_SETS *sets); + static void free_last_set(REP_SETS *sets); + static void free_sets(REP_SETS *sets); +-static void set_bit(REP_SET *set, uint bit); +-static void clear_bit(REP_SET *set, uint bit); ++static void set_bit_(REP_SET *set, uint bit); ++static void clear_bit_(REP_SET *set, uint bit); + static void or_bits(REP_SET *to,REP_SET *from); + static void copy_bits(REP_SET *to,REP_SET *from); + static int cmp_bits(REP_SET *set1,REP_SET *set2); +@@ -3350,7 +3350,7 @@ + { + if (from[i][0] == '\\' && from[i][1] == '^') + { +- set_bit(start_states,states+1); ++ set_bit_(start_states,states+1); + if (!from[i][2]) + { + start_states->table_offset=i; +@@ -3359,8 +3359,8 @@ + } + else if (from[i][0] == '\\' && from[i][1] == '$') + { +- set_bit(start_states,states); +- set_bit(word_states,states); ++ set_bit_(start_states,states); ++ set_bit_(word_states,states); + if (!from[i][2] && start_states->table_offset == (uint) ~0) + { + start_states->table_offset=i; +@@ -3369,11 +3369,11 @@ + } + else + { +- set_bit(word_states,states); ++ set_bit_(word_states,states); + if (from[i][0] == '\\' && (from[i][1] == 'b' && from[i][2])) +- set_bit(start_states,states+1); ++ set_bit_(start_states,states+1); + else +- set_bit(start_states,states); ++ set_bit_(start_states,states); + } + for (pos=from[i], len=0; *pos ; pos++) + { +@@ -3479,9 +3479,9 @@ + follow[i].len > found_end) + found_end=follow[i].len; + if (chr && follow[i].chr) +- set_bit(new_set,i+1); /* To next set */ ++ set_bit_(new_set,i+1); /* To next set */ + else +- set_bit(new_set,i); ++ set_bit_(new_set,i); + } + } + if (found_end) +@@ -3498,7 +3498,7 @@ + if (follow[bit_nr-1].len < found_end || + (new_set->found_len && + (chr == 0 || !follow[bit_nr].chr))) +- clear_bit(new_set,i); ++ clear_bit_(new_set,i); + else + { + if (chr == 0 || !follow[bit_nr].chr) +@@ -3647,13 +3647,13 @@ + return; + } + +-static void set_bit(REP_SET *set, uint bit) ++static void set_bit_(REP_SET *set, uint bit) + { + set->bits[bit / WORD_BIT] |= 1 << (bit % WORD_BIT); + return; + } + +-static void clear_bit(REP_SET *set, uint bit) ++static void clear_bit_(REP_SET *set, uint bit) + { + set->bits[bit / WORD_BIT] &= ~ (1 << (bit % WORD_BIT)); + return;