From ef896bcd6c7e7f0ffb09502d3c63fc4df63fcf2b Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Sun, 15 Sep 2024 20:51:51 +0800 Subject: libssh: upgrade 0.10.6 -> 0.11.1 * 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 Signed-off-by: Khem Raj --- ...erChecks.cmake-drop-Wunused-variable-flag.patch | 37 ++++++++++++++++ ...-Fix-prototype-of-des3_encrypt-des3_decry.patch | 44 ------------------- ...Lists.txt-do-not-search-ssh-sshd-commands.patch | 16 ++++--- meta-oe/recipes-support/libssh/libssh_0.10.6.bb | 48 --------------------- meta-oe/recipes-support/libssh/libssh_0.11.1.bb | 50 ++++++++++++++++++++++ 5 files changed, 96 insertions(+), 99 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 delete mode 100644 meta-oe/recipes-support/libssh/libssh_0.10.6.bb create mode 100644 meta-oe/recipes-support/libssh/libssh_0.11.1.bb 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 0000000000..21af9a5a19 --- /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 +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 +--- + 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 d2d1fb5955..0000000000 --- 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 -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 - ---- - 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 d6bc75c3a6..4803ff81d8 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 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 - --- 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.10.6.bb deleted file mode 100644 index 31f29c1b7d..0000000000 --- a/meta-oe/recipes-support/libssh/libssh_0.10.6.bb +++ /dev/null @@ -1,48 +0,0 @@ -SUMMARY = "Multiplatform C library implementing the SSHv2 and SSHv1 protocol" -HOMEPAGE = "http://www.libssh.org" -SECTION = "libs" -LICENSE = "LGPL-2.1-only" -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 \ - 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" - -S = "${WORKDIR}/git" - -inherit cmake ptest - -PACKAGECONFIG ??= "gcrypt ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}" -PACKAGECONFIG[gssapi] = "-DWITH_GSSAPI=1, -DWITH_GSSAPI=0, krb5, " -PACKAGECONFIG[gcrypt] = "-DWITH_GCRYPT=1, -DWITH_GCRYPT=0, libgcrypt, " -PACKAGECONFIG[tests] = "-DUNIT_TESTING=1, -DUNIT_TESTING=0, cmocka" - -ARM_INSTRUCTION_SET:armv5 = "arm" - -EXTRA_OECMAKE = " \ - -DWITH_PCAP=1 \ - -DWITH_SFTP=1 \ - -DWITH_ZLIB=1 \ - -DWITH_EXAMPLES=0 \ - " - -do_compile:prepend () { - if [ ${PTEST_ENABLED} = "1" ]; then - sed -i -e 's|${B}|${PTEST_PATH}|g' ${B}/config.h - sed -i -e 's|${S}|${PTEST_PATH}|g' ${B}/config.h - fi -} - -do_install_ptest () { - install -d ${D}${PTEST_PATH}/tests - cp -f ${B}/tests/unittests/torture_* ${D}${PTEST_PATH}/tests/ - install -d ${D}${PTEST_PATH}/tests/unittests - cp -f ${S}/tests/unittests/hello*.sh ${D}${PTEST_PATH}/tests/unittests/ -} - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-oe/recipes-support/libssh/libssh_0.11.1.bb b/meta-oe/recipes-support/libssh/libssh_0.11.1.bb new file mode 100644 index 0000000000..5f39c2d79c --- /dev/null +++ b/meta-oe/recipes-support/libssh/libssh_0.11.1.bb @@ -0,0 +1,50 @@ +SUMMARY = "Multiplatform C library implementing the SSHv2 and SSHv1 protocol" +HOMEPAGE = "http://www.libssh.org" +SECTION = "libs" +LICENSE = "LGPL-2.1-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=dabb4958b830e5df11d2b0ed8ea255a0" + +DEPENDS = "zlib openssl" + +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://run-ptest \ + " + +SRC_URI:append:toolchain-clang = " file://0001-CompilerChecks.cmake-drop-Wunused-variable-flag.patch" + +SRCREV = "854795c654eda518ed6de6c1ebb4e2107fcb2e73" + +S = "${WORKDIR}/git" + +inherit cmake ptest + +PACKAGECONFIG ??= "gcrypt ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}" +PACKAGECONFIG[gssapi] = "-DWITH_GSSAPI=1, -DWITH_GSSAPI=0, krb5, " +PACKAGECONFIG[gcrypt] = "-DWITH_GCRYPT=1, -DWITH_GCRYPT=0, libgcrypt, " +PACKAGECONFIG[tests] = "-DUNIT_TESTING=1, -DUNIT_TESTING=0, cmocka" + +ARM_INSTRUCTION_SET:armv5 = "arm" + +EXTRA_OECMAKE = " \ + -DWITH_PCAP=1 \ + -DWITH_SFTP=1 \ + -DWITH_ZLIB=1 \ + -DWITH_EXAMPLES=0 \ + " + +do_compile:prepend () { + if [ ${PTEST_ENABLED} = "1" ]; then + sed -i -e 's|${B}|${PTEST_PATH}|g' ${B}/config.h + sed -i -e 's|${S}|${PTEST_PATH}|g' ${B}/config.h + fi +} + +do_install_ptest () { + install -d ${D}${PTEST_PATH}/tests + cp -f ${B}/tests/unittests/torture_* ${D}${PTEST_PATH}/tests/ + install -d ${D}${PTEST_PATH}/tests/unittests + cp -f ${S}/tests/unittests/hello*.sh ${D}${PTEST_PATH}/tests/unittests/ +} + +BBCLASSEXTEND = "native nativesdk" -- cgit v1.2.3-54-g00ecf