I am trying to cross compile libwebsocket for arm-oe-linux-gnueabi but getting the error
/opt/arm-oe-linux-gnueabi-generic/bin/../lib/gcc/arm-oe-linux-gnueabi/4.9.4/../../../../arm-oe-linux-gnueabi/bin/ld: CMakeFiles/lws-minimal-secure-streams-threads.dir/minimal-secure-streams-threads.c.obj: undefined reference to symbol 'pthread_join@@GLIBC_2.4'
/opt/arm-oe-linux-gnueabi-generic/bin/../lib/gcc/arm-oe-linux-gnueabi/4.9.4/../../../../arm-oe-linux-gnueabi/bin/ld: /opt/arm-oe-linux-gnueabi-generic/bin/../arm-oe-linux-gnueabi/sysroot/lib/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [minimal-examples-lowlevel/secure-streams/minimal-secure-streams-threads/CMakeFiles/lws-minimal-secure-streams-threads.dir/build.make:100: bin/lws-minimal-secure-streams-threads] Error 1
make[1]: *** [CMakeFiles/Makefile2:5734: minimal-examples-lowlevel/secure-streams/minimal-secure-streams-threads/CMakeFiles/lws-minimal-secure-streams-threads.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
The cmake file I am using is following
cmake_minimum_required(VERSION 3.10)
set(CROSS_PATH /opt/arm-oe-linux-gnueabi-generic/bin)
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_CXX_COMPILER "${CROSS_PATH}/arm-oe-linux-gnueabi-g++")
set(CMAKE_C_COMPILER "${CROSS_PATH}/arm-oe-linux-gnueabi-gcc")
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(CMAKE_USE_WIN32_THREADS_INIT 0)
set(CMAKE_USE_PTHREADS_INIT 1)
set(THREADS_PREFER_PTHREAD_FLAG ON)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lrt")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lrt")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error")
set(CMAKE_FIND_ROOT_PATH "${CROSS_PATH}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
cmake command issued is following
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cross-compilation.cmake -DLWS_WITH_HTTP2=1 -DLWS_OPENSSL_INCLUDE_DIRS=/home/hasi/Desktop/compiled/include -DLWS_OPENSSL_LIBRARIES="/home/hasi/Desktop/compiled/lib/libssl.so;/home/hasi/Desktop/compiled/lib/libcrypto.so" -B .
how to fix this I am using ubuntu 22.04.03 LTS