Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake not able to find pthread lib on migrating to Yocto 2.2 (Morty) #54

Open
tdeva14 opened this issue Dec 14, 2018 · 1 comment
Open
Assignees

Comments

@tdeva14
Copy link

tdeva14 commented Dec 14, 2018

We are currently migrating to Yocto v2.2(Morty) in RDKB devices which runs gcc6 and we are seeing the below configuration error.

| -- 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 - not found
| -- Check if compiler accepts -pthread
| -- Check if compiler accepts -pthread - no
| CMake Error at /mnt/home/dthiya418/Yocto-2.2/txb6morty/tchxb6-morty/tmp/sysroots/x86_64-linux/usr/share/cmake-3.8/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
| Could NOT find Threads (missing: Threads_FOUND)

Attached
CMakeError.log
CMakeOutput.log

@kraj
Copy link
Contributor

kraj commented Dec 19, 2018

here are interesting bits

/mnt/home/dthiya418/Yocto-2.2/txb6morty/tchxb6-morty/tmp/sysroots/x86_64-linux/usr/bin/arm-rdk-linux-gnueabi/arm-rdk-linux-gnueabi-gcc  -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a15 -fno-omit-frame-pointer -fno-optimize-sibling-calls  --sysroot=/mnt/home/dthiya418/Yocto-2.2/txb6morty/tchxb6-morty/tmp/sysroots/tchxb6  -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/mnt/home/dthiya418/Yocto-2.2/txb6morty/tchxb6-morty/tmp/work/cortexa15hf-neon-rdk-linux-gnueabi/parodus2ccsp/git+AUTOINC+e602349bc2-r0=/usr/src/debug/parodus2ccsp/git+AUTOINC+e602349bc2-r0 -fdebug-prefix-map=/mnt/home/dthiya418/Yocto-2.2/txb6morty/tchxb6-morty/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/mnt/home/dthiya418/Yocto-2.2/txb6morty/tchxb6-morty/tmp/sysroots/tchxb6= -Os -pipe -DFEATURE_SUPPORT_RDKLOG -I/mnt/home/dthiya418/Yocto-2.2/txb6morty/tchxb6-morty/tmp/sysroots/x86_64-linux/usr/include/breakpad   -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a15 -fno-omit-frame-pointer -fno-optimize-sibling-calls  --sysroot=/mnt/home/dthiya418/Yocto-2.2/txb6morty/tchxb6-morty/tmp/sysroots/tchxb6  -D_COSA_HAL_ -U_COSA_SIM_ -fno-exceptions -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-strict-aliasing            -DCONFIG_SYSTEM_MOCA -D_ANSC_LINUX -D_ANSC_USER -D_ANSC_LITTLE_ENDIAN_ -D_CCSP_CWMP_TCP_CONNREQ_HANDLER            -D_DSLH_STUN_ -D_NO_PKI_KB5_SUPPORT -D_BBHM_SSE_FILE_IO -D_ANSC_USE_OPENSSL_ -DENABLE_SA_KEY            -D_ANSC_AES_USED_ -D_COSA_INTEL_USG_ARM_ -D_COSA_FOR_COMCAST_ -D_NO_EXECINFO_H_ -DFEATURE_SUPPORT_SYSLOG            -DBUILD_WEB -D_NO_ANSC_ZLIB_ -D_DEBUG -U_ANSC_IPV6_COMPATIBLE_ -DINCLUDE_BREAKPAD -DUSE_NOTIFY_COMPONENT -DNTPD_ENABLE 	   -DUTC_ENABLE -DXDNS_ENABLE 	    -D_XB6_PRODUCT_REQ_ -D_COSA_BCM_ARM_ -D_ENABLE_BAND_STEERING_ -DMOCA_DIAGONISTIC     -DFEATURE_SUPPORT_MESH 	-D_YOCTO_ 	-DPLATFORM_RDKB 	-DRDKB_BUILD 	-I/mnt/home/dthiya418/Yocto-2.2/txb6morty/tchxb6-morty/tmp/sysroots/tchxb6/usr/include/ccsp 	-I/mnt/home/dthiya418/Yocto-2.2/txb6morty/tchxb6-morty/tmp/sysroots/tchxb6/usr/include/wdmp-c 	-I/mnt/home/dthiya418/Yocto-2.2/txb6morty/tchxb6-morty/tmp/sysroots/tchxb6/usr/include/libparodus 	-I/mnt/home/dthiya418/Yocto-2.2/txb6morty/tchxb6-morty/tmp/sysroots/tchxb6/usr/include/dbus-1.0 	-I/mnt/home/dthiya418/Yocto-2.2/txb6morty/tchxb6-morty/tmp/sysroots/tchxb6/usr/lib/dbus-1.0/include 	-I/mnt/home/dthiya418/Yocto-2.2/txb6morty/tchxb6-morty/tmp/sysroots/tchxb6/usr/include/cimplog 	 -D_GNU_SOURCE    -march=armv7ve -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a15 -fno-omit-frame-pointer -fno-optimize-sibling-calls  --sysroot=/mnt/home/dthiya418/Yocto-2.2/txb6morty/tchxb6-morty/tmp/sysroots/tchxb6  -Wl,-O1 -Wl,--hash-style=gnu  -lrdkloggers -lcjson -lmsgpackc -ltrower-base64 -lnanomsg -lcimplog -lwdmp-c -lwrp-c -llibparodus -lm -lpthread -luuid -lstdc++ -lbreakpadwrapper -lsysevent -lutapi -lutctx -lsyscfg -Wl,-O1 -Wl,--hash-style=gnu  -lrdkloggers -lcjson -lmsgpackc -ltrower-base64 -lnanomsg -lcimplog -lwdmp-c -lwrp-c -llibparodus -lm -lpthread -luuid -lstdc++ -lbreakpadwrapper -lsysevent -lutapi -lutctx -lsyscfg  CMakeFiles/cmTC_8d056.dir/CheckSymbolExists.c.o  -o cmTC_8d056 
/usr/src/debug/parodus2ccsp/git+AUTOINC+e602349bc2-r0/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:13: error: undefined reference to 'pthread_create'
collect2: error: ld returned 1 exit status
make[1]: *** [cmTC_8d056] Error 1

What this means is that -lpthread is being added to compiler/linker cmdline but its appears before the .o file which needs the functions from it. so please try to find out how this sequence could be altered such that all LDFLAGS are appended after the .o files on cmdline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants