Skip to content
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

cross compile sdk with arm64 toolchain about cmTC_faac0 error #288

Closed
dukezuoHZ opened this issue Jun 22, 2021 · 12 comments
Closed

cross compile sdk with arm64 toolchain about cmTC_faac0 error #288

dukezuoHZ opened this issue Jun 22, 2021 · 12 comments
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue

Comments

@dukezuoHZ
Copy link

I have add some define in cmakelist for tool chain of arm64 ,when i run cmake,show error as below:

-- The C compiler identification is GNU 7.3.0
-- Check for working C compiler: /opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc
-- Check for working C compiler: /opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc -- broken
CMake Error at /opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler

"/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /mnt/hgfs/eyecloud/scouter/Luna-Gen1-IoT-Device/src/aws-iot-device-sdk-cpp-v2/build/crt/aws-crt-cpp/aws-lc/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_faac0/fast"
/usr/bin/make -f CMakeFiles/cmTC_faac0.dir/build.make CMakeFiles/cmTC_faac0.dir/build
make[1]: Entering directory '/mnt/hgfs/eyecloud/scouter/Luna-Gen1-IoT-Device/src/aws-iot-device-sdk-cpp-v2/build/crt/aws-crt-cpp/aws-lc/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_faac0.dir/testCCompiler.c.o
/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc   -O2 -pipe -g -feliminate-unused-debug-types   -fPIE   -o CMakeFiles/cmTC_faac0.dir/testCCompiler.c.o   -c /mnt/hgfs/eyecloud/scouter/Luna-Gen1-IoT-Device/src/aws-iot-device-sdk-cpp-v2/build/crt/aws-crt-cpp/aws-lc/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_faac0
/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_faac0.dir/link.txt --verbose=1
/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc  -O2 -pipe -g -feliminate-unused-debug-types    -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed  -rdynamic CMakeFiles/cmTC_faac0.dir/testCCompiler.c.o  -o cmTC_faac0 
/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/real-ld: cannot find crt1.o: No such file or directory
/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/real-ld: cannot find crti.o: No such file or directory
/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/real-ld: cannot find crtbegin.o: No such file or directory
/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/real-ld: cannot find -lgcc
/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/real-ld: cannot find -lgcc_s
/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/real-ld: cannot find -lc
/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/real-ld: cannot find -lgcc
/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/real-ld: cannot find -lgcc_s
/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/real-ld: cannot find crtend.o: No such file or directory
/opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/7.3.0/real-ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_faac0.dir/build.make:97: recipe for target 'cmTC_faac0' failed
make[1]: *** [cmTC_faac0] Error 1
make[1]: Leaving directory '/mnt/hgfs/eyecloud/scouter/Luna-Gen1-IoT-Device/src/aws-iot-device-sdk-cpp-v2/build/crt/aws-crt-cpp/aws-lc/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_faac0/fast' failed
make: *** [cmTC_faac0/fast] Error 2
@dukezuoHZ dukezuoHZ added guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged. labels Jun 22, 2021
@rpcme
Copy link
Contributor

rpcme commented Jun 22, 2021

hello @anglely168 we do cover this sdk for Yocto Project in the meta-aws project https://github.com/aws/meta-aws. However, it doesn't look like we have put it back to sumo likely due to the YP sumo release being maintained.

Do you think it would help if we tried to back port it to sumo?

@jmklix jmklix added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. and removed needs-triage This issue or PR still needs to be triaged. labels Jun 22, 2021
@dukezuoHZ
Copy link
Author

hello @anglely168 we do cover this sdk for Yocto Project in the meta-aws project https://github.com/aws/meta-aws. However, it doesn't look like we have put it back to sumo likely due to the YP sumo release being maintained.

Do you think it would help if we tried to back port it to sumo?

Thinks rpcme,I rebuild the sdk and example in another arm64 platform native,and run the example basic-pub-sub ok,but when i go back imx8mm platform, it output :
Connecting...
Connection failed with error aws-c-io: AWS_IO_TLS_ERROR_NEGOTIATION_FAILURE, TLS (SSL) negotiation failed
。。。。。。
I am confused.I used the same bin file,why show different result?

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. label Jun 23, 2021
@JonathanHenson
Copy link
Contributor

My educated guess is the trust store wasn’t found on that distro. If you know the location of the ca location, we can make sure it loads for you in a future release. In the meantime, you can test this theory by overriding the CA with the AmazonRootCA1.PEM directly.

@dukezuoHZ
Copy link
Author

My educated guess is the trust store wasn’t found on that distro. If you know the location of the ca location, we can make sure it loads for you in a future release. In the meantime, you can test this theory by overriding the CA with the AmazonRootCA1.PEM directly.

I used the same certs on arm64 platform,but i get different output,I double libssl is different,but I used ldd comand to check to relaition lib,no find this lib and i change the name of libssl.so to a bak name,the a bin file can run too,so it seemed no relation to libss.

@dukezuoHZ
Copy link
Author

I have resolved this issue,because the new board of imx8mm have no rtc,so i it handshake with aws lot server error,I have set date time manually and it works. thanks all!

@rpcme
Copy link
Contributor

rpcme commented Jun 23, 2021

@anglely168 yes on these types of systems, to be effective, we need to have ntpd on the system, For example, in the greengrass recipe ntpd is a hard prerequisite. I'm glad you got it figured out. If you need support on sumo please let us know over at the meta-aws project repo ok?

@dukezuoHZ
Copy link
Author

thanks rpcme.I have compiled directly another arm64 device which have install gcc and can been run on imx8mm,I think you'd better write a instruction for someone who used others arm platform with hisself toolchian.I did't find doc about how to crosscompiler the sdk in the internet.some arm platform did't used Yocto Project.

@rpcme
Copy link
Contributor

rpcme commented Jun 23, 2021

Hi @anglely168 I agree there should be documentation. I assumed you were using YP since you were using the Poky SDK toolchain.

@justinboswell who do you think is the right person to write this up? I can do it based on my experience in meta-aws (in which case you can assign this issue to me) or other?

@justinboswell
Copy link
Contributor

@justinboswell who do you think is the right person to write this up? I can do it based on my experience in meta-aws (in which case you can assign this issue to me) or other?

Yeah, @rpcme I think your experience will be most helpful in framing what we need. I'm happy to review and contribute on top of what you have.

@jmklix jmklix added bug This issue is a bug. and removed guidance Question that needs advice or information. labels Aug 9, 2021
@aws aws deleted a comment Feb 14, 2022
@Hadatko
Copy link

Hadatko commented Sep 15, 2022

I have similar issue with building on Linux laptop. See comment under main post here : aws/s2n-tls#3495

@jmklix jmklix added the p2 This is a standard priority issue label Nov 9, 2022
@jmklix
Copy link
Member

jmklix commented Aug 30, 2023

Please check out the meta-aws for more documentation/questions relating to this specific use case

@jmklix jmklix closed this as completed Aug 30, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

6 participants