-
Notifications
You must be signed in to change notification settings - Fork 612
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
Makefile: introduce ARCHCFLAGS for arch specific cflags #2288
Makefile: introduce ARCHCFLAGS for arch specific cflags #2288
Conversation
Thanks for the PR. I am not sure why the user should overwrite USERCFLAGS. I probably just don't get it totally. Is it somewhere documented that USERCFLAGS can be set or is it custom that a variable with this name is used for that? I would expect, as a user, to be able to specify cflags via CFLAGS. Just looking for some additional clarification. |
The USERCFLAGS is, what I can tell, not documented. Based on its name, I assume the purpose is to let the user add additional flags to the compiler. ifeq ($(origin HOSTCFLAGS), undefined) I'm completely okay with that, but reusing the variable and setting it in the Makefile does not work. Similiar problems would be if the user sets CFLAGS on command line. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## criu-dev #2288 +/- ##
============================================
- Coverage 70.64% 70.55% -0.10%
============================================
Files 133 132 -1
Lines 33318 33515 +197
============================================
+ Hits 23539 23647 +108
- Misses 9779 9868 +89
☔ View full report in Codecov by Sentry. |
For the Fedora package we do: https://src.fedoraproject.org/rpms/criu/blob/rawhide/f/criu.spec#_115 Would that work for you? Just had a closer look at
It doesn't seem to be ever overwritten. Just extended by Again, just trying to understand what is correct here. Calling it |
Hum hum, making it part of the environment would work, IOW: USERCFLAGS=foo make make USERFLAGS=foo Maybe this is no problem then :-) I would still prefer to not reuse USERCFLAGS for other than user-provided flags though. So maybe just change the commit message? |
It makes sense to me to separate architecture specific flags from USERCFLAGS
Yes :) |
3963c23
to
576119b
Compare
Do not use $(USERCFLAGS) for anything other than what the user provide. Signed-off-by: Marcus Folkesson <[email protected]>
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.
Looks like a useful change.
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
Do not use $(USERCFLAGS) for anything other than what the user provide.
If $(USERCFLAGS) is provided by the user, then the make command will be unable to add machine specific options (used for ARM) resulting in build failures.
Instead, introduce $(ARCHCFLAGS) for such flags.