-
Notifications
You must be signed in to change notification settings - Fork 635
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
How Can I crosscompile ARM? #1606
Comments
Hi @una801, The libraries that are part of the C SDK are able to be compiled by any ISO C 89 compiler. However, the demos and platform implementations in this repository are specific to POSIX, so may not build on systems that are not (mostly) POSIX-compliant. To build an application for another platform, the demos in this repository may be used as a reference, but POSIX-specific calls will have to be replaced with those for your system. If you use CMake to build your application, some parts of the existing Let us know if you have any further questions. |
Thank you for your answer. |
export | grep "arm" `-- The C compiler identification is GNU 9.3.0 WARNING: mqtt_demo_mutual_auth missing definitions for macros: AWS_IOT_ENDPOINT, ROOT_CA_CERT_PATH, CLIENT_CERT_PATH, CLIENT_PRIVATE_KEY_PATH, CLIENT_IDENTIFIER Using values in demo_config.h to define the following macros for mqtt_demo_plaintext: Using values in demo_config.h to define the following macros for mqtt_demo_serializer: Using values in demo_config.h to define the following macros for mqtt_demo_subscription_manager: CMake Warning at demos/CMakeLists.txt:25 (message): CMake Error at demos/CMakeLists.txt:27 (set_target_properties): CMake Error at demos/CMakeLists.txt:27 (set_target_properties): CMake Error at demos/CMakeLists.txt:27 (set_target_properties): Downloading the Amazon Root CA certificate... it appears error like this..how Can I cross compile this sdk?... |
Hi @una801, Those errors are from CMake being unable to find librt, which is used for the multithreaded http download demo and the OTA demos. The other demo targets are still able to be built in such a situation. The demos in this repository are all POSIX or Linux-specific, and though we have compiled for both x64 and ARM, we have not tried cross compiling from different architectures, so I can only provide some recommendations how to proceed with cross compiling. If the target system is also POSIX-compliant, then you may be able to use the existing CMake files without having to make many changes. According to CMake's documentation, you need to manually set
would likely lead to an error when trying to build, as the shared object looks to be compiled for x64 and not ARM. You would need to make sure an ARM-compatible version is present on your machine and able to be found by CMake, or link it dynamically. |
`cmake .. -DOPENSSL_INCLUDE_DIR=/home/youna/tm2sdk/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/include/openssl -DOPENSSL_LIBRARIES=/home/youna/tm2sdk/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib -DOPENSSL_CRYPTO_LIBRARY=/home/youna/tm2sdk/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libcrypt.so -DOPENSSL_SSL_LIBRARY=/home/youna/tm2sdk/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libssl.so -DBUILD_SHARED_LIBS=ON -DOPENSSL_ROOT_DIR=/home/youna/tm2sdk/sysroots/armv7a-vfp-neon-oe-linux-gnueabi Using values in demo_config.h to define the following macros for mqtt_demo_mutual_auth: CMake Warning at demos/CMakeLists.txt:25 (message): CMake Error at demos/CMakeLists.txt:27 (set_target_properties): CMake Error at demos/CMakeLists.txt:27 (set_target_properties): CMake Error at demos/CMakeLists.txt:27 (set_target_properties): Downloading the Amazon Root CA certificate... |
This message is quite common, normally it is OK. I seen it in my system when building for PC as well cross-compile for Raspberry Pi.
You need to check why your ARM target sysroot filesystem does not contain host$ find ./ -name "librt*"
./usr/lib/arm-linux-gnueabihf/librt.a
./usr/lib/arm-linux-gnueabihf/librt.so
./lib/arm-linux-gnueabihf/librt-2.28.so
./lib/arm-linux-gnueabihf/librt.so.1 raspberrypi$ dpkg -S /usr/lib/arm-linux-gnueabihf/librt.a
libc6-dev:armhf: /usr/lib/arm-linux-gnueabihf/librt.a
raspberrypi$ dpkg -S /usr/lib/arm-linux-gnueabihf/librt.so
libc6-dev:armhf: /usr/lib/arm-linux-gnueabihf/librt.so If you can identify which demo application is causing the cmake failure, you can temporary disable it. host$ mv demos/jobs/jobs_demo_mosquitto/CMakeLists.txt demos/jobs/jobs_demo_mosquitto/CMakeLists.txt.disabled You might want to use |
Thank you. |
Hi, as it seems this issue has been resolved, I am closing this issue. If you have further questions on this topic, feel free to open a new issue. |
Crosscompile via arm-linux-gnueabi-gcc must be performed to place sdk in the device. I don't know how to cross-compile the certificate and Cmake and make.
How do I cross compile with gnueabi?
The text was updated successfully, but these errors were encountered: