Closed joseph-vincent closed 2 years ago
Thank you for reporting this issue!
There is an issue flagged for GCC compiler version (current one in use in this toolchain is 11.2.1)
The warning message does not fail the build.
-- Run check_run file_to_test 'memcmp_invalid_stripped_check.c', flag_to_set 'MEMCMP_INVALID_STRIPPED', and compile_flags '-O3 -DNDEBUG'.
CMake Warning at crt/aws-crt-cpp/crt/aws-lc/CMakeLists.txt:210 (message):
Currently, GCC 11.2.1 is not supported due to a memcmp related bug reported
in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189.
We strongly recommend against using the GCC 11.2.1 compiler.
Building it on an Alpine 3.13 docker container
Would you help provide the Docker image(e.g. ubuntu-18.04)?
Hi @bryce-shang,
Thanks for the response. I was able to work through this issue.
The flag which was missing is -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=arm
With these flags, Crypto library is picking up ARM specific assembly code for compilation. I had tried the CMAKE_SYSTEM_PROCESSOR alone, but that had not worked. With inclusion of CMAKE_SYSTEM_NAME, it started working.
The command now used for compilation is:
cmake -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=arm -DCMAKE_CXX_COMPILER=/armv7r-linux-musleabihf-cross/bin/armv7r-linux-musleabihf-g++ -DCMAKE_C_COMPILER=/armv7r-linux-musleabihf-cross/bin/armv7r-linux-musleabihf-gcc -DCMAKE_LINKER=/armv7r-linux-musleabihf-cross/bin/armv7r-linux-musleabihf-ld -DCMAKE_AR=/armv7r-linux-musleabihf-cross/bin/armv7r-linux-musleabihf-ar -DCMAKE_INSTALL_PREFIX=/armv7r-linux-musleabihf-cross/usr/local -DCMAKE_PREFIX_PATH=/armv7r-linux-musleabihf-cross/usr/local -DBUILD_DEPS=ON -DCMAKE_BUILD_TYPE="Release" /aws-iot-device-sdk-cpp-v2
Closing this issue.
Hi @bryce-shang ,
To answer your question, I am using stock alpine 3.13 image, which can be downloaded using docker pull alpine:3.13
Problem:
I am trying to cross compile aws-iot-device-sdk-cpp-v2 using ARM MUSL toolchain. But the compilation is failing at aws-lc. When executing the Cmake command before the actual build, noticed that it is detecting the CMAKE_SYSTEM_PROCESSOR as x86_64. I think this maybe the reason for the failure, as the file at which it is failing is assembly code for x86 (crt/aws-crt-cpp/crt/aws-lc/crypto/fipsmodule/CMakeFiles/fipsmodule.dir/aesni-x86.S.o)
Also tried setting CMAKE_SYSTEM_PROCESSOR to arm by doing export and by passing it as set argument for cmake.
There is an issue flagged for GCC compiler version (current one in use in this toolchain is 11.2.1)
Similar issue was already logged (https://github.com/aws/aws-iot-device-sdk-cpp-v2/issues/293) Created this new issue as that one is already closed due to staleness.
Thanks in advance. Any help is appreciated.
Relevant details
ARM MUSL toolchain : (http://musl.cc/armv7l-linux-musleabihf-cross.tgz) AWS-LC commit: 7e7f06cae8df1c8d7d9b6c9452d17935097343de (HEAD, tag: v0.0.2) aws-iot-device-sdk-cpp-v2 commit : bc51b8a97e2590b03f0118107ee19c85f281c1e3 (v1.15.2)
System information: for linux, below info can be collected by running
uname -srvmp
Building it on an Alpine 3.13 docker container Linux 5.4.0-91-generic #102~18.04.1-Ubuntu SMP Thu Nov 11 14:46:36 UTC 2021 x86_64 unknown Same results on a Ubuntu 18.04 VM as well.Build log: