-
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/gnu.inc.mk: set flags based on compiler version #18935
Conversation
ca5269c
to
998c4e9
Compare
makefiles/toolchain/gnu.inc.mk
Outdated
GCC_VERSION := $(shell $(CC) -dumpversion) | ||
|
||
# -fmacro-prefix-map requires GCC 8 | ||
ifneq (8, $(firstword $(shell echo "8\n$(GCC_VERSION)" | sort -V)))) |
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 not portable, as replacing \n
with a newline character is not POSIX standard. Bash will do so, but not e.g. ash
. Also, -V
seems not to not work with all implementations of sort
.
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 hope it's portable now - is there an easy way to check this?
998c4e9
to
b30efee
Compare
Contribution description
-fmacro-prefix-map
was introduced in GCC 8, so only set it if the compiler version is 8 or newer.Testing procedure
Issues/PRs references
#18913 (comment)