Bug 205905

Summary: devel/binutils: Makefile has wrong COMPILER_VERSION check
Product: Ports & Packages Reporter: Mark Millard <marklmi26-fbsd>
Component: Individual Port(s)Assignee: Baptiste Daroussin <bapt>
Status: Closed Not A Bug    
Severity: Affects Only Me Keywords: needs-patch, needs-qa
Priority: --- Flags: bugzilla: maintainer-feedback? (bapt)
Version: Latest   
Hardware: Any   
OS: Any   

Description Mark Millard 2016-01-04 22:15:45 UTC
Line 58 of (/usr/ports -r404557) /user/ports/devel/binutils/Makefile is:

.if ${ARCH} != ia64 && ${ARCH} != mips && ${ARCH} != mips64 && !defined(PKGNAMEPREFIX) && (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 34 || ${COMPILER_TYPE} == gcc)

Comparing that to /usr/src/share/mk/bsd.compiler.mk notation:

.if ${COMPILER_TYPE} == "clang" || \
        (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40800)

/user/ports/devel/binutils/Makefile has the wrong scale of numbers for the version check.

(It also does not use the quotes syntax for the string literals in the string comparisons if that ever matters.)

/usr/src/share/mk/bsd.compiler.mk has:

_v!=    ${CC} --version || echo 0.0.0
. . .
.if !defined(COMPILER_VERSION)
COMPILER_VERSION!=echo ${_v:M[1-9].[0-9]*} | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}'
.endif

confirming the larger numbers as the normal encoding in COMPILER_VERSION as produced by bsd.compiler.mk .
Comment 1 Mark Millard 2016-01-09 06:08:03 UTC
Turns out that both:

/usr/src/share/mk/bsd.compiler.mk

and

/usr/ports/Mk/Uses/compiler.mk

define COMPILER_VERSION (same name) but with differing standards for the values assigned.

My submittal was based on looking at the wrong definition as far as ports go.