Source: mariadb-10.0
Version: 10.0.27-1
Severity: important
Tags: patch

Hi,

Currently mariadb-10.0 FTBFS on mips64el due to various testsuite
failures. The two attached patches should resolve this. I am also
looking at the failures on mips and mipsel, but haven't finished fixing
those yet.

mips-errno-enotempty.patch
On mips* architectures, ENOTEMPTY == 93 which wasn't handled by two test
cases.

mips64-taocrypt-integer.patch
The previous patch to fix mips64el made the package build, but was
unfortunately completely wrong. I've replaced the code with a generic
implementation using GCC's __int128. It could probably be generalized to
other arches, but I didn't want to break anything.

Thanks,
James
Description: Permit 93 as a valid value of the ENOTEMPTY error in the testsuite
 On mips, ENOTEMPTY == 93 so permit that value in two test cases by replacing it
 with 39.
Author: James Cowgill <jcowg...@debian.org>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/mysql-test/extra/binlog_tests/database.test
+++ b/mysql-test/extra/binlog_tests/database.test
@@ -52,7 +52,7 @@ eval SELECT 'hello' INTO OUTFILE 'fake_f
 
 # Use '/' instead of '\' in the error message. On windows platform, dir is
 # formed with '\'.
---replace_regex /\\testing_1\\*/\/testing_1\// /66/39/ /17/39/ /File exists/Directory not empty/
+--replace_regex /\\testing_1\\*/\/testing_1\// /66/39/ /93/39/ /17/39/ /File exists/Directory not empty/
 --error 1010
 DROP DATABASE testing_1;
 let $wait_binlog_event= DROP TABLE IF EXIST;
--- a/mysql-test/suite/rpl/t/rpl_drop_db.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_db.test
@@ -13,7 +13,7 @@ insert into mysqltest1.t1 values (1);
 select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
 create table mysqltest1.t2 (n int);
 create table mysqltest1.t3 (n int);
---replace_result \\ / 66 39 17 39 "File exists" "Directory not empty"
+--replace_result \\ / 66 39 93 39 17 39 "File exists" "Directory not empty"
 --error 1010
 drop database mysqltest1;
 use mysqltest1;
@@ -30,7 +30,7 @@ while ($1)
 }
 --enable_query_log
 
---replace_result \\ / 66 39 17 39 "File exists" "Directory not empty"
+--replace_result \\ / 66 39 93 39 17 39 "File exists" "Directory not empty"
 --error 1010
 drop database mysqltest1;
 use mysqltest1;
Description: Correctly fix mips64 multiplication in taocrypt
 In Debian bugs #719196 and #798126, a patch was submitted to fix a FTBFS on
 mips64el of mysql-5.5 and mysql-5.6 respectively. This patch was accepted
 upstream and made its way into mariadb (MDEV-6528). Unfortunately the patch
 was incorrect and causes segfaults when executing the SSL parts of the
 testsuite.
 .
 The previous patch replaced the "h" asm constraint with the "d" constraint
 since the "h" is not supported in newer GCC versions. The "d" constraint was
 wrong as it tells GCC that the result can be found in _any_ general purpose
 register that it chooses. This resulted in GCC reading garbage into the high
 result bits.
 .
 This new patch replaces the assembly code with a generic 128-bit
 multiplication which works correctly on mips64.
Author: James Cowgill <jcowg...@debian.org>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/extra/yassl/taocrypt/src/integer.cpp
+++ b/extra/yassl/taocrypt/src/integer.cpp
@@ -193,8 +193,9 @@ DWord() {}
                 "a" (a), "rm" (b) : "cc");
 
         #elif defined(__mips64)
-            __asm__("dmultu %2,%3" : "=d" (r.halfs_.high), "=l" (r.halfs_.low)
-                : "r" (a), "r" (b));
+            unsigned __int128 t = (unsigned __int128) a * b;
+            r.halfs_.high = t >> 64;
+            r.halfs_.low = (word) t;
 
         #elif defined(_M_IX86)
             // for testing

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to