misc/173030: [patch] emulators/open-vm-tools: fix clang compile problem with -Wformat-security when built from PORTS_MODULES
Garrett Cooper
yanegomi at gmail.com
Wed Oct 24 16:50:02 UTC 2012
>Number: 173030
>Category: misc
>Synopsis: [patch] emulators/open-vm-tools: fix clang compile problem with -Wformat-security when built from PORTS_MODULES
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Oct 24 16:50:01 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Garrett Cooper
>Release: 10-CURRENT
>Organization:
EMC Isilon
>Environment:
FreeBSD fallout-atf-current.local 10.0-CURRENT FreeBSD 10.0-CURRENT #3: Mon Oct 22 10:30:54 PDT 2012 root at fallout-atf-current.local:/usr/obj/usr/src/sys/GENERIC i386
>Description:
emulators/open-vm-tools fails to compile with -Wformat-security / clang; this is part of the default CFLAGS that gets passed along via buildkernel when building PORTS_MODULES.
This thread has a bit more discussion and a patch for the issue: https://sourceforge.net/tracker/?func=detail&aid=3579794&group_id=204462&atid=989708
>How-To-Repeat:
1. Install FreeBSD CURRENT on a VM.
2. Apply the following patch to so building with bmake and the PORTS_MODULES works (this is just a stopgap patch I'm using in my workspace to dogfood bmake):
Index: /store/freebsd/atf-head/usr.bin/Makefile
===================================================================
--- /store/freebsd/atf-head/usr.bin/Makefile (revision 241967)
+++ /store/freebsd/atf-head/usr.bin/Makefile (working copy)
@@ -280,10 +280,9 @@
.if ${MK_MAKE} != "no"
.if ${MK_BMAKE} != "no"
SUBDIR+= bmake
-.else
+.endif
SUBDIR+= make
.endif
-.endif
.if ${MK_MAN_UTILS} != "no"
SUBDIR+= catman
Index: /store/freebsd/atf-head/usr.bin/make/Makefile
===================================================================
--- /store/freebsd/atf-head/usr.bin/make/Makefile (revision 241967)
+++ /store/freebsd/atf-head/usr.bin/make/Makefile (working copy)
@@ -4,7 +4,15 @@
.include <bsd.own.mk>
+.if ${MK_BMAKE} == "no"
PROG= make
+LINKS+= make pmake
+.else
+pmake.1: make.1
+ cp ${.ALLSRC} ${.TARGET}
+MAN= pmake.1
+PROG= pmake
+.endif
CFLAGS+=-I${.CURDIR}
SRCS= arch.c buf.c cond.c dir.c for.c hash.c hash_tables.c job.c \
lst.c main.c make.c parse.c proc.c shell.c str.c suff.c targ.c \
Index: /store/freebsd/atf-head/sys/conf/kern.post.mk
===================================================================
--- /store/freebsd/atf-head/sys/conf/kern.post.mk (revision 241967)
+++ /store/freebsd/atf-head/sys/conf/kern.post.mk (working copy)
@@ -59,14 +59,22 @@
PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \
SRC_BASE=${SRC_BASE} \
OSVERSION=${OSRELDATE} \
- WRKDIRPREFIX=${WRKDIRPREFIX}
+ WRKDIRPREFIX=${WRKDIRPREFIX} \
+ INSTALL=install
+.if defined(.PARSEFILE)
+# Remove bmake-only supported MAKEFLAGS
+PORTSMAKEFLAGS:= ${MAKEFLAGS:tW:S/-N //:C/ -[JT] [^ ]+ / /g}
+PORTSMODULESENV+= MAKEFLAGS="${PORTSMAKEFLAGS}"
+PMAKE= pmake
+.endif
+
# The WRKDIR needs to be cleaned before building, and trying to change the target
# with a :C pattern below results in install -> instclean
all:
.for __i in ${PORTS_MODULES}
@${ECHO} "===> Ports module ${__i} (all)"
- cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B clean all
+ cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${PMAKE} -B clean all
.endfor
.for __target in install reinstall clean
@@ -74,7 +82,7 @@
ports-${__target}:
.for __i in ${PORTS_MODULES}
@${ECHO} "===> Ports module ${__i} (${__target})"
- cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B ${__target:C/install/deinstall reinstall/:C/reinstall/deinstall reinstall/}
+ cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${PMAKE} -B ${__target:C/install/deinstall reinstall/:C/reinstall/deinstall reinstall/}
.endfor
.endfor
.endif
2. cd /usr/src && make buildworld -DWITH_BMAKE && buildkernel PORTS_MODULES=emulators/open-vm-tools CC=clang CXX=clang++ CPP=clang-cpp
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list