aws-samples / aws-iot-securetunneling-localproxy

AWS Iot Secure Tunneling local proxy reference C++ implementation
https://docs.aws.amazon.com/iot/latest/developerguide/what-is-secure-tunneling.html
Apache License 2.0
77 stars 72 forks source link

Linker errror (__atomic_fetch_add_8) on Raspbian 10 #8

Closed ChrisEt closed 4 years ago

ChrisEt commented 4 years ago

When I try to build localproxy on a Raspberry 3B running Raspbian 10, I get the following linker error:

/usr/bin/ld: CMakeFiles/localproxy.dir/src/TcpAdapterProxy.cpp.o: in function `boost::beast::websocket::detail::stream_prng::create_mask() [clone .isra.3452]':
TcpAdapterProxy.cpp:(.text+0x5a44): undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: CMakeFiles/localproxy.dir/src/TcpAdapterProxy.cpp.o: in function `boost::beast::websocket::detail::stream_prng::prng()':
TcpAdapterProxy.cpp:(.text._ZN5boost5beast9websocket6detail11stream_prng4prngEv[_ZN5boost5beast9websocket6detail11stream_prng4prngEv]+0x7c): undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: /usr/local/lib/libprotobuf-lite.a(arena.cc.o): in function `google::protobuf::internal::ArenaImpl::Init()':
arena.cc:(.text+0x34): undefined reference to `__atomic_fetch_add_8'

I think this is more or less the same cause as #2. Also, the workaround mentioned in that issue solved the problem for me:

In CMakeLists.txt I commented out the cross-compiling check so that the atomic library is always included:

#if (${CMAKE_CROSSCOMPILING})
    target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TARGET_NAME} atomic)
    target_link_libraries(${AWS_TUNNEL_LOCAL_PROXY_TEST_NAME} atomic)
#endif ()

For me, the issue is solved with that. I'm writing this in case others experience the same problem!

DavidOgunsAWS commented 4 years ago

Hi. I'm closing this issue due to the latest commit changing the CMake build to always link to libatomic. No one should be seeing this issue for now.