-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Experimental: Cross-compiling with ARM cross-compiler #188
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution 🎉
Let me know when this is ready
* remove pico
I added more (vcpkg) triplets:
I tried to focus on the "common" arm cross-compilers:
(User still need to setup compiler, triplet and toolchain-file on its own) -DENABLE_CROSS_COMPILING:BOOL=ON -DCMAKE_C_COMPILER=gcc-aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=gcc-aarch64-linux-gnu-g++ -DDEFAULT_TRIPLET=arm64-linux |
I also "accidentally" added if(ENABLE_CROSS_COMPILING)
set(CLANG_TIDY_EXTRA_ARGUMENTS --extra-arg=--target=${CROSS_TRIPLET})
endif()
project_options(
ENABLE_CLANG_TIDY
CLANG_TIDY_EXTRA_ARGUMENTS
${CLANG_TIDY_EXTRA_ARGUMENTS}
...) |
We still have the problem with (arm) cross-compiler + clang-tidy ... don't know if this needs to be fixed IMHO I don't really need that feature for cross-compiling, I compiler and unit-tests on my Desktop + IDE + analyzer ON, etc. ... and later deploy as Releasse-Build on the target device. (and do integration tests..) |
This is also tested und can be marked as DONE by running |
First of all, thanks for looking into arm cross-compilation
I don't entirely agree with that argument. While the vast majority of the code will/should be covered by unittests, there will always be low level stuff that won't (such as startup code, memory mapped objects for peripherals, ...). It would be nice to have static analysis cover them, since they are also the parts that are in my opinion most susceptible to accidental undefined behaviour. |
* add git submodule
While the docker builds seems to work, the CI are not :( ... |
@aminya I updated to the new setup-cpp version 👍 npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/ci-log - Not found
npm ERR! 404
npm ERR! 404 'ci-log@1.0.0' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2023-01-18T09_11_37_711Z-debug-0.log https://www.npmjs.com/package/ci-log ... "package 'ci-log' not found" |
Oops. I am fixing it in aminya/setup-cpp#160 |
Released a new version. The issue should be fixed now. |
* use awalsh128/cache-apt-pkgs-action
If you want, you can experiment with this branch and try to add this into your project und give us some feedback ... Better yet ... make an issue with the some details you already writen down in the other issue
(this seems to be an issue on it's own ... I may want to test this issue with the mingw cross-compiler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 🎉
enable_cross_compiler()
for arm tripletsI try to experiment with arm cross-compiler and try to figure out what's wrong clang-tidy, cppcheck, etc.
Seems like when I'm building without the static analysis tools, it works.
task docker:rpi3.release
Without static analysis tools
task docker:rpi4.test
Without static analysis tools
task docker:rpi4
With static analysis tools enabled
Seems like the same issue #180 (comment)
task docker:rpi3
Seems like clang-tidy doesn't know it is built with a cross-compiler ? ... (and uses the native clang++ targets.)
@glennvl Maybe we need to add
--target
for clang-tidyMaybe this helps...
https://stackoverflow.com/questions/54539682/how-to-set-up-cmake-to-cross-compile-with-clang-for-arm-embedded-on-windows
task docker:pico
I add this just for fun, may remove it later