diff mbox series

[meta-oe,4/6] libssh: upgrade 0.10.6 -> 0.11.1

Message ID 20240915125153.2940806-4-yi.zhao@windriver.com
State Accepted
Headers show
Series [meta-oe,1/6] fltk: upgrade 1.3.8 -> 1.3.9 | expand

Commit Message

Yi Zhao Sept. 15, 2024, 12:51 p.m. UTC
* Drop 0001-libgcrypt.c-Fix-prototype-of-des3_encrypt-des3_decry.patch
  as the issue has been fixed upstream.

* Add a patch to fix build with clang.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
 ...cks.cmake-drop-Wunused-variable-flag.patch | 37 ++++++++++++++++
 ...prototype-of-des3_encrypt-des3_decry.patch | 44 -------------------
 ....txt-do-not-search-ssh-sshd-commands.patch | 16 ++++---
 .../{libssh_0.10.6.bb => libssh_0.11.1.bb}    |  8 ++--
 4 files changed, 51 insertions(+), 54 deletions(-)
 create mode 100644 meta-oe/recipes-support/libssh/libssh/0001-CompilerChecks.cmake-drop-Wunused-variable-flag.patch
 delete mode 100644 meta-oe/recipes-support/libssh/libssh/0001-libgcrypt.c-Fix-prototype-of-des3_encrypt-des3_decry.patch
 rename meta-oe/recipes-support/libssh/{libssh_0.10.6.bb => libssh_0.11.1.bb} (88%)
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/libssh/libssh/0001-CompilerChecks.cmake-drop-Wunused-variable-flag.patch b/meta-oe/recipes-support/libssh/libssh/0001-CompilerChecks.cmake-drop-Wunused-variable-flag.patch
new file mode 100644
index 000000000..21af9a5a1
--- /dev/null
+++ b/meta-oe/recipes-support/libssh/libssh/0001-CompilerChecks.cmake-drop-Wunused-variable-flag.patch
@@ -0,0 +1,37 @@ 
+From 98a330971f4344619b698d4603a45bd31d6935d9 Mon Sep 17 00:00:00 2001
+From: Yi Zhao <yi.zhao@windriver.com>
+Date: Sun, 15 Sep 2024 20:31:55 +0800
+Subject: [PATCH] CompilerChecks.cmake: drop -Wunused-variable flag
+
+Drop -Wunused-variable flag to fix build with clang:
+
+libssh/0.11.1/git/src/threads/libgcrypt.c:29:1: error: unused variable 'gcry_threads_pthread' [-Werror,-Wunused-variable]
+   29 | GCRY_THREAD_OPTION_PTHREAD_IMPL;
+      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+libssh/0.11.1/recipe-sysroot/usr/include/gcrypt.h:217:33: note: expanded from macro 'GCRY_THREAD_OPTION_PTHREAD_IMPL'
+  217 |   static struct gcry_thread_cbs gcry_threads_pthread = {                \
+      |                                 ^~~~~~~~~~~~~~~~~~~~
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ CompilerChecks.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CompilerChecks.cmake b/CompilerChecks.cmake
+index 9719e699..ec15fa2a 100644
+--- a/CompilerChecks.cmake
++++ b/CompilerChecks.cmake
+@@ -48,7 +48,7 @@ if (UNIX)
+     add_c_compiler_flag("-Werror=implicit-int" SUPPORTED_COMPILER_FLAGS)
+     add_c_compiler_flag("-Wint-conversion" SUPPORTED_COMPILER_FLAGS)
+     add_c_compiler_flag("-Werror=int-conversion" SUPPORTED_COMPILER_FLAGS)
+-    add_c_compiler_flag("-Werror=unused-variable" SUPPORTED_COMPILER_FLAGS)
++    #add_c_compiler_flag("-Werror=unused-variable" SUPPORTED_COMPILER_FLAGS)
+ 
+     check_c_compiler_flag("-Wformat" REQUIRED_FLAGS_WFORMAT)
+     if (REQUIRED_FLAGS_WFORMAT)
+-- 
+2.25.1
+
diff --git a/meta-oe/recipes-support/libssh/libssh/0001-libgcrypt.c-Fix-prototype-of-des3_encrypt-des3_decry.patch b/meta-oe/recipes-support/libssh/libssh/0001-libgcrypt.c-Fix-prototype-of-des3_encrypt-des3_decry.patch
deleted file mode 100644
index d2d1fb595..000000000
--- a/meta-oe/recipes-support/libssh/libssh/0001-libgcrypt.c-Fix-prototype-of-des3_encrypt-des3_decry.patch
+++ /dev/null
@@ -1,44 +0,0 @@ 
-From 49a8ae4d6f77434ed9f7a601b9df488b921e4a22 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Mon, 20 Mar 2023 21:59:19 -0700
-Subject: [PATCH] libgcrypt.c: Fix prototype of des3_encrypt/des3_decrypt
-
-This is to match the prototype for callback functions which are now emitted as
-errors by clang16
-
-Fixes
-
-TOPDIR/build/tmp/work/cortexa15t2hf-neon-yoe-linux-gnueabi/libssh/0.10.4-r0/git/src/libgcrypt.c:903:20: error: incompatible function pointer types initializing 'void (*)(struct ssh_cipher_struct *, void *, void *, size_t)' (aka 'void (*)(struct ssh_cipher_struct *, void *, void *, unsigned int)') with an expression of type 'void (struct ssh_cipher_struct *, void *, void *, unsigned long)' [-Wincompatible-function-pointer-types]
-    .encrypt     = des3_encrypt,
-                   ^~~~~~~~~~~~
-TOPDIR/build/tmp/work/cortexa15t2hf-neon-yoe-linux-gnueabi/libssh/0.10.4-r0/git/src/libgcrypt.c:904:20: error: incompatible function pointer types initializing 'void (*)(struct ssh_cipher_struct *, void *, void *, size_t)' (aka 'void (*)(struct ssh_cipher_struct *, void *, void *, unsigned int)') with an expression of type 'void (struct ssh_cipher_struct *, void *, void *, unsigned long)' [-Wincompatible-function-pointer-types]
-    .decrypt     = des3_decrypt
-                   ^~~~~~~~~~~~
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
----
- src/libgcrypt.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/libgcrypt.c b/src/libgcrypt.c
-index f410d997..e3f66781 100644
---- a/src/libgcrypt.c
-+++ b/src/libgcrypt.c
-@@ -416,12 +416,12 @@ static int des3_set_key(struct ssh_cipher_struct *cipher, void *key, void *IV) {
- }
- 
- static void des3_encrypt(struct ssh_cipher_struct *cipher, void *in,
--    void *out, unsigned long len) {
-+    void *out, size_t len) {
-   gcry_cipher_encrypt(cipher->key[0], out, len, in, len);
- }
- 
- static void des3_decrypt(struct ssh_cipher_struct *cipher, void *in,
--    void *out, unsigned long len) {
-+    void *out, size_t len) {
-   gcry_cipher_decrypt(cipher->key[0], out, len, in, len);
- }
- 
diff --git a/meta-oe/recipes-support/libssh/libssh/0001-tests-CMakeLists.txt-do-not-search-ssh-sshd-commands.patch b/meta-oe/recipes-support/libssh/libssh/0001-tests-CMakeLists.txt-do-not-search-ssh-sshd-commands.patch
index d6bc75c3a..4803ff81d 100644
--- a/meta-oe/recipes-support/libssh/libssh/0001-tests-CMakeLists.txt-do-not-search-ssh-sshd-commands.patch
+++ b/meta-oe/recipes-support/libssh/libssh/0001-tests-CMakeLists.txt-do-not-search-ssh-sshd-commands.patch
@@ -1,4 +1,4 @@ 
-From 69a89e8f015802f61637fed0d3791d20a594f298 Mon Sep 17 00:00:00 2001
+From 99fcb71903cca8458bcd6c0d5b676619a9710dab Mon Sep 17 00:00:00 2001
 From: Yi Zhao <yi.zhao@windriver.com>
 Date: Wed, 15 Mar 2023 16:51:58 +0800
 Subject: [PATCH] tests/CMakeLists.txt: do not search ssh/sshd commands on host
@@ -9,16 +9,15 @@  not required by unittests, we can skip the search.
 Upstream-Status: Inappropriate [embedded specific]
 
 Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
-
 ---
  tests/CMakeLists.txt | 2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
-index f5c30061..885c926a 100644
+index 89b95d08..e481534c 100644
 --- a/tests/CMakeLists.txt
 +++ b/tests/CMakeLists.txt
-@@ -86,6 +86,7 @@ set(TEST_TARGET_LIBRARIES
+@@ -96,6 +96,7 @@ set(TEST_TARGET_LIBRARIES
  
  add_subdirectory(unittests)
  
@@ -26,11 +25,14 @@  index f5c30061..885c926a 100644
  # OpenSSH Capabilities are required for all unit tests
  find_program(SSH_EXECUTABLE NAMES ssh)
  if (SSH_EXECUTABLE)
-@@ -302,6 +303,7 @@ if (CLIENT_TESTING OR SERVER_TESTING)
+@@ -345,6 +346,7 @@ endif (WITH_PKCS11_URI)
+ file(COPY gss/kdcsetup.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/gss FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)
  
-     message(STATUS "TORTURE_ENVIRONMENT=${TORTURE_ENVIRONMENT}")
- endif ()
+ message(STATUS "TORTURE_ENVIRONMENT=${TORTURE_ENVIRONMENT}")
 +endif ()
  
  configure_file(tests_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/tests_config.h)
  
+-- 
+2.25.1
+
diff --git a/meta-oe/recipes-support/libssh/libssh_0.10.6.bb b/meta-oe/recipes-support/libssh/libssh_0.11.1.bb
similarity index 88%
rename from meta-oe/recipes-support/libssh/libssh_0.10.6.bb
rename to meta-oe/recipes-support/libssh/libssh_0.11.1.bb
index 31f29c1b7..5f39c2d79 100644
--- a/meta-oe/recipes-support/libssh/libssh_0.10.6.bb
+++ b/meta-oe/recipes-support/libssh/libssh_0.11.1.bb
@@ -6,12 +6,14 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=dabb4958b830e5df11d2b0ed8ea255a0"
 
 DEPENDS = "zlib openssl"
 
-SRC_URI = "git://git.libssh.org/projects/libssh.git;protocol=https;branch=stable-0.10 \
+SRC_URI = "git://git.libssh.org/projects/libssh.git;protocol=https;branch=stable-0.11 \
            file://0001-tests-CMakeLists.txt-do-not-search-ssh-sshd-commands.patch \
-           file://0001-libgcrypt.c-Fix-prototype-of-des3_encrypt-des3_decry.patch \
            file://run-ptest \
           "
-SRCREV = "10e09e273f69e149389b3e0e5d44b8c221c2e7f6"
+
+SRC_URI:append:toolchain-clang = " file://0001-CompilerChecks.cmake-drop-Wunused-variable-flag.patch"
+
+SRCREV = "854795c654eda518ed6de6c1ebb4e2107fcb2e73"
 
 S = "${WORKDIR}/git"