Bug 205905 - devel/binutils: Makefile has wrong COMPILER_VERSION check
Summary: devel/binutils: Makefile has wrong COMPILER_VERSION check
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Baptiste Daroussin
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2016-01-04 22:15 UTC by Mark Millard
Modified: 2016-01-09 06:08 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (bapt)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.