Skip to contentSkip to conversation

libssh: fix cross compile with older cmake

PATCH New Baruch Siach 5 participants 9 messages Aug 22, 2018 – Oct 24, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libssh: fix cross compile with older cmake

Old version of cmake break cross-compilation when FindThreads is used because of a try_run call. Add a workaround that avoids try_run.

cmake bug report: https://gitlab.kitware.com/cmake/cmake/issues/16920

Should fix:
http://autobuild.buildroot.net/results/8aa/8aa2bd894416a4508ca7140f8947ff46243f8b78/
http://autobuild.buildroot.net/results/f2c/f2cc965bb134bf4fd9e625eb267b67c949c202fc/

---
Hi Peter, Yann,

Can one of you test this fix on one of the affected autobuilders?

http://autobuild.buildroot.net/?reason=libssh-0.8.1

Thanks,
baruch

---
 package/libssh/libssh.mk | 3 +++
 1 file changed, 3 insertions(+)
package/libssh/libssh.mk +3 -0
index 4295aa42ee3b..635d72ad9868 100644
@@ -17,6 +17,9 @@ LIBSSH_CONF_OPTS = \
 	-DWITH_SERVER=OFF \
 	-DWITH_EXAMPLES=OFF
 
+# cmake older than 3.10 require this to avoid try_run() in FindThreads
+LIBSSH_CONF_OPTS += -DTHREADS_PTHREAD_ARG=OFF
+
 ifeq ($(BR2_PACKAGE_ZLIB),y)
 LIBSSH_CONF_OPTS += -DWITH_ZLIB=ON
 LIBSSH_DEPENDENCIES += zlib
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/1 libssh: fix cross compile with older cmake

Bruch, All,

On 2018-08-23 00:58 +0300, Baruch Siach spake thusly:

Quoted 9 lines

Old version of cmake break cross-compilation when FindThreads is used because of a try_run call. Add a workaround that avoids try_run.

cmake bug report: https://gitlab.kitware.com/cmake/cmake/issues/16920

Should fix:
http://autobuild.buildroot.net/results/8aa/8aa2bd894416a4508ca7140f8947ff46243f8b78/
http://autobuild.buildroot.net/results/f2c/f2cc965bb134bf4fd9e625eb267b67c949c202fc/

Quoted 8 lines

---
Hi Peter, Yann,

Can one of you test this fix on one of the affected autobuilders?

http://autobuild.buildroot.net/?reason=libssh-0.8.1

My autobuilder does not have cmake installed, so will use or own host-cmake, as can be seen in the failure on my autobuilder:

    http://autobuild.buildroot.net/results/f2c/f2cc965bb134bf4fd9e625eb267b67c949c202fc/build-end.log

    [...] /home/buildroot/autobuild/run/instance-3/output/host/bin/cmake [...]

So I guess you can test on a machine that does not have cmake installed.

But I'll spin a test on my autobuilder in a moment, and report back...

Regards,
Yann E. MORIN.

Quoted 23 lines

Thanks,
baruch

---
 package/libssh/libssh.mk | 3 +++
 1 file changed, 3 insertions(+)
package/libssh/libssh.mk +3 -0
index 4295aa42ee3b..635d72ad9868 100644
@@ -17,6 +17,9 @@ LIBSSH_CONF_OPTS = \
 	-DWITH_SERVER=OFF \
 	-DWITH_EXAMPLES=OFF
 
+# cmake older than 3.10 require this to avoid try_run() in FindThreads
+LIBSSH_CONF_OPTS += -DTHREADS_PTHREAD_ARG=OFF
+
 ifeq ($(BR2_PACKAGE_ZLIB),y)
 LIBSSH_CONF_OPTS += -DWITH_ZLIB=ON
 LIBSSH_DEPENDENCIES += zlib
Signature · 1 line
2.18.0
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 libssh: fix cross compile with older cmake

Baruch, All,

On 2018-08-23 00:09 +0200, Yann E. MORIN spake thusly:

Quoted 21 lines

On 2018-08-23 00:58 +0300, Baruch Siach spake thusly:

Quoted 9 lines

Old version of cmake break cross-compilation when FindThreads is used because of a try_run call. Add a workaround that avoids try_run.

cmake bug report: https://gitlab.kitware.com/cmake/cmake/issues/16920

Should fix:
http://autobuild.buildroot.net/results/8aa/8aa2bd894416a4508ca7140f8947ff46243f8b78/
http://autobuild.buildroot.net/results/f2c/f2cc965bb134bf4fd9e625eb267b67c949c202fc/

Quoted 8 lines

---
Hi Peter, Yann,

Can one of you test this fix on one of the affected autobuilders?

http://autobuild.buildroot.net/?reason=libssh-0.8.1

My autobuilder does not have cmake installed, so will use or own host-cmake, as can be seen in the failure on my autobuilder:

Quoted 7 lines
    http://autobuild.buildroot.net/results/f2c/f2cc965bb134bf4fd9e625eb267b67c949c202fc/build-end.log

    [...] /home/buildroot/autobuild/run/instance-3/output/host/bin/cmake [...]

So I guess you can test on a machine that does not have cmake installed.

But I'll spin a test on my autobuilder in a moment, and report back...

Here are the results of the configure step, using the config from my autobuilder referenced above, and running 'make libssh-depends' first:

---8<---

$ make libssh-configure
umask 0022 && make -C /home/buildroot/dev/buildroot O=/home/buildroot/dev/O/. libssh-configure
libssh-0.7.5.tar.xz: OK (md5: d3fc864208bf607ad87cdee836894feb)
libssh-0.7.5.tar.xz: OK (sha256: 54e86dd5dc20e5367e58f3caab337ce37675f863f80df85b6b1614966a337095)
Quoted 1 line
Quoted 1 line
Quoted 1 line

libssh 0.7.5 Extracting

xzcat /home/buildroot/src/libssh/libssh-0.7.5.tar.xz | tar --strip-components=1 -C /home/buildroot/dev/O/build/libssh-0.7.5 -xf -

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

libssh 0.7.5 Patching
libssh 0.7.5 Configuring

(mkdir -p /home/buildroot/dev/O/build/libssh-0.7.5//buildroot-build && cd /home/buildroot/dev/O/build/libssh-0.7.5//buildroot-build && rm -f CMakeCache.txt && PATH="/home/buildroot/dev/O/host/bin:/home/buildroot/dev/O/host/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" /home/buildroot/dev/O/host/bin/cmake /home/buildroot/dev/O/build/libssh-0.7.5/ -DCMAKE_TOOLCHAIN_FILE="/home/buildroot/dev/O/host/share/buildroot/toolchainfile.cmake" -DCMAKE_INSTALL_PREFIX="/usr" -DCMAKE_COLOR_MAKEFILE=OFF -DBUILD_DOC=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLE=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TEST=OFF -DBUILD_TESTS=OFF -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DWITH_STACK_PROTECTOR=OFF -DWITH_SERVER=OFF -DWITH_EXAMPLES=OFF -DTHREADS_PTHREAD_ARG=OFF -DWITH_ZLIB=ON -DWITH_GCRYPT=OFF ) -- The C compiler identification is GNU 6.4.0
-- Check for working C compiler: /home/buildroot/dev/O/host/bin/mipsel-linux-gcc
-- Check for working C compiler: /home/buildroot/dev/O/host/bin/mipsel-linux-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test WITH_FPIC
-- Performing Test WITH_FPIC - Success
-- Found ZLIB: /home/buildroot/dev/O/host/mipsel-buildroot-linux-gnu/sysroot/usr/lib/libz.so (found version "1.2.11")
-- Found OpenSSL: /home/buildroot/dev/O/host/mipsel-buildroot-linux-gnu/sysroot/usr/lib/libcrypto.so (found version "1.0.2p")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found PkgConfig: /home/buildroot/dev/O/host/bin/pkg-config (found version "0.28")
-- Checking for module 'heimdal-gssapi'
-- Package heimdal-gssapi was not found in the pkg-config search path.
Perhaps you should add the directory containing `heimdal-gssapi.pc'
to the PKG_CONFIG_PATH environment variable
Package 'heimdal-gssapi', required by 'world', not found
-- Could NOT find GSSAPI (missing: GSSAPI_LIBRARIES GSSAPI_INCLUDE_DIR)
-- Could NOT find NaCl (missing: NACL_LIBRARIES NACL_INCLUDE_DIRS)
-- Performing Test WITH_VISIBILITY_HIDDEN
-- Performing Test WITH_VISIBILITY_HIDDEN - Success
-- Looking for argp.h
-- Looking for argp.h - found
-- Looking for pty.h
-- Looking for pty.h - found
-- Looking for utmp.h
-- Looking for utmp.h - found
-- Looking for termios.h
-- Looking for termios.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for util.h
-- Looking for util.h - not found
-- Looking for libutil.h
-- Looking for libutil.h - not found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for arpa/inet.h
-- Looking for arpa/inet.h - found
-- Looking for byteswap.h
-- Looking for byteswap.h - found
-- Looking for openssl/des.h
-- Looking for openssl/des.h - found
-- Looking for openssl/aes.h
-- Looking for openssl/aes.h - found
-- Looking for openssl/blowfish.h
-- Looking for openssl/blowfish.h - found
-- Looking for openssl/ecdh.h
-- Looking for openssl/ecdh.h - found
-- Looking for openssl/ec.h
-- Looking for openssl/ec.h - found
-- Looking for openssl/ecdsa.h
-- Looking for openssl/ecdsa.h - found
-- Looking for isblank
-- Looking for isblank - found
-- Looking for strncpy
-- Looking for strncpy - found
-- Looking for strtoull
-- Looking for strtoull - found
-- Looking for vsnprintf
-- Looking for vsnprintf - found
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for poll
-- Looking for poll - found
-- Looking for select
-- Looking for select - found
-- Looking for getaddrinfo
-- Looking for getaddrinfo - found
-- Looking for ntohll
-- Looking for ntohll - not found
-- Looking for htonll
-- Looking for htonll - not found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for forkpty in util
-- Looking for forkpty in util - found
-- Looking for cfmakeraw
-- Looking for cfmakeraw - found
-- Looking for __strtoull
-- Looking for __strtoull - not found
-- Performing Test HAVE_GCC_THREAD_LOCAL_STORAGE
-- Performing Test HAVE_GCC_THREAD_LOCAL_STORAGE - Success
-- Performing Test HAVE_MSC_THREAD_LOCAL_STORAGE
-- Performing Test HAVE_MSC_THREAD_LOCAL_STORAGE - Failed
-- Performing Test HAVE_GCC_VOLATILE_MEMORY_PROTECTION
-- Performing Test HAVE_GCC_VOLATILE_MEMORY_PROTECTION - Success
-- Performing Test HAVE_GCC_NARG_MACRO
-- Performing Test HAVE_GCC_NARG_MACRO - Success
-- Performing Test HAVE_COMPILER__FUNC__
-- Performing Test HAVE_COMPILER__FUNC__ - Success
-- Performing Test HAVE_COMPILER__FUNCTION__
-- Performing Test HAVE_COMPILER__FUNCTION__ - Failed
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Threads_FOUND=TRUE
-- threads library: Threads_FOUND=TRUE
-- libssh_threads_SRCS=pthread.c
-- ********************************************
-- ********** libssh build options : **********
-- zlib support: ON
-- libgcrypt support: OFF
-- libnacl support: OFF
-- SSH-1 support: OFF
-- SFTP support: ON
-- Server support : OFF
-- GSSAPI support : 0
-- Pcap debugging support : ON
-- With static library: OFF
-- Unit testing: OFF
-- Client code Unit testing: OFF
-- Public API documentation generation
-- Benchmarks: OFF
-- ********************************************
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:

BUILD_DOC
BUILD_DOCS
BUILD_EXAMPLE
BUILD_EXAMPLES
BUILD_TEST
BUILD_TESTING
BUILD_TESTS
THREADS_PTHREAD_ARG

-- Build files have been written to: /home/buildroot/dev/O/build/libssh-0.7.5/buildroot-build

---8<---

The build step was then successfull, by the way...

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 libssh: fix cross compile with older cmake

Hi Yann,

Quoted 28 lines · Yann E. MORIN

On 2018-08-23 00:09 +0200, Yann E. MORIN spake thusly:

Quoted 27 lines

On 2018-08-23 00:58 +0300, Baruch Siach spake thusly:

Quoted 9 lines

Old version of cmake break cross-compilation when FindThreads is used because of a try_run call. Add a workaround that avoids try_run.

cmake bug report: https://gitlab.kitware.com/cmake/cmake/issues/16920

Should fix:
http://autobuild.buildroot.net/results/8aa/8aa2bd894416a4508ca7140f8947ff46243f8b78/
http://autobuild.buildroot.net/results/f2c/f2cc965bb134bf4fd9e625eb267b67c949c202fc/

Quoted 8 lines

---
Hi Peter, Yann,

Can one of you test this fix on one of the affected autobuilders?

http://autobuild.buildroot.net/?reason=libssh-0.8.1

My autobuilder does not have cmake installed, so will use or own host-cmake, as can be seen in the failure on my autobuilder:

    http://autobuild.buildroot.net/results/f2c/f2cc965bb134bf4fd9e625eb267b67c949c202fc/build-end.log

    [...] /home/buildroot/autobuild/run/instance-3/output/host/bin/cmake [...]

So I guess you can test on a machine that does not have cmake installed.

Right. I assumed that Buildroot has the latest, newer than 3.10, cmake. But this is evidently not true. Commit log of 5b57ae7ad197 (Revert "package/cmake: bump version to 3.10.0 and add license hash") seems to indicate that we'll have to wait a while for the next cmake version bump.

Quoted 2 lines
Quoted 2 lines

But I'll spin a test on my autobuilder in a moment, and report back...

Thanks.

Quoted 2 lines

Here are the results of the configure step, using the config from my autobuilder referenced above, and running 'make libssh-depends' first:

You meant to say 'make libssh-configure' here, right?

So I reproduced the build failure and the fix with host-cmake here as well.

Thanks,
baruch

Quoted 162 lines

---8<---

$ make libssh-configure
umask 0022 && make -C /home/buildroot/dev/buildroot O=/home/buildroot/dev/O/. libssh-configure
libssh-0.7.5.tar.xz: OK (md5: d3fc864208bf607ad87cdee836894feb)
libssh-0.7.5.tar.xz: OK (sha256: 54e86dd5dc20e5367e58f3caab337ce37675f863f80df85b6b1614966a337095)
Quoted 1 line
Quoted 1 line
Quoted 1 line

libssh 0.7.5 Extracting

xzcat /home/buildroot/src/libssh/libssh-0.7.5.tar.xz | tar --strip-components=1 -C /home/buildroot/dev/O/build/libssh-0.7.5 -xf -

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

libssh 0.7.5 Patching
libssh 0.7.5 Configuring

(mkdir -p /home/buildroot/dev/O/build/libssh-0.7.5//buildroot-build && cd /home/buildroot/dev/O/build/libssh-0.7.5//buildroot-build && rm -f CMakeCache.txt && PATH="/home/buildroot/dev/O/host/bin:/home/buildroot/dev/O/host/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" /home/buildroot/dev/O/host/bin/cmake /home/buildroot/dev/O/build/libssh-0.7.5/ -DCMAKE_TOOLCHAIN_FILE="/home/buildroot/dev/O/host/share/buildroot/toolchainfile.cmake" -DCMAKE_INSTALL_PREFIX="/usr" -DCMAKE_COLOR_MAKEFILE=OFF -DBUILD_DOC=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLE=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TEST=OFF -DBUILD_TESTS=OFF -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DWITH_STACK_PROTECTOR=OFF -DWITH_SERVER=OFF -DWITH_EXAMPLES=OFF -DTHREADS_PTHREAD_ARG=OFF -DWITH_ZLIB=ON -DWITH_GCRYPT=OFF ) -- The C compiler identification is GNU 6.4.0
-- Check for working C compiler: /home/buildroot/dev/O/host/bin/mipsel-linux-gcc
-- Check for working C compiler: /home/buildroot/dev/O/host/bin/mipsel-linux-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test WITH_FPIC
-- Performing Test WITH_FPIC - Success
-- Found ZLIB: /home/buildroot/dev/O/host/mipsel-buildroot-linux-gnu/sysroot/usr/lib/libz.so (found version "1.2.11")
-- Found OpenSSL: /home/buildroot/dev/O/host/mipsel-buildroot-linux-gnu/sysroot/usr/lib/libcrypto.so (found version "1.0.2p")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found PkgConfig: /home/buildroot/dev/O/host/bin/pkg-config (found version "0.28")
-- Checking for module 'heimdal-gssapi'
-- Package heimdal-gssapi was not found in the pkg-config search path.
Perhaps you should add the directory containing `heimdal-gssapi.pc'
to the PKG_CONFIG_PATH environment variable
Package 'heimdal-gssapi', required by 'world', not found
-- Could NOT find GSSAPI (missing: GSSAPI_LIBRARIES GSSAPI_INCLUDE_DIR)
-- Could NOT find NaCl (missing: NACL_LIBRARIES NACL_INCLUDE_DIRS)
-- Performing Test WITH_VISIBILITY_HIDDEN
-- Performing Test WITH_VISIBILITY_HIDDEN - Success
-- Looking for argp.h
-- Looking for argp.h - found
-- Looking for pty.h
-- Looking for pty.h - found
-- Looking for utmp.h
-- Looking for utmp.h - found
-- Looking for termios.h
-- Looking for termios.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for util.h
-- Looking for util.h - not found
-- Looking for libutil.h
-- Looking for libutil.h - not found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for arpa/inet.h
-- Looking for arpa/inet.h - found
-- Looking for byteswap.h
-- Looking for byteswap.h - found
-- Looking for openssl/des.h
-- Looking for openssl/des.h - found
-- Looking for openssl/aes.h
-- Looking for openssl/aes.h - found
-- Looking for openssl/blowfish.h
-- Looking for openssl/blowfish.h - found
-- Looking for openssl/ecdh.h
-- Looking for openssl/ecdh.h - found
-- Looking for openssl/ec.h
-- Looking for openssl/ec.h - found
-- Looking for openssl/ecdsa.h
-- Looking for openssl/ecdsa.h - found
-- Looking for isblank
-- Looking for isblank - found
-- Looking for strncpy
-- Looking for strncpy - found
-- Looking for strtoull
-- Looking for strtoull - found
-- Looking for vsnprintf
-- Looking for vsnprintf - found
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for poll
-- Looking for poll - found
-- Looking for select
-- Looking for select - found
-- Looking for getaddrinfo
-- Looking for getaddrinfo - found
-- Looking for ntohll
-- Looking for ntohll - not found
-- Looking for htonll
-- Looking for htonll - not found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for forkpty in util
-- Looking for forkpty in util - found
-- Looking for cfmakeraw
-- Looking for cfmakeraw - found
-- Looking for __strtoull
-- Looking for __strtoull - not found
-- Performing Test HAVE_GCC_THREAD_LOCAL_STORAGE
-- Performing Test HAVE_GCC_THREAD_LOCAL_STORAGE - Success
-- Performing Test HAVE_MSC_THREAD_LOCAL_STORAGE
-- Performing Test HAVE_MSC_THREAD_LOCAL_STORAGE - Failed
-- Performing Test HAVE_GCC_VOLATILE_MEMORY_PROTECTION
-- Performing Test HAVE_GCC_VOLATILE_MEMORY_PROTECTION - Success
-- Performing Test HAVE_GCC_NARG_MACRO
-- Performing Test HAVE_GCC_NARG_MACRO - Success
-- Performing Test HAVE_COMPILER__FUNC__
-- Performing Test HAVE_COMPILER__FUNC__ - Success
-- Performing Test HAVE_COMPILER__FUNCTION__
-- Performing Test HAVE_COMPILER__FUNCTION__ - Failed
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Threads_FOUND=TRUE
-- threads library: Threads_FOUND=TRUE
-- libssh_threads_SRCS=pthread.c
-- ********************************************
-- ********** libssh build options : **********
-- zlib support: ON
-- libgcrypt support: OFF
-- libnacl support: OFF
-- SSH-1 support: OFF
-- SFTP support: ON
-- Server support : OFF
-- GSSAPI support : 0
-- Pcap debugging support : ON
-- With static library: OFF
-- Unit testing: OFF
-- Client code Unit testing: OFF
-- Public API documentation generation
-- Benchmarks: OFF
-- ********************************************
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:

BUILD_DOC
BUILD_DOCS
BUILD_EXAMPLE
BUILD_EXAMPLES
BUILD_TEST
BUILD_TESTING
BUILD_TESTS
THREADS_PTHREAD_ARG

Quoted 8 lines

-- Build files have been written to: /home/buildroot/dev/O/build/libssh-0.7.5/buildroot-build

---8<---

The build step was then successfull, by the way...

Regards,
Yann E. MORIN.

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

#4 lore raw

PATCH 1/1 libssh: fix cross compile with older cmake

Baruch, All,

On 2018-08-23 06:42 +0300, Baruch Siach spake thusly:

Quoted 12 lines
Quoted 11 lines · Yann E. MORIN

On 2018-08-23 00:09 +0200, Yann E. MORIN spake thusly:

Quoted 10 lines

On 2018-08-23 00:58 +0300, Baruch Siach spake thusly:

Quoted 9 lines

Old version of cmake break cross-compilation when FindThreads is used because of a try_run call. Add a workaround that avoids try_run.

cmake bug report: https://gitlab.kitware.com/cmake/cmake/issues/16920

Should fix:
http://autobuild.buildroot.net/results/8aa/8aa2bd894416a4508ca7140f8947ff46243f8b78/
http://autobuild.buildroot.net/results/f2c/f2cc965bb134bf4fd9e625eb267b67c949c202fc/

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

---
Hi Peter, Yann,

Can one of you test this fix on one of the affected autobuilders?

http://autobuild.buildroot.net/?reason=libssh-0.8.1

[--SNIP--]

Quoted 4 lines
Quoted 2 lines

Here are the results of the configure step, using the config from my autobuilder referenced above, and running 'make libssh-depends' first:

You meant to say 'make libssh-configure' here, right?

No I meant that I ran:

    $ make libssh-depends
    [...]
    $ make libssh-configure
    [...]

And I only pasted starting with the second command.

Quoted 2 lines

So I reproduced the build failure and the fix with host-cmake here as well.

Thanks for finding the issue and fixing it. :-)

[--SNIP--]

Quoted 2 lines
Quoted 2 lines

CMake Warning:
Manually-specified variables were not used by the project:

[--SNIP--]

Quoted 1 line
Quoted 1 line

THREADS_PTHREAD_ARG

I find it weird that THREADS_PTHREAD_ARG is reported as unused, when it is actually it that fixes the issue... :-/

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH 1/1 libssh: fix cross compile with older cmake

In reply to Baruch Siach

package/libssh/libssh.mk LIBSSH_CONF_OPTS = \ · line 21

Quoted 2 lines · Baruch Siach
package/libssh/libssh.mk +2 -0
+# cmake older than 3.10 require this to avoid try_run() in FindThreads
+LIBSSH_CONF_OPTS += -DTHREADS_PTHREAD_ARG=OFF

Are you sure that this is a correct fix? From reading the FindThreads.cmake, passing OFF looks like it results in not feeding the -pthread option to the compiler. That breaks some scenarios such as ASAN, see [1] for details.

Cheers,
Jan

[1] https://gitlab.kitware.com/cmake/cmake/issues/16609

#6 lore raw

PATCH 1/1 libssh: fix cross compile with older cmake

Hello,

Quoted 4 lines · Jan Kundr?t

Are you sure that this is a correct fix? From reading the FindThreads.cmake, passing OFF looks like it results in not feeding the -pthread option to the compiler. That breaks some scenarios such as ASAN, see [1] for details.

At least, we are doing it in a number of other packages:

package/exiv2/exiv2.mk:EXIV2_CONF_OPTS += -DTHREADS_PTHREAD_ARG=OFF package/i2pd/i2pd.mk:I2PD_CONF_OPTS += -DTHREADS_PTHREAD_ARG=OFF package/librtlsdr/librtlsdr.mk:LIBRTLSDR_CONF_OPTS += -DTHREADS_PTHREAD_ARG=OFF package/rabbitmq-c/rabbitmq-c.mk:RABBITMQ_C_CONF_OPTS += -DTHREADS_PTHREAD_ARG=OFF

It doesn't mean it's correct, but at least that's how we are working around this problem at the moment. If it's not the correct way, then we should fix it globally :-)

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

PATCH 1/1 libssh: fix cross compile with older cmake

In reply to Baruch Siach

Hello Baruch,

Quoted 11 lines · Baruch Siach

Old version of cmake break cross-compilation when FindThreads is used because of a try_run call. Add a workaround that avoids try_run.

cmake bug report: https://gitlab.kitware.com/cmake/cmake/issues/16920

Should fix:
http://autobuild.buildroot.net/results/8aa/8aa2bd894416a4508ca7140f8947ff46243f8b78/
http://autobuild.buildroot.net/results/f2c/f2cc965bb134bf4fd9e625eb267b67c949c202fc/

It wasn't clear from your commit log if this patch was for next or master. However, the build issue only happened on next for now, and is probably related to the libssh version bump that we have in next, so I applied your patch to the next branch.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#8 lore raw

PATCH 1/1 libssh: fix cross compile with older cmake

In reply to Baruch Siach
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Baruch" == Baruch Siach <[email protected]> writes:

Old version of cmake break cross-compilation when FindThreads is used because of a try_run call. Add a workaround that avoids try_run.

Quoted 8 lines

cmake bug report: https://gitlab.kitware.com/cmake/cmake/issues/16920

Should fix:
http://autobuild.buildroot.net/results/8aa/8aa2bd894416a4508ca7140f8947ff46243f8b78/
http://autobuild.buildroot.net/results/f2c/f2cc965bb134bf4fd9e625eb267b67c949c202fc/

Committed to 2018.02.x and 2018.08.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard