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

test_cypher_suites ubuntu 18.04 build failure due to lack of pthread linkage #7490

Open
NorseGaud opened this issue Jun 11, 2019 · 5 comments

Comments

@NorseGaud
Copy link
Contributor

commented Jun 11, 2019

https://buildkite.com/EOSIO/eosio-base-images/builds/213#59c398c5-7a92-4000-bf87-6e0727ec499f

[ 91%] �[32mBuilding CXX object libraries/chain/CMakeFiles/eosio_chain.dir/chain_id_type.cpp.o�[0m

/usr/lib/x86_64-linux-gnu/libcrypto.a(threads_pthread.o): In function `fork_once_func':

(.text+0x16): undefined reference to `pthread_atfork'

clang: �[0;1;31merror: �[0mlinker command failed with exit code 1 (use -v to see invocation)�[0m

libraries/fc/test/crypto/CMakeFiles/test_cypher_suites.dir/build.make:113: recipe for target 'libraries/fc/test/crypto/test_cypher_suites' failed

make[2]: *** [libraries/fc/test/crypto/test_cypher_suites] Error 1

CMakeFiles/Makefile2:783: recipe for target 'libraries/fc/test/crypto/CMakeFiles/test_cypher_suites.dir/all' failed

make[1]: *** [libraries/fc/test/crypto/CMakeFiles/test_cypher_suites.dir/all] Error 2

@NorseGaud NorseGaud changed the title [1.6.x] Fresh Ubuntu 18.04 image cannot build [1.6.x] Fresh Ubuntu 18.04 build failure Jun 11, 2019

@n8d

This comment has been minimized.

Copy link

commented Jun 20, 2019

Same issue here on a fresh Ubuntu 18.04 system.

@dconry

This comment has been minimized.

Copy link

commented Jun 21, 2019

Ran into this today also. I think this may be tied to openssl 1.1.0 -> 1.1.1 on Ubuntu 18, along with location of pthread_atfork() def... there are add'tl details in the following external issue:

nanomsg/nng#956

@meenxio

This comment has been minimized.

Copy link

commented Jun 25, 2019

just add --pthread options while compiling the sub-project

@taokayan

This comment has been minimized.

Copy link
Contributor

commented Jun 25, 2019

I can build it by making the following change to eos/libraries/fc/CMakeLists.txt:

~/eos1.6/eos/libraries/fc$ git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8056cf0..efb09db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -157,7 +157,7 @@ IF(APPLE)
   find_library(security_framework Security)
   find_library(corefoundation_framework CoreFoundation)
 ENDIF()
-target_link_libraries( fc PUBLIC ${LINK_USR_LOCAL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${readline_libraries} ${ECC_LIB} ${security_framework} ${corefoundation_framework} )
+target_link_libraries( fc PUBLIC ${LINK_USR_LOCAL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${readline_libraries} ${ECC_LIB} ${security_framework} ${corefoundation_framework} pthread )
 
 
 SET(OPENSSL_CONF_TARGET )

@taokayan taokayan self-assigned this Jun 25, 2019

@arhag arhag added the build label Jun 26, 2019

@spoonincode spoonincode changed the title [1.6.x] Fresh Ubuntu 18.04 build failure test_cypher_suites ubuntu 18.04 build failure due to lack of pthread linkage Jul 2, 2019

@zer0blockchain

This comment has been minimized.

Copy link

commented Jul 24, 2019

I can build it by making the following change to eos/libraries/fc/CMakeLists.txt:

~/eos1.6/eos/libraries/fc$ git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8056cf0..efb09db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -157,7 +157,7 @@ IF(APPLE)
   find_library(security_framework Security)
   find_library(corefoundation_framework CoreFoundation)
 ENDIF()
-target_link_libraries( fc PUBLIC ${LINK_USR_LOCAL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${readline_libraries} ${ECC_LIB} ${security_framework} ${corefoundation_framework} )
+target_link_libraries( fc PUBLIC ${LINK_USR_LOCAL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${readline_libraries} ${ECC_LIB} ${security_framework} ${corefoundation_framework} pthread )
 
 
 SET(OPENSSL_CONF_TARGET )

This worked for me. I made the change and created a patch using git diff and apply it using a patch cmd.

EOSIO v1.6.0
EOSIO.CDT v1.6.0

git clone --recursive https://github.com/eosio/eos --branch v1.6.0 --single-branch
git clone --recursive https://github.com/eosio/eosio.cdt --branch v1.6.0 --single-branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.