Skip to contentSkip to conversation

mariadb: Upgrade to 10.7.7

PATCH In review [email protected] 2 participants 4 messages Dec 23, 2022 – Jan 4, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mariadb: Upgrade to 10.7.7

From: Mingli Yu <[email protected]>

Remove the backported patch mariadb-openssl3.patch.

---
 ...ive_10.7.4.bb => mariadb-native_10.7.7.bb} |   0
 meta-oe/recipes-dbs/mysql/mariadb.inc         |   3 +-
 .../mysql/mariadb/mariadb-openssl3.patch      | 416 ------------------
 .../{mariadb_10.7.4.bb => mariadb_10.7.7.bb}  |   2 +-
 4 files changed, 2 insertions(+), 419 deletions(-)
 rename meta-oe/recipes-dbs/mysql/{mariadb-native_10.7.4.bb => mariadb-native_10.7.7.bb} (100%)
 delete mode 100644 meta-oe/recipes-dbs/mysql/mariadb/mariadb-openssl3.patch
 rename meta-oe/recipes-dbs/mysql/{mariadb_10.7.4.bb => mariadb_10.7.7.bb} (91%)
meta-oe/recipes-dbs/mysql/mariadb-native_10.7.7.bb renamed from meta-oe/recipes-dbs/mysql/mariadb-native_10.7.4.bb +0 -0
similarity index 100%
rename from meta-oe/recipes-dbs/mysql/mariadb-native_10.7.4.bb
rename to meta-oe/recipes-dbs/mysql/mariadb-native_10.7.7.bb
meta-oe/recipes-dbs/mysql/mariadb.inc +1 -2
index 23322cf74..097766e79 100644
@@ -19,13 +19,12 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \
            file://ssize_t.patch \
            file://mm_malloc.patch \
            file://sys_futex.patch \
-           file://mariadb-openssl3.patch \
            file://cross-compiling.patch \
            file://0001-sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch \
           "
 SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch"
 
-SRC_URI[sha256sum] = "73dd9c9d325520f20ca5e0ef16f94b7be1146bed7e4a78e735c20daebf3a4173"
+SRC_URI[sha256sum] = "fd2f9fa3f135823c1626c9700e3bd736b829bfc09f61f5557d7313a7c9e02c29"
 
 UPSTREAM_CHECK_URI = "https://github.com/MariaDB/server/releases"
 
meta-oe/recipes-dbs/mysql/mariadb/mariadb-openssl3.patch deleted +0 -416

416 lines not on this page · raw message

meta-oe/recipes-dbs/mysql/mariadb_10.7.7.bb renamed from meta-oe/recipes-dbs/mysql/mariadb_10.7.4.bb +1 -1
similarity index 91%
rename from meta-oe/recipes-dbs/mysql/mariadb_10.7.4.bb
rename to meta-oe/recipes-dbs/mysql/mariadb_10.7.7.bb
index 8dba5c858..87faabfa2 100644
@@ -1,7 +1,7 @@
 require mariadb.inc
 
 DEPENDS += "mariadb-native bison-native boost libpcre2 curl ncurses \
-            zlib libaio libedit libevent libxml2 gnutls fmt lzo"
+            zlib libaio libedit libevent libxml2 gnutls fmt lzo zstd"
 
 PROVIDES += "mysql5 libmysqlclient"
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 3 lines · Mingli

From: Mingli Yu <[email protected]>

Remove the backported patch mariadb-openssl3.patch.

This patch does not apply on top of Kirkstone.

 ./contrib/pw-am.sh -s 17152
https://patchwork.yoctoproject.org/patch/-s/mbox/:

2022-12-26 14:22:50 ERROR 404: Not Found.
Patch format detection failed.
2022-12-26 14:22:51 URL:https://patchwork.yoctoproject.org/project/oe/patch/[email protected]/mbox/ [21744/21744] -> "pw-am-17152.patch" [1]

Applying: mariadb: Upgrade to 10.7.7
error: patch failed: meta-oe/recipes-dbs/mysql/mariadb.inc:19
error: meta-oe/recipes-dbs/mysql/mariadb.inc: patch does not apply
error: patch failed: meta-oe/recipes-dbs/mysql/mariadb_10.7.4.bb:1
error: meta-oe/recipes-dbs/mysql/mariadb_10.7.4.bb: patch does not apply Patch failed at 0001 mariadb: Upgrade to 10.7.7

Am I missing a dependency patch?

- armin

Quoted 482 lines
---
  ...ive_10.7.4.bb => mariadb-native_10.7.7.bb} |   0
  meta-oe/recipes-dbs/mysql/mariadb.inc         |   3 +-
  .../mysql/mariadb/mariadb-openssl3.patch      | 416 ------------------
  .../{mariadb_10.7.4.bb => mariadb_10.7.7.bb}  |   2 +-
  4 files changed, 2 insertions(+), 419 deletions(-)

rename meta-oe/recipes-dbs/mysql/{mariadb-native_10.7.4.bb => mariadb-native_10.7.7.bb} (100%) delete mode 100644 meta-oe/recipes-dbs/mysql/mariadb/mariadb-openssl3.patch rename meta-oe/recipes-dbs/mysql/{mariadb_10.7.4.bb => mariadb_10.7.7.bb} (91%)

meta-oe/recipes-dbs/mysql/mariadb-native_10.7.7.bb renamed from meta-oe/recipes-dbs/mysql/mariadb-native_10.7.4.bb +0 -0
similarity index 100%
rename from meta-oe/recipes-dbs/mysql/mariadb-native_10.7.4.bb
rename to meta-oe/recipes-dbs/mysql/mariadb-native_10.7.7.bb
meta-oe/recipes-dbs/mysql/mariadb.inc +1 -2
index 23322cf74..097766e79 100644
@@ -19,13 +19,12 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \
             file://ssize_t.patch \
             file://mm_malloc.patch \
             file://sys_futex.patch \
-           file://mariadb-openssl3.patch \
             file://cross-compiling.patch \
             file://0001-sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch \
            "
  SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch"
 
-SRC_URI[sha256sum] = "73dd9c9d325520f20ca5e0ef16f94b7be1146bed7e4a78e735c20daebf3a4173"
+SRC_URI[sha256sum] = "fd2f9fa3f135823c1626c9700e3bd736b829bfc09f61f5557d7313a7c9e02c29"
 
  UPSTREAM_CHECK_URI = "https://github.com/MariaDB/server/releases"
 
meta-oe/recipes-dbs/mysql/mariadb/mariadb-openssl3.patch deleted +0 -416
deleted file mode 100644
index 878675f30..000000000
@@ -1,416 +0,0 @@
-From 1626955f3a2107ec4c7fd927ebfa3c6c1d2b09b8 Mon Sep 17 00:00:00 2001
-From: Vladislav Vaintroub <[email protected]>
-Date: Mon, 8 Nov 2021 18:48:19 +0100
-Subject: [PATCH] MDEV-25785 Add support for OpenSSL 3.0
-
-Summary of changes
-
-- MD_CTX_SIZE is increased
-
-- EVP_CIPHER_CTX_buf_noconst(ctx) does not work anymore, points
-  to nobody knows where. The assumption made previously was that
-  (since the function does not seem to be documented)
-  was that it points to the last partial source block.
-  Add own partial block buffer for NOPAD encryption instead
-
-- SECLEVEL in CipherString in openssl.cnf
-  had been downgraded to 0, from 1, to make TLSv1.0 and TLSv1.1 possible
-
-- Workaround Ssl_cipher_list issue, it now returns TLSv1.3 ciphers,
-  in addition to what was set in --ssl-cipher
-
-- ctx_buf buffer now must be aligned to 16 bytes with openssl(
-  previously with WolfSSL only), ot crashes will happen
-
-- updated aes-t , to be better debuggable
-  using function, rather than a huge multiline macro
-  added test that does "nopad" encryption piece-wise, to test
-  replacement of EVP_CIPHER_CTX_buf_noconst
-
-Patch from Fedora https://src.fedoraproject.org/rpms/mariadb/raw/rawhide/f/mariadb-openssl3.patch
-
-Upstream-Status: Backport [https://github.com/MariaDB/server/commit/d42c2efbaa06a0307c2f0fd8fa87819ff50bbd7e]
-Signed-off-by: Khem Raj <[email protected]>
-Signed-off-by: Mingli Yu <[email protected]>
----
- cmake/ssl.cmake                   |  21 +++++-
- include/mysql/service_my_crypt.h  |   2 +-
- include/ssl_compat.h              |   3 +-
- mysql-test/lib/openssl.cnf        |   2 +-
- mysql-test/main/ssl_cipher.result |   6 +-
- mysql-test/main/ssl_cipher.test   |   2 +-
- mysys_ssl/my_crypt.cc             |  46 +++++++-----
- unittest/mysys/aes-t.c            | 121 ++++++++++++++++++++++--------
- 8 files changed, 143 insertions(+), 60 deletions(-)
-
-diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
-index a6793cf3..64c93ff9 100644
---- a/cmake/ssl.cmake
-+++ b/cmake/ssl.cmake
-@@ -118,7 +118,7 @@ MACRO (MYSQL_CHECK_SSL)
-     ENDIF()
-     FIND_PACKAGE(OpenSSL)
-     SET_PACKAGE_PROPERTIES(OpenSSL PROPERTIES TYPE RECOMMENDED)
--    IF(OPENSSL_FOUND AND OPENSSL_VERSION AND OPENSSL_VERSION VERSION_LESS "3.0.0")
-+    IF(OPENSSL_FOUND)
-       SET(OPENSSL_LIBRARY ${OPENSSL_SSL_LIBRARY})
-       INCLUDE(CheckSymbolExists)
-       SET(SSL_SOURCES "")
-@@ -139,9 +139,20 @@ MACRO (MYSQL_CHECK_SSL)
-       SET(SSL_INTERNAL_INCLUDE_DIRS "")
-       SET(SSL_DEFINES "-DHAVE_OPENSSL")
-
-+      FOREACH(x INCLUDES LIBRARIES DEFINITIONS)
-+        SET(SAVE_CMAKE_REQUIRED_${x} ${CMAKE_REQUIRED_${x}})
-+      ENDFOREACH()
-+
-+      # Silence "deprecated in OpenSSL 3.0"
-+      IF((NOT OPENSSL_VERSION) # 3.0 not determined by older cmake
-+         OR NOT(OPENSSL_VERSION VERSION_LESS "3.0.0"))
-+        SET(SSL_DEFINES "${SSL_DEFINES} -DOPENSSL_API_COMPAT=0x10100000L")
-+        SET(CMAKE_REQUIRED_DEFINITIONS -DOPENSSL_API_COMPAT=0x10100000L)
-+      ENDIF()
-+
-       SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
-       SET(CMAKE_REQUIRED_LIBRARIES ${SSL_LIBRARIES})
--      SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
-+
-       CHECK_SYMBOL_EXISTS(ERR_remove_thread_state "openssl/err.h"
-                           HAVE_ERR_remove_thread_state)
-       CHECK_SYMBOL_EXISTS(EVP_aes_128_ctr "openssl/evp.h"
-@@ -150,8 +161,10 @@ MACRO (MYSQL_CHECK_SSL)
-                           HAVE_EncryptAes128Gcm)
-       CHECK_SYMBOL_EXISTS(X509_check_host "openssl/x509v3.h"
-                           HAVE_X509_check_host)
--      SET(CMAKE_REQUIRED_INCLUDES)
--      SET(CMAKE_REQUIRED_LIBRARIES)
-+
-+      FOREACH(x INCLUDES LIBRARIES DEFINITIONS)
-+        SET(CMAKE_REQUIRED_${x} ${SAVE_CMAKE_REQUIRED_${x}})
-+      ENDFOREACH()
-     ELSE()
-       IF(WITH_SSL STREQUAL "system")
-         MESSAGE(FATAL_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support")
-diff --git a/include/mysql/service_my_crypt.h b/include/mysql/service_my_crypt.h
-index 2a232117..bb038aaa 100644
---- a/include/mysql/service_my_crypt.h
-+++ b/include/mysql/service_my_crypt.h
-@@ -45,7 +45,7 @@ extern "C" {
- /* The max key length of all supported algorithms */
- #define MY_AES_MAX_KEY_LENGTH 32
-
--#define MY_AES_CTX_SIZE 656
-+#define MY_AES_CTX_SIZE 672
-
- enum my_aes_mode {
-     MY_AES_ECB, MY_AES_CBC
-diff --git a/include/ssl_compat.h b/include/ssl_compat.h
-index 8dc12254..6db1baab 100644
---- a/include/ssl_compat.h
-+++ b/include/ssl_compat.h
-@@ -24,7 +24,7 @@
- #define SSL_LIBRARY OpenSSL_version(OPENSSL_VERSION)
- #define ERR_remove_state(X) ERR_clear_error()
- #define EVP_CIPHER_CTX_SIZE 176
--#define EVP_MD_CTX_SIZE 48
-+#define EVP_MD_CTX_SIZE 72
- #undef EVP_MD_CTX_init
- #define EVP_MD_CTX_init(X) do { memset((X), 0, EVP_MD_CTX_SIZE); EVP_MD_CTX_reset(X); } while(0)
- #undef EVP_CIPHER_CTX_init
-@@ -77,7 +77,6 @@
- #define DH_set0_pqg(D,P,Q,G)            ((D)->p= (P), (D)->g= (G))
- #endif
-
--#define EVP_CIPHER_CTX_buf_noconst(ctx) ((ctx)->buf)
- #define EVP_CIPHER_CTX_encrypting(ctx)  ((ctx)->encrypt)
- #define EVP_CIPHER_CTX_SIZE             sizeof(EVP_CIPHER_CTX)
-
-diff --git a/mysql-test/lib/openssl.cnf b/mysql-test/lib/openssl.cnf
-index b9ab37ac..7cd6f748 100644
---- a/mysql-test/lib/openssl.cnf
-+++ b/mysql-test/lib/openssl.cnf
-@@ -9,4 +9,4 @@ ssl_conf = ssl_section
- system_default = system_default_section
-
- [system_default_section]
--CipherString = ALL:@SECLEVEL=1
-+CipherString = ALL:@SECLEVEL=0
-diff --git a/mysql-test/main/ssl_cipher.result b/mysql-test/main/ssl_cipher.result
-index 930d384e..66d817b7 100644
---- a/mysql-test/main/ssl_cipher.result
-+++ b/mysql-test/main/ssl_cipher.result
-@@ -61,8 +61,8 @@ connect  ssl_con,localhost,root,,,,,SSL;
- SHOW STATUS LIKE 'Ssl_cipher';
- Variable_name	Value
- Ssl_cipher	AES128-SHA
--SHOW STATUS LIKE 'Ssl_cipher_list';
--Variable_name	Value
--Ssl_cipher_list	AES128-SHA
-+SELECT VARIABLE_VALUE like '%AES128-SHA%' FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher_list';
-+VARIABLE_VALUE like '%AES128-SHA%'
-+1
- disconnect ssl_con;
- connection default;
-diff --git a/mysql-test/main/ssl_cipher.test b/mysql-test/main/ssl_cipher.test
-index 36549d76..d4cdcffb 100644
---- a/mysql-test/main/ssl_cipher.test
-+++ b/mysql-test/main/ssl_cipher.test
-@@ -98,6 +98,6 @@ let $restart_parameters=--ssl-cipher=AES128-SHA;
- source include/restart_mysqld.inc;
- connect (ssl_con,localhost,root,,,,,SSL);
- SHOW STATUS LIKE 'Ssl_cipher';
--SHOW STATUS LIKE 'Ssl_cipher_list';
-+SELECT VARIABLE_VALUE like '%AES128-SHA%' FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher_list';
- disconnect ssl_con;
- connection default;
-diff --git a/mysys_ssl/my_crypt.cc b/mysys_ssl/my_crypt.cc
-index e512eee9..4d7ebc7b 100644
---- a/mysys_ssl/my_crypt.cc
-+++ b/mysys_ssl/my_crypt.cc
-@@ -29,11 +29,7 @@
- #include <ssl_compat.h>
- #include <cstdint>
-
--#ifdef HAVE_WOLFSSL
- #define CTX_ALIGN 16
--#else
--#define CTX_ALIGN 0
--#endif
-
- class MyCTX
- {
-@@ -100,8 +96,9 @@ class MyCTX_nopad : public MyCTX
- {
- public:
-   const uchar *key;
--  uint klen, buf_len;
-+  uint klen, source_tail_len;
-   uchar oiv[MY_AES_BLOCK_SIZE];
-+  uchar source_tail[MY_AES_BLOCK_SIZE];
-
-   MyCTX_nopad() : MyCTX() { }
-   ~MyCTX_nopad() { }
-@@ -112,7 +109,7 @@ class MyCTX_nopad : public MyCTX
-     compile_time_assert(MY_AES_CTX_SIZE >= sizeof(MyCTX_nopad));
-     this->key= key;
-     this->klen= klen;
--    this->buf_len= 0;
-+    this->source_tail_len= 0;
-     if (ivlen)
-       memcpy(oiv, iv, ivlen);
-     DBUG_ASSERT(ivlen == 0 || ivlen == sizeof(oiv));
-@@ -123,26 +120,41 @@ class MyCTX_nopad : public MyCTX
-     return res;
-   }
-
-+  /** Update last partial source block, stored in source_tail array. */
-+  void update_source_tail(const uchar* src, uint slen)
-+  {
-+    if (!slen)
-+      return;
-+    uint new_tail_len= (source_tail_len + slen) % MY_AES_BLOCK_SIZE;
-+    if (new_tail_len)
-+    {
-+      if (slen + source_tail_len < MY_AES_BLOCK_SIZE)
-+      {
-+        memcpy(source_tail + source_tail_len, src, slen);
-+      }
-+      else
-+      {
-+        DBUG_ASSERT(slen > new_tail_len);
-+        memcpy(source_tail, src + slen - new_tail_len, new_tail_len);
-+      }
-+    }
-+    source_tail_len= new_tail_len;
-+  }
-+
-   int update(const uchar *src, uint slen, uchar *dst, uint *dlen)
-   {
--    buf_len+= slen;
-+    update_source_tail(src, slen);
-     return MyCTX::update(src, slen, dst, dlen);
-   }
-
-   int finish(uchar *dst, uint *dlen)
-   {
--    buf_len %= MY_AES_BLOCK_SIZE;
--    if (buf_len)
-+    if (source_tail_len)
-     {
--      uchar *buf= EVP_CIPHER_CTX_buf_noconst(ctx);
-       /*
-         Not much we can do, block ciphers cannot encrypt data that aren't
-         a multiple of the block length. At least not without padding.
-         Let's do something CTR-like for the last partial block.
--
--        NOTE this assumes that there are only buf_len bytes in the buf.
--        If OpenSSL will change that, we'll need to change the implementation
--        of this class too.
-       */
-       uchar mask[MY_AES_BLOCK_SIZE];
-       uint mlen;
-@@ -154,10 +166,10 @@ class MyCTX_nopad : public MyCTX
-         return rc;
-       DBUG_ASSERT(mlen == sizeof(mask));
-
--      for (uint i=0; i < buf_len; i++)
--        dst[i]= buf[i] ^ mask[i];
-+      for (uint i=0; i < source_tail_len; i++)
-+        dst[i]= source_tail[i] ^ mask[i];
-     }
--    *dlen= buf_len;
-+    *dlen= source_tail_len;
-     return MY_AES_OK;
-   }
- };
-diff --git a/unittest/mysys/aes-t.c b/unittest/mysys/aes-t.c
-index 34704e06..cbec2760 100644
---- a/unittest/mysys/aes-t.c
-+++ b/unittest/mysys/aes-t.c
-@@ -21,27 +21,96 @@
- #include <string.h>
- #include <ctype.h>
-
--#define DO_TEST(mode, nopad, slen, fill, dlen, hash)                    \
--  SKIP_BLOCK_IF(mode == 0xDEADBEAF, nopad ? 4 : 5, #mode " not supported")     \
--  {                                                                     \
--    memset(src, fill, src_len= slen);                                   \
--    ok(my_aes_crypt(mode, nopad | ENCRYPTION_FLAG_ENCRYPT,              \
--                    src, src_len, dst, &dst_len,                        \
--                    key, sizeof(key), iv, sizeof(iv)) == MY_AES_OK,     \
--      "encrypt " #mode " %u %s", src_len, nopad ? "nopad" : "pad");     \
--    if (!nopad)                                                         \
--      ok (dst_len == my_aes_get_size(mode, src_len), "my_aes_get_size");\
--    my_md5(md5, (char*)dst, dst_len);                                   \
--    ok(dst_len == dlen && memcmp(md5, hash, sizeof(md5)) == 0, "md5");  \
--    ok(my_aes_crypt(mode, nopad | ENCRYPTION_FLAG_DECRYPT,              \
--                    dst, dst_len, ddst, &ddst_len,                      \
--                    key, sizeof(key), iv, sizeof(iv)) == MY_AES_OK,     \
--       "decrypt " #mode " %u", dst_len);                                \
--    ok(ddst_len == src_len && memcmp(src, ddst, src_len) == 0, "memcmp"); \
-+
-+/** Test streaming encryption, bytewise update.*/
-+static int aes_crypt_bytewise(enum my_aes_mode mode, int flags, const unsigned char *src,
-+                 unsigned int slen, unsigned char *dst, unsigned int *dlen,
-+                 const unsigned char *key, unsigned int klen,
-+                 const unsigned char *iv, unsigned int ivlen)
-+{
-+  /* Allocate context on odd address on stack, in order to
-+   catch misalignment errors.*/
-+  void *ctx= (char *)alloca(MY_AES_CTX_SIZE+1)+1;
-+
-+  int res1, res2;
-+  uint d1= 0, d2;
-+  uint i;
-+
-+  if ((res1= my_aes_crypt_init(ctx, mode, flags, key, klen, iv, ivlen)))
-+    return res1;
-+  for (i= 0; i < slen; i++)
-+  {
-+    uint tmp_d1=0;
-+    res1= my_aes_crypt_update(ctx, src+i,1, dst, &tmp_d1);
-+    if (res1)
-+      return res1;
-+    d1+= tmp_d1;
-+    dst+= tmp_d1;
-+  }
-+  res2= my_aes_crypt_finish(ctx, dst, &d2);
-+  *dlen= d1 + d2;
-+  return res1 ? res1 : res2;
-+}
-+
-+
-+#ifndef HAVE_EncryptAes128Ctr
-+const uint MY_AES_CTR=0xDEADBEAF;
-+#endif
-+#ifndef HAVE_EncryptAes128Gcm
-+const uint MY_AES_GCM=0xDEADBEAF;
-+#endif
-+
-+#define MY_AES_UNSUPPORTED(x)  (x == 0xDEADBEAF)
-+
-+static void do_test(uint mode, const char *mode_str, int nopad, uint slen,
-+                    char fill, size_t dlen, const char *hash)
-+{
-+  uchar key[16]= {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6};
-+  uchar iv[16]= {2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7};
-+  uchar src[1000], dst[1100], dst2[1100], ddst[1000];
-+  uchar md5[MY_MD5_HASH_SIZE];
-+  uint src_len, dst_len, dst_len2, ddst_len;
-+  int result;
-+
-+  if (MY_AES_UNSUPPORTED(mode))
-+  {
-+    skip(nopad?7:6, "%s not supported", mode_str);
-+    return;
-+  }
-+  memset(src, fill, src_len= slen);
-+  result= my_aes_crypt(mode, nopad | ENCRYPTION_FLAG_ENCRYPT, src, src_len,
-+                       dst, &dst_len, key, sizeof(key), iv, sizeof(iv));
-+  ok(result == MY_AES_OK, "encrypt %s %u %s", mode_str, src_len,
-+     nopad ? "nopad" : "pad");
-+
-+  if (nopad)
-+  {
-+    result= aes_crypt_bytewise(mode, nopad | ENCRYPTION_FLAG_ENCRYPT, src,
-+                                src_len, dst2, &dst_len2, key, sizeof(key),
-+                                iv, sizeof(iv));
-+    ok(result == MY_AES_OK, "encrypt bytewise %s %u", mode_str, src_len);
-+    /* Compare with non-bytewise encryption result*/
-+    ok(dst_len == dst_len2 && memcmp(dst, dst2, dst_len) == 0,
-+       "memcmp bytewise  %s %u", mode_str, src_len);
-+  }
-+  else
-+  {
-+    int dst_len_real= my_aes_get_size(mode, src_len);
-+    ok(dst_len_real= dst_len, "my_aes_get_size");
-   }
-+  my_md5(md5, (char *) dst, dst_len);
-+  ok(dst_len == dlen, "md5 len");
-+  ok(memcmp(md5, hash, sizeof(md5)) == 0, "md5");
-+  result= my_aes_crypt(mode, nopad | ENCRYPTION_FLAG_DECRYPT,
-+                       dst, dst_len, ddst, &ddst_len, key, sizeof(key), iv,
-+                       sizeof(iv));
-+
-+  ok(result == MY_AES_OK, "decrypt %s %u", mode_str, dst_len);
-+  ok(ddst_len == src_len && memcmp(src, ddst, src_len) == 0, "memcmp");
-+}
-
--#define DO_TEST_P(M,S,F,D,H) DO_TEST(M,0,S,F,D,H)
--#define DO_TEST_N(M,S,F,D,H) DO_TEST(M,ENCRYPTION_FLAG_NOPAD,S,F,D,H)
-+#define DO_TEST_P(M, S, F, D, H) do_test(M, #M, 0, S, F, D, H)
-+#define DO_TEST_N(M, S, F, D, H) do_test(M, #M, ENCRYPTION_FLAG_NOPAD, S, F, D, H)
-
- /* useful macro for debugging */
- #define PRINT_MD5()                                     \
-@@ -53,25 +122,15 @@
-     printf("\"\n");                                     \
-   } while(0);
-
--#ifndef HAVE_EncryptAes128Ctr
--const uint MY_AES_CTR=0xDEADBEAF;
--#endif
--#ifndef HAVE_EncryptAes128Gcm
--const uint MY_AES_GCM=0xDEADBEAF;
--#endif
-
- int
- main(int argc __attribute__((unused)),char *argv[])
- {
--  uchar key[16]= {1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6};
--  uchar iv[16]=  {2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7};
--  uchar src[1000], dst[1100], ddst[1000];
--  uchar md5[MY_MD5_HASH_SIZE];
--  uint src_len, dst_len, ddst_len;
-
-   MY_INIT(argv[0]);
-
--  plan(87);
-+  plan(122);
-+
-   DO_TEST_P(MY_AES_ECB, 200, '.', 208, "\xd8\x73\x8e\x3a\xbc\x66\x99\x13\x7f\x90\x23\x52\xee\x97\x6f\x9a");
-   DO_TEST_P(MY_AES_ECB, 128, '?', 144, "\x19\x58\x33\x85\x4c\xaa\x7f\x06\xd1\xb2\xec\xd7\xb7\x6a\xa9\x5b");
-   DO_TEST_P(MY_AES_CBC, 159, '%', 160, "\x4b\x03\x18\x3d\xf1\xa7\xcd\xa1\x46\xb3\xc6\x8a\x92\xc0\x0f\xc9");
---
-2.25.1
-
meta-oe/recipes-dbs/mysql/mariadb_10.7.7.bb renamed from meta-oe/recipes-dbs/mysql/mariadb_10.7.4.bb +1 -2
similarity index 91%
rename from meta-oe/recipes-dbs/mysql/mariadb_10.7.4.bb
rename to meta-oe/recipes-dbs/mysql/mariadb_10.7.7.bb
index 8dba5c858..87faabfa2 100644
@@ -1,7 +1,7 @@
  require mariadb.inc
 
  DEPENDS += "mariadb-native bison-native boost libpcre2 curl ncurses \
-            zlib libaio libedit libevent libxml2 gnutls fmt lzo"
+            zlib libaio libedit libevent libxml2 gnutls fmt lzo zstd"
 
  PROVIDES += "mysql5 libmysqlclient"
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#100198): https://lists.openembedded.org/g/openembedded-devel/message/100198
Mute This Topic: https://lists.openembedded.org/mt/95841726/3616698
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw

PATCH v2 1/2 mariadb: not use qemu to run cross-compiled binaries

From: Mingli Yu <[email protected]>

The build fails when use qemu to run build for amd64 as below:

 | make  -f libmariadb/libmariadb/CMakeFiles/mariadbclient.dir/build.make libmariadb/libmariadb/CMakeFiles/mariadbclient.dir/depend
 | make  -f libmariadb/libmariadb/CMakeFiles/libmariadb.dir/build.make libmariadb/libmariadb/CMakeFiles/libmariadb.dir/depend
 | make[2]: Entering directory '/build/tmp-glibc/work/dbfp5-wrs-linux/mariadb/10.7.4-r0/build'
 | cd /build/tmp-glibc/work/dbfp5-wrs-linux/mariadb/10.7.4-r0/build && /build/tmp-glibc/work/dbfp5-wrs-linux/mariadb/10.7.4-r0/recipe-sysroot-native/usr/bin/cmake -E cmake_depends "Unix Makefiles" /build/tmp-glibc/work/dbfp5-wrs-linux/mariadb/10.7.4-r0/mariadb-10.7.4 /build/tmp-glibc/work/dbfp5-wrs-linux/mariadb/10.7.4-r0/mariadb-10.7.4/libmariadb/libmariadb /build/tmp-glibc/work/dbfp5-wrs-linux/mariadb/10.7.4-r0/build /build/tmp-glibc/work/dbfp5-wrs-linux/mariadb/10.7.4-r0/build/libmariadb/libmariadb /build/tmp-glibc/work/dbfp5-wrs-linux/mariadb/10.7.4-r0/build/libmariadb/libmariadb/CMakeFiles/mariadbclient.dir/DependInfo.cmake --color=
 | make[2]: Leaving directory '/build/tmp-glibc/work/dbfp5-wrs-linux/mariadb/10.7.4-r0/build'
 | make  -f libmariadb/libmariadb/CMakeFiles/mariadbclient.dir/build.make libmariadb/libmariadb/CMakeFiles/mariadbclient.dir/build
 | Illegal instruction (core dumped)
 | make[2]: *** [sql/CMakeFiles/GenServerSource.dir/build.make:76: sql/lex_hash.h] Error 132
 | make[2]: *** Deleting file 'sql/lex_hash.h'
 | make[2]: Entering directory '/build/tmp-glibc/work/dbfp5-wrs-linux/mariadb/10.7.4-r0/build'
 | [  8%] Linking C static library libmariadbclient.a
 | cd /build/tmp-glibc/work/dbfp5-wrs-linux/mariadb/10.7.4-r0/build/libmariadb/libmariadb && /build/tmp-glibc/work/dbfp5-wrs-linux/mariadb/10.7.4-r0/recipe-sysroot-native/usr/bin/cmake -P CMakeFiles/mariadbclient.dir/cmake_clean_target.cmake
 | Illegal instruction (core dumped)
 | Illegal instruction (core dumped)
 | make[2]: *** [scripts/CMakeFiles/GenFixPrivs.dir/build.make:78: scripts/mysql_fix_privilege_tables_sql.c] Error 132

So don't use qemu to run cross-compiled binaries.

(cherry picked from commit 4facf6815c4d10a4c7a373d81056af2533d0df12)
---
 .../mysql/mariadb-native_10.7.4.bb            |  4 +-
 meta-oe/recipes-dbs/mysql/mariadb.inc         | 20 +++---
 ...Lists.txt-fix-gen_lex_hash-not-found.patch | 69 +++++++++++++++++++
 .../mysql/mariadb/cross-compiling.patch       | 34 +++++++++
 meta-oe/recipes-dbs/mysql/mariadb_10.7.4.bb   |  4 +-
 5 files changed, 116 insertions(+), 15 deletions(-)
 create mode 100644 meta-oe/recipes-dbs/mysql/mariadb/0001-sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch
 create mode 100644 meta-oe/recipes-dbs/mysql/mariadb/cross-compiling.patch
meta-oe/recipes-dbs/mysql/mariadb-native_10.7.4.bb +3 -1
index e38726d3f..17a06349b 100644
@@ -2,7 +2,9 @@ require mariadb.inc
 inherit native
 
 PROVIDES += "mysql5-native"
-DEPENDS = "ncurses-native zlib-native bison-native libpcre2-native"
+DEPENDS = "ncurses-native zlib-native bison-native libpcre2-native \
+gnutls-native fmt-native \
+"
 
 RDEPENDS:${PN} = ""
 PACKAGES = ""
meta-oe/recipes-dbs/mysql/mariadb.inc +9 -11
index 922373b63..23322cf74 100644
@@ -20,6 +20,8 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \
            file://mm_malloc.patch \
            file://sys_futex.patch \
            file://mariadb-openssl3.patch \
+           file://cross-compiling.patch \
+           file://0001-sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch \
           "
 SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch"
 
@@ -61,6 +63,8 @@ FILES:${PN}-setupdb = "${sysconfdir}/init.d/install_db \
                        ${bindir}/mysql-systemd-start \
                        "
 
+EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR_NATIVE}/gen_lex_hash'"
+
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} openssl"
 PACKAGECONFIG:class-native = ""
 PACKAGECONFIG[pam] = ",-DWITHOUT_AUTH_PAM=TRUE,libpam"
@@ -95,9 +99,9 @@ EXTRA_OECMAKE = "-DWITH_EMBEDDED_SERVER=ON \
                  -DINSTALL_SYSCONFDIR:PATH=${sysconfdir} \
                  -DMYSQL_DATADIR:PATH=/var/mysql \
                  -DCAT_EXECUTABLE=`which cat` \
+                 -DSTACK_DIRECTION=1 \
                  -DCMAKE_AR:FILEPATH=${AR}"
 
-EXTRA_OECMAKE:prepend:class-target = "-DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper "
 
 # With Ninja it fails with:
 # make: *** No rule to make target `install'.  Stop.
@@ -121,18 +125,12 @@ do_generate_toolchain_file:append:class-native () {
     sed -i "/set( CMAKE_SYSTEM_PROCESSOR/d" ${WORKDIR}/toolchain.cmake
 }
 
-do_configure:prepend:class-target () {
-	# Write out a qemu wrapper that will be used by cmake
-	# so that it can run target helper binaries through that.
-	qemu_binary="${@qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), [d.expand('${STAGING_DIR_HOST}${libdir}'),d.expand('${STAGING_DIR_HOST}${base_libdir}')])}"
-	cat > ${WORKDIR}/qemuwrapper << EOF
-#!/bin/sh
-$qemu_binary "\$@"
-EOF
-	chmod +x ${WORKDIR}/qemuwrapper
-}
 
 do_compile:prepend:class-target () {
+    # These need to be in-tree or make will think they need to be built,
+    # and since we're cross-compiling that is disabled
+    cp ${STAGING_BINDIR_NATIVE}/comp_err ${S}/extra
+    cp ${STAGING_BINDIR_NATIVE}/comp_sql ${S}/scripts
     if [ "${@bb.utils.contains('PACKAGECONFIG', 'krb5', 'yes', 'no', d)}" = "no" ]; then
         if ! [ -e ${B}/include/openssl/kssl.h ] ; then
             mkdir -p ${B}/include/openssl
meta-oe/recipes-dbs/mysql/mariadb/0001-sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch new file +69 -0

69 lines not on this page · raw message

meta-oe/recipes-dbs/mysql/mariadb/cross-compiling.patch new file +34 -0
new file mode 100644
index 000000000..d0d6e3c73
@@ -0,0 +1,34 @@
+From 80be37351d995654f86b838f6b5ed47e8a90261b Mon Sep 17 00:00:00 2001
+From: Mingli Yu <[email protected]>
+Date: Fri, 23 Sep 2022 12:05:17 +0800
+Subject: [PATCH] CMakeLists.txt: not include import_executables.cmake
+
+building failed since native does not generate import_executables.cmake
+In fact, our building system will export the needed commands.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Mingli Yu <[email protected]>
+---
+ CMakeLists.txt | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f9e2b1b..34924ba 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -394,11 +394,6 @@ CHECK_LIBFMT()
+ ADD_SUBDIRECTORY(tpool)
+ CHECK_SYSTEMD()
+ 
+-IF(CMAKE_CROSSCOMPILING AND NOT DEFINED CMAKE_CROSSCOMPILING_EMULATOR)
+-  SET(IMPORT_EXECUTABLES "IMPORTFILE-NOTFOUND" CACHE FILEPATH "Path to import_executables.cmake from a native build")
+-  INCLUDE(${IMPORT_EXECUTABLES})
+-ENDIF()
+-
+ #
+ # Setup maintainer mode options. Platform checks are
+ # not run with the warning options as to not perturb fragile checks
+-- 
+2.25.1
+
meta-oe/recipes-dbs/mysql/mariadb_10.7.4.bb +1 -3
index c800c4c56..8dba5c858 100644
@@ -1,8 +1,6 @@
 require mariadb.inc
 
-inherit qemu
-
-DEPENDS += "qemu-native bison-native boost libpcre2 curl ncurses \
+DEPENDS += "mariadb-native bison-native boost libpcre2 curl ncurses \
             zlib libaio libedit libevent libxml2 gnutls fmt lzo"
 
 PROVIDES += "mysql5 libmysqlclient"
Signature · 1 line
2.25.1
#3 lore raw

PATCH v2 2/2 mariadb: Upgrade to 10.7.7

From: Mingli Yu <[email protected]>

Remove the backported patch mariadb-openssl3.patch.

---
 ...ive_10.7.4.bb => mariadb-native_10.7.7.bb} |   0
 meta-oe/recipes-dbs/mysql/mariadb.inc         |   3 +-
 .../mysql/mariadb/mariadb-openssl3.patch      | 416 ------------------
 .../{mariadb_10.7.4.bb => mariadb_10.7.7.bb}  |   2 +-
 4 files changed, 2 insertions(+), 419 deletions(-)
 rename meta-oe/recipes-dbs/mysql/{mariadb-native_10.7.4.bb => mariadb-native_10.7.7.bb} (100%)
 delete mode 100644 meta-oe/recipes-dbs/mysql/mariadb/mariadb-openssl3.patch
 rename meta-oe/recipes-dbs/mysql/{mariadb_10.7.4.bb => mariadb_10.7.7.bb} (91%)
meta-oe/recipes-dbs/mysql/mariadb-native_10.7.7.bb renamed from meta-oe/recipes-dbs/mysql/mariadb-native_10.7.4.bb +0 -0
similarity index 100%
rename from meta-oe/recipes-dbs/mysql/mariadb-native_10.7.4.bb
rename to meta-oe/recipes-dbs/mysql/mariadb-native_10.7.7.bb
meta-oe/recipes-dbs/mysql/mariadb.inc +1 -2
index 23322cf74..097766e79 100644
@@ -19,13 +19,12 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \
            file://ssize_t.patch \
            file://mm_malloc.patch \
            file://sys_futex.patch \
-           file://mariadb-openssl3.patch \
            file://cross-compiling.patch \
            file://0001-sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch \
           "
 SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch"
 
-SRC_URI[sha256sum] = "73dd9c9d325520f20ca5e0ef16f94b7be1146bed7e4a78e735c20daebf3a4173"
+SRC_URI[sha256sum] = "fd2f9fa3f135823c1626c9700e3bd736b829bfc09f61f5557d7313a7c9e02c29"
 
 UPSTREAM_CHECK_URI = "https://github.com/MariaDB/server/releases"
 
meta-oe/recipes-dbs/mysql/mariadb/mariadb-openssl3.patch deleted +0 -416

416 lines not on this page · raw message

meta-oe/recipes-dbs/mysql/mariadb_10.7.7.bb renamed from meta-oe/recipes-dbs/mysql/mariadb_10.7.4.bb +1 -1
similarity index 91%
rename from meta-oe/recipes-dbs/mysql/mariadb_10.7.4.bb
rename to meta-oe/recipes-dbs/mysql/mariadb_10.7.7.bb
index 8dba5c858..87faabfa2 100644
@@ -1,7 +1,7 @@
 require mariadb.inc
 
 DEPENDS += "mariadb-native bison-native boost libpcre2 curl ncurses \
-            zlib libaio libedit libevent libxml2 gnutls fmt lzo"
+            zlib libaio libedit libevent libxml2 gnutls fmt lzo zstd"
 
 PROVIDES += "mysql5 libmysqlclient"
 
Signature · 1 line
2.25.1