[Bug 233542] devel/kBuild improperly selects gcc version
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Wed Nov 28 05:02:37 UTC 2018
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233542
--- Comment #4 from rkoberman at gmail.com ---
(In reply to Jung-uk Kim from comment #3)
I won't argue, but the comments in Mk/bsd.gcc.mk would seem to. They also argue
that Mk/bsd.gcc.mk has a problem.
# To request the use of a current version of GCC, specify USE_GCC=yes in
# your port/system configuration. This is the preferred use of USE_GCC.
# It uses the canonical version of GCC defined in bsd.default-versions.mk.
#
# USE_GCC=any is similar, except that it also accepts the old GCC 4.2-
# based system compiler in older versions of FreeBSD.
#
# If your port needs a specific (minimum) version of GCC, you can easily
# specify that with a USE_GCC= statement. Unless absolutely necessary
# do so by specifying USE_GCC=X+ which requests at least GCC version X.
# To request a specific version omit the trailing + sign.
#
# Examples:
# USE_GCC= yes # port requires a current version of
GCC
# # as defined in
bsd.default-versions.mk.
# USE_GCC= any # port requires GCC 4.2 or later.
The use of "any" is to allow the use of gcc4.2, which is likely to cause issues
considering its age and lack of recent support. Further, the coe in the .mk
file seesm to likely not o what might be expected nor what the comments state,
though I find the comment "Default to the last GCC imported into base" to be
very unclear. In any case, it should not choose gcc7 on n 11.2 system.
The .mk code for "any" looks a bit odd to me. It does not appear to do what the
comments say, but I am far from an expert if make(1).
.if defined(USE_GCC) && !defined(FORCE_BASE_CC_FOR_TESTING)
. if ${USE_GCC} == any
# Enable the clang-is-cc workaround. Default to the last GCC imported
# into base.
_USE_GCC:= 4.2
_GCC_ORLATER:= true
. else # ${USE_GCC} == any
# See if we can use a later version or exclusively the one specified.
_USE_GCC:= ${USE_GCC:S/+//}
.if ${USE_GCC} != ${_USE_GCC}
_GCC_ORLATER:= true
.endif
. endif # ${USE_GCC} == any
.mk code for "any"is a bit odd to me.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-emulation
mailing list