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

processor does not support `ldrexh r2,[r1]' and other operations in ARM mode #366

Open
ebo opened this issue Jan 16, 2022 · 4 comments
Open

Comments

@ebo
Copy link

ebo commented Jan 16, 2022

With a clean Bullseye build on a RPi-3B I get dozens of errors while running "cmake --build ./build" which produce errors which are variations on the following:

/tmp/ccur4T6u.s:1341: Error: selected processor does not support `ldrexh r2,[r1]' in ARM mode machinekit-hal

Does machinekit-hal require running on an RPi-4 as well as requiring Bullseye? I could never get it to build cleanly under Buster.

@ebo
Copy link
Author

ebo commented Jan 16, 2022

It is not working on a clean Bullseye RPi-4 either. Here is the full error list:

[ 14%] Building C object src/libraries/runtime/CMakeFiles/runtime_module.dir/src/rtapi.c.o
/tmp/ccCvFFzL.s: Assembler messages:
/tmp/ccCvFFzL.s:1341: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:1341: Error: selected processor does not support strexheq r3,r0,[r1]' in ARM mode
/tmp/ccCvFFzL.s:1390: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:1390: Error: selected processor does not support strexheq r3,r0,[r1]' in ARM mode
/tmp/ccCvFFzL.s:1437: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:1437: Error: selected processor does not support strexbeq r3,r0,[r1]' in ARM mode
/tmp/ccCvFFzL.s:1486: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:1486: Error: selected processor does not support strexbeq r3,r0,[r1]' in ARM mode
/tmp/ccCvFFzL.s:1533: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:1533: Error: selected processor does not support strexheq r3,r0,[r1]' in ARM mode
/tmp/ccCvFFzL.s:1582: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:1582: Error: selected processor does not support strexheq r3,r0,[r1]' in ARM mode
/tmp/ccCvFFzL.s:1629: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:1629: Error: selected processor does not support strexbeq r3,r0,[r1]' in ARM mode
/tmp/ccCvFFzL.s:1678: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:1678: Error: selected processor does not support strexbeq r3,r0,[r1]' in ARM mode
/tmp/ccCvFFzL.s:1869: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:1869: Error: selected processor does not support strexh r3,r0,[r1]' in ARM mode
/tmp/ccCvFFzL.s:1907: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:1907: Error: selected processor does not support strexb r3,r0,[r1]' in ARM mode
/tmp/ccCvFFzL.s:1945: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:1945: Error: selected processor does not support strexh r3,r0,[r1]' in ARM mode
/tmp/ccCvFFzL.s:1983: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:1983: Error: selected processor does not support strexb r3,r0,[r1]' in ARM mode
/tmp/ccCvFFzL.s:2562: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:2562: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:2596: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:2596: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:2630: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:2630: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:2664: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:2664: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:2698: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:2698: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:2732: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:2732: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:2766: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:2766: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:2800: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:2800: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:2834: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:2834: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:2868: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:2868: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:2902: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:2902: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:2936: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:2936: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:2970: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:2970: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:3004: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:3004: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:3038: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:3038: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:3072: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:3072: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:3829: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:3829: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:3866: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:3866: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:3903: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:3903: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:3940: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:3940: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:3977: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:3977: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4014: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:4014: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4051: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:4051: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4088: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:4088: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4125: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:4125: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4162: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:4162: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4199: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:4199: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4236: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:4236: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4273: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:4273: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4310: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:4310: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4347: Error: selected processor does not support ldrexh r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:4347: Error: selected processor does not support strexh r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4384: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:4384: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4421: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:4421: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4458: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:4458: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4495: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:4495: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4532: Error: selected processor does not support ldrexb r2,[r1]' in ARM mode /tmp/ccCvFFzL.s:4532: Error: selected processor does not support strexb r3,r2,[r1]' in ARM mode
/tmp/ccCvFFzL.s:4727: Error: selected processor does not support ldrexh r1,[r0]' in ARM mode /tmp/ccCvFFzL.s:4727: Error: selected processor does not support strexh r3,r2,[r0]' in ARM mode
/tmp/ccCvFFzL.s:4769: Error: selected processor does not support ldrexb r1,[r0]' in ARM mode /tmp/ccCvFFzL.s:4769: Error: selected processor does not support strexb r3,r2,[r0]' in ARM mode
/tmp/ccCvFFzL.s:4811: Error: selected processor does not support ldrexh r1,[r0]' in ARM mode /tmp/ccCvFFzL.s:4811: Error: selected processor does not support strexh r3,r2,[r0]' in ARM mode
/tmp/ccCvFFzL.s:4853: Error: selected processor does not support ldrexb r1,[r0]' in ARM mode /tmp/ccCvFFzL.s:4853: Error: selected processor does not support strexb r3,r2,[r0]' in ARM mode
gmake[2]: *** [src/libraries/runtime/CMakeFiles/runtime_module.dir/build.make:76: src/libraries/runtime/CMakeFiles/runtime_module.dir/src/rtapi.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:9729: src/libraries/runtime/CMakeFiles/runtime_module.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2

@ebo
Copy link
Author

ebo commented Jan 16, 2022

I've even tried to downgrade GCC to 9.3 and rebuild. I still get the same errors.

The only clue I have about how to fix this error is adding '-march=armv7-a' to CFLAGS as seen here: http://lkml.iu.edu/hypermail/linux/kernel/1409.3/02963.html

Looking at CMakeLists.txt, there does not appear to be a line to set CMAKE_C_FLAGS, but there is for DEBUG, RELEASE, and RELWITHDEBINFO.

@ebo
Copy link
Author

ebo commented Jan 16, 2022

Adding CMAKE_C_FLAGS and CMAKE_CXX_FLAGS to CMakeLists.txt:

set(CMAKE_C_FLAGS "-g -O0 -march=armv7-a" )
set(CMAKE_CXX_FLAGS "-g -O0 -march=armv7-a")

as well as adding '-march=armv7-a' to all the other FLAGS definitions:

set(CMAKE_C_FLAGS_DEBUG "-g -O0 -march=armv7-a" )
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -march=armv7-a")
set(CMAKE_C_FLAGS_RELEASE "-O0 -march=armv7-a")
set(CMAKE_CXX_FLAGS_RELEASE "-O0 -march=armv7-a")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O0 -march=armv7-a")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O0 -march=armv7-a")

got this build through. Once this is added to CMakeLists.txt, this bug will probably be solved.

@ebo
Copy link
Author

ebo commented Jan 17, 2022

ok. Last night I forked machinekit-hal in prep to make the changes and submit a PR. Starting from a clean Bullseye build I find that I do need the '-march=armv7-a' to build on an RPi-4 with the current cmake configuration. To get it to work for myself I simply added it in where the FLAGS were set, but this is not the proper way to support other architectures. I may need som help getting this worked in as it has been years since I have written cmake files.

Also, to check if the current build system requires anything from cmake-3.22+, I temporarily lowered that to 3.18 (the current stable release distributed by everyone). It in fact does seem to require 3.22. I'll check again to make sure oce I get everything built through.

BTW, part of my PR will be build documentation updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant