Skip to content

Linking Error to libatomic in raspberry pi 4 #814

Open
@asyarifstudio

Description

@asyarifstudio

Describe the bug

I'm not able to build the library with openssl library in raspberry pi 2, here is the error message

[ 84%] Linking CXX executable IotJobs-cpp-tests
/usr/bin/ld: /usr/lib/arm-linux-gnueabihf/libcrypto.a(libcrypto-lib-threads_pthread.o): in function CRYPTO_atomic_or':
(.text+0x264): undefined reference to __atomic_is_lock_free'
/usr/bin/ld: (.text+0x310): undefined reference to __atomic_fetch_or_8'
/usr/bin/ld: /usr/lib/arm-linux-gnueabihf/libcrypto.a(libcrypto-lib-threads_pthread.o): in function CRYPTO_atomic_load':
(.text+0x36c): undefined reference to __atomic_is_lock_free'
/usr/bin/ld: (.text+0x3e4): undefined reference to __atomic_load_8'
collect2: error: ld returned 1 exit status
gmake[3]: *** [jobs/tests/CMakeFiles/IotJobs-cpp-tests.dir/build.make:129: jobs/tests/IotJobs-cpp-tests] Error 1
gmake[3]: Leaving directory '/home/pi/work2/iot-safe-aws-demo/build/awscrt'
gmake[2]: *** [CMakeFiles/Makefile2:1830: jobs/tests/CMakeFiles/IotJobs-cpp-tests.dir/all] Error 2
gmake[2]: Leaving directory '/home/pi/work2/iot-safe-aws-demo/build/awscrt'
gmake[1]: *** [Makefile:146: all] Error 2
gmake[1]: Leaving directory '/home/pi/work2/iot-safe-aws-demo/build/awscrt'
make: *** [Makefile:20: awscrt] Error 2

I've tried to use -DCMAKE_EXE_LINKER_FLAGS="-latomic" as described in https://gitlab.kitware.com/cmake/cmake/-/issues/21174#note_830453 as workaround but I still get the issue.

Expected Behavior

Linking successful

Current Behavior

Linking to libatomic failed

Reproduction Steps

cmake -DCMAKE_INSTALL_PREFIX="" -DUSE_OPENSSL=ON
on raspberry pi 4

Possible Solution

No response

Additional Information/Context

No response

SDK version used

latest

Environment details (OS name and version, etc.)

Raspberry pi 4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions