Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

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

Closed
NorseGaud opened this issue Jun 11, 2019 · 6 comments
Closed
Assignees
Labels
build Issues related to building in progress

Comments

@NorseGaud
Copy link
Contributor

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
Copy link

n8d commented Jun 20, 2019

Same issue here on a fresh Ubuntu 18.04 system.

@dconry
Copy link

dconry 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

@bwhour
Copy link

bwhour commented Jun 25, 2019

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

@taokayan
Copy link
Contributor

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 Issues related to building 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
Copy link

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

@aclark-b1
Copy link

In order to focus our efforts on issues that are currently creating difficulty for the community we are closing tickets that were created prior to the EOSIO 2.0 release. If you believe this issue is still relevant please feel free to reopen it or create a new one. Thank you for your continued support of EOSIO!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build Issues related to building in progress
Projects
None yet
Development

No branches or pull requests

8 participants