awslabs / amazon-kinesis-video-streams-webrtc-sdk-c

Amazon Kinesis Video Streams Webrtc SDK is for developers to install and customize realtime communication between devices and enable secure streaming of video, audio to Kinesis Video Streams.
https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-c/group__PublicMemberFunctions.html
Apache License 2.0
1.02k stars 307 forks source link

[Bug]: Cross-compilation issue v1.10.1 vs v.1.9.1, unable to cross-compile libkvspic because "not able to compile a simple test program" #1964

Closed ilyaikik closed 4 months ago

ilyaikik commented 5 months ago

Please confirm you have already done the following

Please answer the following prompt

Describe the bug

I'm building v1.10.1 sdk version for an i.MX6 processor. And I have the error :

 The C compiler

    "/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc"

  is not able to compile a simple test program

while cross-compiling for ARM processor during configure step for 'libkvsCommonLws-download'

Expected Behavior

Version v1.10.1 be able to be cross-compiled like v1.9.1

Current Behavior

[ 55%] Performing configure step for 'libkvsCommonLws-download'
-- The C compiler identification is GNU 6.2.0
-- Check for working C compiler: /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
-- Check for working C compiler: /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Kinesis Video Producer path is /home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download
-- Found PkgConfig: /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'libkvspicUtils'
--   No package 'libkvspicUtils' found
-- The C compiler identification is GNU 6.2.0
-- Check for working C compiler: /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
-- Check for working C compiler: /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -- broken
-- Configuring incomplete, errors occurred!
See also "/home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download/dependency/libkvspic/CMakeFiles/CMakeOutput.log".
See also "/home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download/dependency/libkvspic/CMakeFiles/CMakeError.log".
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download/dependency/libkvspic/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/make cmTC_255a4/fast && make[3]: Entering directory '/home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download/dependency/libkvspic/CMakeFiles/CMakeTmp'
    /usr/bin/make -f CMakeFiles/cmTC_255a4.dir/build.make CMakeFiles/cmTC_255a4.dir/build
    make[4]: Entering directory '/home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download/dependency/libkvspic/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_255a4.dir/testCCompiler.c.o
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc   -O2 -pipe -feliminate-unused-debug-types    -o CMakeFiles/cmTC_255a4.dir/testCCompiler.c.o   -c /home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download/dependency/libkvspic/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_255a4
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_255a4.dir/link.txt --verbose=1
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -O2 -pipe -feliminate-unused-debug-types   -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed  CMakeFiles/cmTC_255a4.dir/testCCompiler.c.o  -o cmTC_255a4 
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find crt1.o: No such file or directory
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find crti.o: No such file or directory
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find crtbegin.o: No such file or directory
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find -lgcc
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find -lgcc_s
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find -lc
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find -lgcc
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find -lgcc_s
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find crtend.o: No such file or directory
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find crtn.o: No such file or directory
    collect2: error: ld returned 1 exit status
    make[4]: *** [CMakeFiles/cmTC_255a4.dir/build.make:87: cmTC_255a4] Error 1
    make[4]: Leaving directory '/home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download/dependency/libkvspic/CMakeFiles/CMakeTmp'
    make[3]: *** [Makefile:121: cmTC_255a4/fast] Error 2
    make[3]: Leaving directory '/home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download/dependency/libkvspic/CMakeFiles/CMakeTmp'

Reproduction Steps

I source my environment from yocto poky tolchain:

. /opt/poky/imx6/2.2/environment-setup-cortexa9hf-neon-poky-linux-gnueabi

and run cmake command from build folder:

cmake .. \
-DBUILD_DEPENDENCIES=ON \
-DBUILD_STATIC_LIBS=ON \
-DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-pc-linux-gnu \
-DBUILD_LIBSRTP_DESTINATION_PLATFORM=arm-poky-linux \
-DUSE_OPENSSL=OFF \
-DUSE_MBEDTLS=ON \
-DFPU_FLAGS="-mfloat-abi=hard -mfpu=neon" \
&& \
make

Main CMakeLists.txt and CMake/Dependencies/libkvsCommonLws-CMakeLists.txt are slightly changed to suppress

-- Performing Test LWS_HAVE_MBEDTLS_SSL_NEW_SESSION_TICKET
-- Performing Test LWS_HAVE_MBEDTLS_SSL_NEW_SESSION_TICKET - Failed
Compiling with SSL support
MBEDTLS include dir: /home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/include
MBEDTLS libraries: /home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/lib/libmbedtls.a;/home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/lib/libmbedx509.a;/home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/lib/libmbedcrypto.a
-- Looking for SSL_CTX_set1_param
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LIBCAP_LIBRARIES
    linked by target "cmTC_faf4c" in directory /home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c/open-source/libwebsockets/build/src/project_libwebsockets-build/CMakeFiles/CMakeTmp

message with next patch:

Date:   Wed Apr 3 21:19:45 2024 +0300

    libcap patch

diff --git a/CMake/Dependencies/libwebsockets-CMakeLists.txt b/CMake/Dependencies/libwebsockets-CMakeLists.txt
index 8e0f068ca..344625a22 100644
--- a/CMake/Dependencies/libwebsockets-CMakeLists.txt
+++ b/CMake/Dependencies/libwebsockets-CMakeLists.txt
@@ -35,6 +35,7 @@ ExternalProject_Add(project_libwebsockets
     PREFIX            ${CMAKE_CURRENT_BINARY_DIR}/build
     LIST_SEPARATOR    |
     CMAKE_ARGS
+        -DLIBCAP_LIBRARIES=${LIBCAP_LIBRARIES_PATH}
         -DCMAKE_INSTALL_PREFIX=${OPEN_SRC_INSTALL_PREFIX}
         -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
         -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8e362f5fb..5f7d1667c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,6 +70,8 @@ if(NOT KVSWEBRTC_HAVE_GETIFADDRS)
 endif()
 endif()

+find_library(LIBCAP_LIBRARIES NAMES cap)
+
 set(CMAKE_MACOSX_RPATH TRUE)
 get_filename_component(ROOT "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)

I've tried to fork amazon-kinesis-video-streams-producer-c and amazon-kinesis-video-streams-pic projects to bring -DCMAKE_C_COMPILER_WORKS=1 to CMake/Dependencies/libkvspic-CMakeLists.txt and set(CMAKE_C_COMPILER_WORKS TRUE) directly to amazon-kinesis-video-streams-pic/CMakeLists.txtt but that didn't help.

But the same manner v1.9.1 can be built without a problems. Please advise what am I doing wrong? Thank you.

P.S. The time of first time run the configuring of mbedtls show the same " is not able to compile a simple test program" error. But the second run (not cleaning anything) - mbedtls lib compiled without the problems.

WebRTC C SDK version being used

v.1.10.1

If it was working in a previous version, which one?

v1.9.1

Compiler and Version used

arm-poky-linux-gnueabi-gcc (GCC) 6.2.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Operating System and version

Linux ilya 5.15.0-101-generic #111~20.04.1-Ubuntu SMP Mon Mar 11 15:44:43 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Platform being used

pc

stefankiesz commented 5 months ago

Hi @ilyaikik, can you please report whether you are able to build the commonLWS library standalone on your environment using the same version and CMake flags as found here in this SDK's dependency configuration. (Build instructions are the same as this SDK: git clone <url> -b <the version tag>, cmake .. <flags> and make from a created /build directory).

ilyaikik commented 5 months ago

Hi @ilyaikik, can you please report whether you are able to build the commonLWS library standalone on your environment using the same version and CMake flags as found here in this SDK's dependency configuration. (Build instructions are the same as this SDK: git clone <url> -b <the version tag>, cmake .. <flags> and make from a created /build directory).

Hello @stefankiesz, thank you for the message !

Here are the results

For v1.5.2 (from SDK v1.10.1):

git clone https://github.com/awslabs/amazon-kinesis-video-streams-producer-c.git -b v1.5.2
...
cmake .. \
      -DBUILD_COMMON_LWS=ON \
      -DBUILD_COMMON_CURL=OFF \
      -DBUILD_DEPENDENCIES=FALSE \
      -DCMAKE_BUILD_TYPE="Release" \
      -DUSE_OPENSSL=OFF \
      -DUSE_MBEDTLS=ON

-- The C compiler identification is GNU 6.2.0
-- Check for working C compiler: /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
-- Check for working C compiler: /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Kinesis Video Producer path is /home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c
-- Found PkgConfig: /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'libkvspicUtils'
--   No package 'libkvspicUtils' found
-- The C compiler identification is GNU 6.2.0
-- Check for working C compiler: /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
-- Check for working C compiler: /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -- broken
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c/dependency/libkvspic/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/make cmTC_281de/fast && /usr/bin/make -f CMakeFiles/cmTC_281de.dir/build.make CMakeFiles/cmTC_281de.dir/build
    make[1]: Entering directory '/home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c/dependency/libkvspic/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_281de.dir/testCCompiler.c.o
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc   -O2 -pipe -feliminate-unused-debug-types    -o CMakeFiles/cmTC_281de.dir/testCCompiler.c.o   -c /home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c/dependency/libkvspic/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_281de
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_281de.dir/link.txt --verbose=1
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -O2 -pipe -feliminate-unused-debug-types   -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed  CMakeFiles/cmTC_281de.dir/testCCompiler.c.o  -o cmTC_281de 
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find crt1.o: No such file or directory
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find crti.o: No such file or directory
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find crtbegin.o: No such file or directory
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find -lgcc
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find -lgcc_s
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find -lc
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find -lgcc
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find -lgcc_s
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find crtend.o: No such file or directory
    /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find crtn.o: No such file or directory
    collect2: error: ld returned 1 exit status
    make[1]: *** [CMakeFiles/cmTC_281de.dir/build.make:87: cmTC_281de] Error 1
    make[1]: Leaving directory '/home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c/dependency/libkvspic/CMakeFiles/CMakeTmp'
    make: *** [Makefile:121: cmTC_281de/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)

-- Configuring incomplete, errors occurred!
See also "/home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c/dependency/libkvspic/CMakeFiles/CMakeOutput.log".
See also "/home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c/dependency/libkvspic/CMakeFiles/CMakeError.log".
CMake Error at CMake/Utilities.cmake:25 (message):
  CMake step for libkvspic failed: 1
Call Stack (most recent call first):
  CMakeLists.txt:141 (fetch_repo)

-- Configuring incomplete, errors occurred!
See also "/home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c/build/CMakeFiles/CMakeOutput.log".

For 178109a5dbfc5288ba5cf7fab1dc1afd5e2e182b (v1.5.1)( from SDK v1.9.1) :

git clone --no-checkout https://github.com/awslabs/amazon-kinesis-video-streams-producer-c.git
git checkout 178109a5dbfc5288ba5cf7fab1dc1afd5e2e182b
...
cmake .. \
      -DBUILD_COMMON_LWS=ON \
      -DBUILD_COMMON_CURL=OFF \
      -DBUILD_DEPENDENCIES=FALSE \
      -DCMAKE_BUILD_TYPE="Release" \
      -DUSE_OPENSSL=OFF \
      -DUSE_MBEDTLS=ON

-- The C compiler identification is GNU 6.2.0
-- Check for working C compiler: /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
-- Check for working C compiler: /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Kinesis Video Producer path is /home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c-1.9.1
-- Found PkgConfig: /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'libkvspicUtils'
--   No package 'libkvspicUtils' found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c-1.9.1/dependency/libkvspic
Scanning dependencies of target libkvspic-download
[ 11%] Creating directories for 'libkvspic-download'
[ 22%] Performing download step (git clone) for 'libkvspic-download'
Cloning into 'kvspic-src'...
Note: switching to '57637ea593f4b43c509413a44d993ed08d7f2616'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 57637ea Merge pull request #210 from awslabs/release-101
[ 33%] No patch step for 'libkvspic-download'
[ 44%] Performing update step for 'libkvspic-download'
[ 55%] No configure step for 'libkvspic-download'
[ 66%] No build step for 'libkvspic-download'
[ 77%] No install step for 'libkvspic-download'
[ 88%] No test step for 'libkvspic-download'
[100%] Completed 'libkvspic-download'
[100%] Built target libkvspic-download
-- The CXX compiler identification is GNU 6.2.0
-- Check for working CXX compiler: /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
-- Check for working CXX compiler: /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find MbedTLS (missing: MBEDTLS_LIBRARY MBEDTLS_INCLUDE_DIRS
  MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  CMake/FindMbedTLS.cmake:10 (find_package_handle_standard_args)
  CMakeLists.txt:142 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c-1.9.1/build/CMakeFiles/CMakeOutput.log".
See also "/home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c-1.9.1/build/CMakeFiles/CMakeError.log".

Problems with mbedtls (looks like that is expected), but the same step of configuring libkvspicUtils has passed.

stefankiesz commented 5 months ago

@ilyaikik , this is great, thanks for trying both out. So the two Producer C (aka CommonLWS) versions are using these two sequential KVS PIC versions: 1.0.1 (working for you) and 1.1.0 (not working). Looking at the 1.1.0 diff, I don't see anything in the cmake build system changes that sticks out as potentially causing such issues - the biggest difference there is the handling of the debug/release modes. Can you try again building the non-working v1.5.2 Producer C but with -DCMAKE_BUILD_TYPE="Debug" instead of "Release".

The missing libraries seem to be compiler-specific, and I found this StackOverflow thread which might be helpful for debugging this compiler. I don't have experience with this Poky build system, but I'll take a "poke" at it in the mean time and see if I can replicate this issue.

ilyaikik commented 5 months ago

@stefankiesz I have both good and bad news)

Lets start with the bad ones. Changing -DCMAKE_BUILD_TYPE to "Debug" doesn't help.

But! I also have a newer version of an arm compiler within the fresh Yocto release. And you know what? Suddenly that works with v1.5.2. Looks like this:

-- Toolchain file defaulted to '/opt/poky/imx6/4.0.13/sysroots/x86_64-smpsdk-linux/usr/share/cmake/OEToolchainConfig.cmake'
-- The C compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning (dev) at /opt/poky/imx6/4.0.13/sysroots/x86_64-smpsdk-linux/usr/share/cmake-3.22/Modules/GNUInstallDirs.cmake:239 (message):
  Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
  target architecture is known.  Please enable at least one language before
  including GNUInstallDirs.
Call Stack (most recent call first):
  CMakeLists.txt:11 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Kinesis Video Producer path is /home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c
-- Found PkgConfig: /opt/poky/imx6/4.0.13/sysroots/x86_64-smpsdk-linux/usr/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'libkvspicUtils'
--   No package 'libkvspicUtils' found
-- Toolchain file defaulted to '/opt/poky/imx6/4.0.13/sysroots/x86_64-smpsdk-linux/usr/share/cmake/OEToolchainConfig.cmake'
-- The C compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c/dependency/libkvspic
[ 11%] Creating directories for 'libkvspic-download'
[ 22%] Performing download step (git clone) for 'libkvspic-download'
Cloning into 'kvspic-src'...
HEAD is now at 65e38da release candidate (#244)
[ 33%] Performing update step for 'libkvspic-download'
[ 44%] No patch step for 'libkvspic-download'
[ 55%] No configure step for 'libkvspic-download'
[ 66%] No build step for 'libkvspic-download'
[ 77%] No install step for 'libkvspic-download'
[ 88%] No test step for 'libkvspic-download'
[100%] Completed 'libkvspic-download'
[100%] Built target libkvspic-download
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Could NOT find Threads (missing: Threads_FOUND) 
-- Could NOT find Threads (missing: Threads_FOUND) 
CMake Error at /opt/poky/imx6/4.0.13/sysroots/x86_64-smpsdk-linux/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find MbedTLS (missing: MBEDTLS_LIBRARY MBEDTLS_INCLUDE_DIRS
  MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
Call Stack (most recent call first):
  /opt/poky/imx6/4.0.13/sysroots/x86_64-smpsdk-linux/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  CMake/FindMbedTLS.cmake:10 (find_package_handle_standard_args)
  CMakeLists.txt:164 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c/build/CMakeFiles/CMakeOutput.log".
See also "/home/ilya/Dev/src/amazon-kinesis-video-streams-producer-c/build/CMakeFiles/CMakeError.log".

I would be very grateful if you help me with finding out what is wrong with that old compiler. Because we still have a machines to maintain with an outdated firmware.

Maybe there is something new in that testfile to be compiled during the configuration step? And by the way, don't you know, why -DCMAKE_C_COMPILER_WORKS=1 doesn't work? Maybe I can try to build kvspic itself and play with that flag? Thanks!

P.S. If you'd like to "poke" this Yocto Poky bear I will love to help you =)

ilyaikik commented 5 months ago

Ok, I've made it work. Looks like with old environment not all the flags can be taken for compiler. Give me the time to explain...

ilyaikik commented 5 months ago

@ilyaikik , this is great, thanks for trying both out. So the two Producer C (aka CommonLWS) versions are using these two sequential KVS PIC versions: 1.0.1 (working for you) and 1.1.0 (not working). Looking at the 1.1.0 diff, I don't see anything in the cmake build system changes that sticks out as potentially causing such issues - the biggest difference there is the handling of the debug/release modes. Can you try again building the non-working v1.5.2 Producer C but with -DCMAKE_BUILD_TYPE="Debug" instead of "Release".

The missing libraries seem to be compiler-specific, and I found this StackOverflow thread which might be helpful for debugging this compiler. I don't have experience with this Poky build system, but I'll take a "poke" at it in the mean time and see if I can replicate this issue.

I've checked your link. Then I thought what actual flags are going to the compiler line? After searching in cmake log files I added all CC flags right to CFLAGS adn CXXFLAGS (for completeness). So now my environment looks like this (--sysroot and arch instruction are copied from CC to CFLAGS and CXXFLAGS):

AR=arm-poky-linux-gnueabi-ar
ARCH=arm
AS='arm-poky-linux-gnueabi-as '
BROWSER=/home/ilya/.vscode-server/bin/863d2581ecda6849923a2118d93a088b0745d9d6/bin/helpers/browser.sh
CC='arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi'
CCACHE_PATH=/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin:/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/../x86_64-pokysdk-linux/bin:/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-uclibc:/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-musl:
CFLAGS=' -O2 -pipe -feliminate-unused-debug-types -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9  --sysroot=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi '
COLORTERM=truecolor
CONFIGURE_FLAGS='--target=arm-poky-linux-gnueabi --host=arm-poky-linux-gnueabi --build=x86_64-linux --with-libtool-sysroot=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi'
CONFIG_SITE=/opt/poky/imx6/2.2/site-config-cortexa9hf-neon-poky-linux-gnueabi
CPP='arm-poky-linux-gnueabi-gcc -E -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi'
CPPFLAGS=''
CROSS_COMPILE=arm-poky-linux-gnueabi-
CXX='arm-poky-linux-gnueabi-g++ -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi'
CXXFLAGS=' -O2 -pipe -feliminate-unused-debug-types -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi '
DBUS_SESSION_BUS_ADDRESS='unix:path=/run/user/1000/bus'
GDB=arm-poky-linux-gnueabi-gdb
GIT_ASKPASS=/home/ilya/.vscode-server/bin/863d2581ecda6849923a2118d93a088b0745d9d6/extensions/git/dist/askpass.sh
HOME=/home/ilya
KCFLAGS='--sysroot=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi'
LANG=en_US.UTF-8
LC_ADDRESS=ru_RU.UTF-8
LC_IDENTIFICATION=ru_RU.UTF-8
LC_MEASUREMENT=ru_RU.UTF-8
LC_MONETARY=ru_RU.UTF-8
LC_NAME=ru_RU.UTF-8
LC_NUMERIC=ru_RU.UTF-8
LC_PAPER=ru_RU.UTF-8
LC_TELEPHONE=ru_RU.UTF-8
LC_TIME=ru_RU.UTF-8
LD='arm-poky-linux-gnueabi-ld  --sysroot=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi'
LDFLAGS='-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed'
LESS=-R
LOGNAME=ilya
LSCOLORS=Gxfxcxdxbxegedabagacad
LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:'
M4=m4
MOTD_SHOWN=pam
NM=arm-poky-linux-gnueabi-nm
OBJCOPY=arm-poky-linux-gnueabi-objcopy
OBJDUMP=arm-poky-linux-gnueabi-objdump
OECORE_ACLOCAL_OPTS='-I /opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/share/aclocal'
OECORE_DISTRO_VERSION=2.2
OECORE_NATIVE_SYSROOT=/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux
OECORE_SDK_VERSION=2.2
OECORE_TARGET_SYSROOT=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi
OE_CMAKE_TOOLCHAIN_FILE=/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake
OE_QMAKE_AR=arm-poky-linux-gnueabi-ar
OE_QMAKE_CC='arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi'
OE_QMAKE_CFLAGS='-O2 -pipe -feliminate-unused-debug-types'
OE_QMAKE_CXX='arm-poky-linux-gnueabi-g++ -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi'
OE_QMAKE_CXXFLAGS='-O2 -pipe -feliminate-unused-debug-types'
OE_QMAKE_INCDIR_QT=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5
OE_QMAKE_LDFLAGS='-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed'
OE_QMAKE_LIBDIR_QT=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib
OE_QMAKE_LINK='arm-poky-linux-gnueabi-g++ -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi'
OE_QMAKE_MOC=/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/moc
OE_QMAKE_PATH_HOST_BINS=/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/qt5
OE_QMAKE_QDBUSCPP2XML=/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qdbuscpp2xml
OE_QMAKE_QDBUSXML2CPP=/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qdbusxml2cpp
OE_QMAKE_QT_CONFIG=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/qconfig.pri
OE_QMAKE_RCC=/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/rcc
OE_QMAKE_UIC=/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/uic
OLDPWD=/home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c_jetson_last_fork/build
PAGER=less
PATH=/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/qt5:/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin:/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/sbin:/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/bin:/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/sbin:/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/../x86_64-pokysdk-linux/bin:/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-uclibc:/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-musl:/home/ilya/.vscode-server/bin/863d2581ecda6849923a2118d93a088b0745d9d6/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PKG_CONFIG_PATH=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib/pkgconfig:/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/share/pkgconfig
PKG_CONFIG_SYSROOT_DIR=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi
PWD=/home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c_jetson_last_fork
QMAKESPEC=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++
QT_CONF_PATH=/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qt.conf
RANLIB=arm-poky-linux-gnueabi-ranlib
SDKTARGETSYSROOT=/opt/poky/imx6/2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi
SHELL=/usr/bin/zsh
SHLVL=1
SSH_CLIENT='10.36.3.230 40130 22'
SSH_CONNECTION='10.36.3.230 40130 10.36.3.98 22'
STRIP=arm-poky-linux-gnueabi-strip
TARGET_PREFIX=arm-poky-linux-gnueabi-
TERM=xterm-256color
TERM_PROGRAM=vscode
TERM_PROGRAM_VERSION=1.87.2
USER=ilya
USER_ZDOTDIR=/home/ilya
VSCODE_GIT_ASKPASS_EXTRA_ARGS=''
VSCODE_GIT_ASKPASS_MAIN=/home/ilya/.vscode-server/bin/863d2581ecda6849923a2118d93a088b0745d9d6/extensions/git/dist/askpass-main.js
VSCODE_GIT_ASKPASS_NODE=/home/ilya/.vscode-server/bin/863d2581ecda6849923a2118d93a088b0745d9d6/node
VSCODE_GIT_IPC_HANDLE=/run/user/1000/vscode-git-e2d409999c.sock
VSCODE_INJECTION=1
VSCODE_IPC_HOOK_CLI=/run/user/1000/vscode-ipc-74f6c033-046d-44a4-89c3-ca3f47601299.sock
XDG_RUNTIME_DIR=/run/user/1000
XDG_SESSION_CLASS=user
XDG_SESSION_ID=213
XDG_SESSION_TYPE=tty
ZDOTDIR=/home/ilya
ZSH=/home/ilya/.oh-my-zsh

After doing so I can pass the kvspic configuration step.

But now I have this error (I'm not sure does it relate or not):

...
...
[ 37%] Building C object CMakeFiles/kvsCommonLws.dir/src/source/Common/Lws/LwsCall.c.o
/home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c_jetson_last_fork/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download/src/source/Common/Lws/LwsCall.c: In function ‘lwsIotCallbackRoutine’:
/home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c_jetson_last_fork/open-source/libkvsCommonLws/build/src/libkvsCommonLws-download/src/source/Common/Lws/LwsCall.c:195:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
                 pRequestHeader = (PRequestHeader) item;
                                  ^
[ 38%] Building C object CMakeFiles/kvsCommonLws.dir/src/source/Common/Lws/LwsIotCredentialProvider.c.o
[ 39%] Linking C shared library libkvsCommonLws.so
/opt/poky/imx6/2.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/real-ld: cannot find -lwebsockets
collect2: error: ld returned 1 exit status
make[5]: *** [CMakeFiles/kvsCommonLws.dir/build.make:250: libkvsCommonLws.so.1.5.2] Error 1
make[4]: *** [CMakeFiles/Makefile2:102: CMakeFiles/kvsCommonLws.dir/all] Error 2
make[3]: *** [Makefile:130: all] Error 2
make[2]: *** [CMakeFiles/libkvsCommonLws-download.dir/build.make:113: build/src/libkvsCommonLws-download-stamp/libkvsCommonLws-download-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/libkvsCommonLws-download.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
CMake Error at CMake/Utilities.cmake:75 (message):
  CMake step for libkvsCommonLws failed: 2
Call Stack (most recent call first):
  CMakeLists.txt:249 (build_dependency)

-- Configuring incomplete, errors occurred!
See also "/home/ilya/Dev/src/amazon-kinesis-video-streams-webrtc-sdk-c_jetson_last_fork/build/CMakeFiles/CMakeOutput.log".

BTW cmake version: in environment with new compiler that pass kvspic configure step: cmake version 3.22.3 (btw environment for this looks pretty the same except the paths)

in environment that is not: cmake version 3.16.3 Maybe that metters too.

So what do you think, why newest kvspic cannot get all the flags from the environment? And maybe you could help with that linking -lwesockets error.

Thanks!

stefankiesz commented 5 months ago

Thank you for all the details, my attention has been occupied with pressing issues, will get back to investigating this on this coming week.

niyatim23 commented 5 months ago

Hi @ilyaikik, what toolchain are you trying to cross-compile against? We have some cross-compilatilon builds in the CI if that works for you

https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c/blob/f1073439213db4aa4b4b7cc1423609d920dd5489/.github/workflows/ci.yml#L612-L665

github-actions[bot] commented 4 months ago

It looks like this issue has not been active for 10 days. If the issue is not resolved, please add an update to the ticket, else it will be automatically resolved in a few days.

niyatim23 commented 4 months ago

Closing due to no response

stefankiesz commented 4 months ago

Hi @ilyaikik, getting back to this now. Can you please share if there are any updates on your efforts?