misc/172440: [patch] [build] fix broken CTFCONVERT_CMD call

Garrett Cooper yanegomi at gmail.com
Sun Oct 7 08:48:41 UTC 2012


    Correction -- bmake hates empty strings for commands too...

bmake: ${CTFCONVERT_CMD} expands to empty string
cc  -O2 -pipe -DMALLOC_PRODUCTION -march=prescott -I/usr/src/lib/libmd
-DSHA1_ASM -DRMD160_ASM -std=gnu99 -fstack-protector -Wno-pointer-sign
-c sha1hl.c -o sha1hl.o
bmake: ${CTFCONVERT_CMD} expands to empty string
cc  -O2 -pipe -DMALLOC_PRODUCTION -march=prescott -I/usr/src/lib/libmd
-DSHA1_ASM -DRMD160_ASM -std=gnu99 -fstack-protector -Wno-pointer-sign
-c /usr/src/lib/libmd/sha256c.c -o sha256c.o
bmake: ${CTFCONVERT_CMD} expands to empty string
cc  -O2 -pipe -DMALLOC_PRODUCTION -march=prescott -I/usr/src/lib/libmd
-DSHA1_ASM -DRMD160_ASM -std=gnu99 -fstack-protector -Wno-pointer-sign
-c sha256hl.c -o sha256hl.o
bmake: ${CTFCONVERT_CMD} expands to empty string
cc  -O2 -pipe -DMALLOC_PRODUCTION -march=prescott -I/usr/src/lib/libmd
-DSHA1_ASM -DRMD160_ASM -std=gnu99 -fstack-protector -Wno-pointer-sign
-c /usr/src/lib/libmd/sha512c.c -o sha512c.o
bmake: ${CTFCONVERT_CMD} expands to empty string
cc  -O2 -pipe -DMALLOC_PRODUCTION -march=prescott -I/usr/src/lib/libmd
-DSHA1_ASM -DRMD160_ASM -std=gnu99 -fstack-protector -Wno-pointer-sign
-c sha512hl.c -o sha512hl.o
bmake: ${CTFCONVERT_CMD} expands to empty string
cc -O2 -pipe -DMALLOC_PRODUCTION -march=prescott -I/usr/src/lib/libmd
-DSHA1_ASM -DRMD160_ASM -std=gnu99 -fstack-protector -Wno-pointer-sign
 -DELF -Wa,--noexecstack -c /usr/src/lib/libmd/i386/sha.S
bmake: ${CTFCONVERT_CMD} expands to empty string
cc -O2 -pipe -DMALLOC_PRODUCTION -march=prescott -I/usr/src/lib/libmd
-DSHA1_ASM -DRMD160_ASM -std=gnu99 -fstack-protector -Wno-pointer-sign
 -DELF -Wa,--noexecstack -c /usr/src/lib/libmd/i386/rmd160.S
bmake: ${CTFCONVERT_CMD} expands to empty string
building static md library
ranlib libmd.a
cc -pg  -O2 -pipe -DMALLOC_PRODUCTION -march=prescott
-I/usr/src/lib/libmd -DSHA1_ASM -DRMD160_ASM -std=gnu99
-fstack-protector -Wno-pointer-sign -c /usr/src/lib/libmd/md4c.c -o
md4c.po
bmake: ${CTFCONVERT_CMD} expands to empty string
cc -pg  -O2 -pipe -DMALLOC_PRODUCTION -march=prescott
-I/usr/src/lib/libmd -DSHA1_ASM -DRMD160_ASM -std=gnu99
-fstack-protector -Wno-pointer-sign -c /usr/src/lib/libmd/md5c.c -o
md5c.po
bmake: ${CTFCONVERT_CMD} expands to empty string

    The attached patch is correct per bmake today (if empty strings in
bmake should be supported, a similar shim will need to be added for it
as was added for pmake with r228157), and it seems to be accepted (or
at least not explicitly denied) per POSIX
(http://pubs.opengroup.org/onlinepubs/009695399/utilities/make.html):

The algorithm for determining a new entry for target rules is
partially unspecified. Some historical makes allow blank, empty, or
comment lines within the collection of commands marked by leading
<tab>s. A conforming makefile must ensure that each command starts
with a <tab>, but implementations are free to ignore blank, empty, and
comment lines without triggering the start of a new entry.s

    FWIW, the logic in this block was broken in r236338 by moving away
from 5${DATE} to a ${RELENG_MAJOR_VERSION}${DATE} format. It's
unfortunate that the new versioning scheme messed this up, but I
understand the logic behind the new format as a good chunk of features
committed to 10.x's version of pmake haven't been backported to
stable/9 or earlier as it would potentially break things and one would
need to do this in order to bootstrap make only when needed.
    I've CCed interested parties for the empty command enhancement in
bmake as bmake has upstream sources and as such we shouldn't be
changing things arbitrarily without talking with Simon first.
Thanks!
-Garrett
-------------- next part --------------
Index: share/mk/bsd.own.mk
===================================================================
--- share/mk/bsd.own.mk	(revision 241309)
+++ share/mk/bsd.own.mk	(working copy)
@@ -671,7 +672,8 @@
 
 .if ${MK_CTF} != "no"
 CTFCONVERT_CMD=	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.elif defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300
+.elif !defined(WITH_BMAKE) && \
+      (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 10201205300)
 CTFCONVERT_CMD=
 .else
 CTFCONVERT_CMD=	@:


More information about the freebsd-bugs mailing list