awslabs / aws-crt-python

Python bindings for the AWS Common Runtime
Apache License 2.0
87 stars 43 forks source link

undefined symbol: aes_hw_encrypt #461

Closed kharalanov closed 1 year ago

kharalanov commented 1 year ago

Hi - I'm compiling and installing awsiotsdk on Intel Arria10 SoC (ARM Cortex-A9). I'm using buildroot 2023.02. The Linux kernel is v4.14. I've tried both Python 3.10 and 3.11 as well as GCC 8.5.0 and GCC 10.3.1. In both cases the compile and installation works fine with single warning about the GCC not supported due to a memcmp related bug reported although it looks like this bug was fixed in those particular versions of the compilers.

Here is the full error:

Python 3.11.2 (main, Mar 15 2023, 13:25:30) [GCC 10.3.1 20210621] on linux Type "help", "copyright", "credits" or "license" for more information.

import awsiot Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.11/site-packages/awsiot/init.py", line 14, in File "/usr/lib/python3.11/site-packages/awscrt/mqtt.py", line 9, in ImportError: /usr/lib/python3.11/site-packages/_awscrt.cpython-311-arm-linux-gnueabihf.so: undefined symbol: aes_hw_encrypt

Attached is the full build log. Thanks awscrt_build_log.txt

graebm commented 1 year ago

This seems similar to https://github.com/awslabs/aws-crt-python/issues/444 Cross-compiling with buildroot isn't something we know how to do yet

kharalanov commented 1 year ago

Hi @graebm - Thanks for the link to #444. This actually helped. Looks like buildroot or some other config script is not setting correctly the processor type to arm. The only change I made was to add this to crt/CMakeList.txt: set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR arm) I don't get the error anymore and and I can publish to and receive from the AWS IOT Core. I think we can close this issue.