-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
NuttX upgrade default compiler to GCC 7 #8551
Conversation
TODO before merge
|
@dagar |
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.
LGTM except the implicit-fallthrough warning that I would rather keep.
For what it's worth, I have been flying on pixhawk and pixfalcon flashed with firmwares compiled using gcc 7.1.0 to 7.2.0 without trouble.
@@ -332,6 +332,8 @@ function(px4_add_common_flags) | |||
-Wunknown-pragmas | |||
-Wunused-variable | |||
|
|||
-Wno-implicit-fallthrough # set appropriate level and update | |||
|
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.
I actually like this warning. Better be explicit when fallthrough is intended, like here:
https://github.com/PX4/Firmware/blob/bcceadcb85b293046166ed7898c96b7dbf9acd30/src/drivers/mpu9250/mpu9250_spi.cpp#L168-L184
@jlecoeur yes, I like the warning as well, but I was having issues with setting the appropriate level (one of the reasons I tagged you). By default it was failing on some of the switch statements you already changed. |
@dagar We can always fix the warnings. However I do not feel confident asking people to install a compiler that does not have a consistent behaviour on different systems (see below). Did you try it on an ubuntu PC or Mac?
|
The containers are using GCC directly from Arm. https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads I wish there were actual packages, but overall this seemed more sustainable allowing us to point all users on all platforms at the exact same version. We can still try to keep a wide range of versions working as needed, but I don't think the project can realistically support more than one official version. |
The compiler version has proven essential to flight safety in the past, so in stark contrast to non-critical software we really can only support one single version officially. We put a lot of effort in testing and all bets are off if people switch the compiler. |
Sorry I was not clear. That compiler version is fine and I agree a single version can be supported. That is just strange that the same code, with the same compiler, compiled on my machine but not in a docker container. What about using docker for all builds? The only PX4 dependency would be docker. |
That's almost the case now. All the "production" builds are built with docker now. Docker can also be our fall back to point people at for building locally, but I think most still prefer native (not quite the right term but you know what I mean) toolchains. The docker environment follows the ubuntu environment instructions. |
... and
|
@dagar I could re-enable the warning and build successfully by basing px4io/px4-dev-nuttx on px4io/px4-dev-base:2017-12-08. |
Re-enable the warning in which build? |
@dagar px4fmu-v2_default |
Rebased on master. |
@dagar Can we get the binary files (.px4) from Jenkins or QGC? or do we need to install GCC7 and compile locally? |
For all PRs and branches you can now get the binaries from Jenkins under artifacts. If that's not the case somewhere please let me know. |
few flights on a quad running Pixracer (V4) full test flight: all tested modes work as expected; no issues |
flight with pixhawk pro (V4pro) Good flight, no issues. flight with pixhawk 1 (V2) Good flight, no issues. |
One trivial compile error on px4-same70xplained-v1. I'll push a fix to ignore the warning for now and we can fix it properly in NuttX. This doesn't invalidate any of the testing results. @davids5 FYI |
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.
Flight testing with no issues, vehicles flew as expected.
Circleci failure unrelated. #8689 |
This is a temporary workaround for equal expressions in chip/sam_xdmac.c and can be reverted once fixed properly in NuttX. Needed for the GCC 7 upgrade in #8551.
Rebased on master to address circleci failure. |
@hamishwillee please ping me when you're available and we'll do a pass to make sure everything is aligned with the single supported GCC version. We can add a note about other versions, but really emphasize the point about this specific version of GCC 7. |
Update NuttX GNU Arm Embedded Toolchain to the latest stable version.
GNU Arm Embedded Toolchain: 7-2017-q4-major December 18, 2017
https://github.com/PX4/containers/blob/5c29816a92b5dad22333a41860ec0a0d0f608567/docker/px4-dev/Dockerfile_nuttx#L27-L30