-
Notifications
You must be signed in to change notification settings - Fork 2k
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
makefiles/cflags.inc.mk: handle optional cflags #12123
Conversation
Handle declaring OPTIONAL_CFLAGS and blacklisting them with OPTIONAL_CFLAGS_BLACKLIST. This should replace checking everytime if options are supported.
Blacklist incompatible CFLAGS that are currently "optionally" included in 'cflags.inc.mk'. This prepares for the migration to 'OPTIONAL_CFLAGS'.
Blacklist incompatible CFLAGS that are currently "optionally" included in 'cflags.inc.mk'. This prepares for the migration to 'OPTIONAL_CFLAGS'.
Update the optional flags to use 'OPTIONAL_CFLAGS' instead of evaluating everytime. They are now blacklisted by architecture/toolchain according to the current docker reference image.
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.
This is good! Maybe in the future we can add a static check to enforce that optional flags only contain "-W*", "-f*" and "-g*"
this broke support for GCC 5.4 which doesn't know about We currently update to Raspbian Buster which has GCC 7 (same version as riotdocker image) that should fix the issue. |
The riot docker image is considered the "minimum", that is, any system with older packages is not supported. If you encounter this issue again you could add some site-specific blacklisting via |
You can either export Also, note, only the Even the one from |
Oh, and thank you for the review by the way :D |
Contribution description
Handle declaring OPTIONAL_CFLAGS and blacklisting them with
OPTIONAL_CFLAGS_BLACKLIST.
This should replace checking everytime if options are supported.
The idea, is that these optional options are toolchain specific. So can be saved for the reference platform and allow users to still define other ones.
The BLACKLIST was defined in the docker image to match the previous in CFLAGS.
I did not add them to
docker
exported variables are they are supposed to be qualified in the docker image.Testing procedure
All examples must correctly compile in CI as it is the reference toolchain.
I compared the value of
CFLAGS
and got the same value.I did not re-do the handling for
CXXUWFLAGS += -fno-delete-null-pointer-checks
but if everything compiles correctly, in docker it should be ok.For testing I used this diff to compare the sorted value of
CFLAGS_WITH_MACROS
as it is the full value.buildtest print CFLAGS
And compared the value in
examples/hello-world
with bothTOOLCHAIN=gnu
andTOOLCHAIN=llvm
.The output was the same with this PR and in master.
Timing impact
The execution time was of course lower without re-checking the toolchain support, and even more with
llvm
.Issues/PRs references
This work is done in the context of removing immediate variable evaluations and exports
#10850