Skip to content
Browse files Prevent "profiling impossible" warning

The flag combination of "-pg" and "-ffunction-sections" do not mix.
GCC will emit the warning: "-ffunction-sections disabled; it makes
profiling impossible"

This simple modification to will filter out
-ffunction-sections flag whenever it tries to build profile
objects.  The seemingly hundreds of warning in the world build
log are now gone.
  • Loading branch information...
1 parent ee1e51e commit 2ec8bbd1f0e7c4305e1d93e07156c26a7bf20989 @jrmarino jrmarino committed Sep 29, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 share/mk/
10 share/mk/
@@ -47,12 +47,14 @@ PICFLAG=-fpic
${CC} ${_${.IMPSRC:T}_FLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
- ${CC} ${_${.IMPSRC:T}_FLAGS} ${PO_FLAG} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
+ ${CC} ${_${.IMPSRC:T}_FLAGS} ${PO_FLAG} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@@ -61,7 +63,7 @@ PO_FLAG=-pg
.cc.po .C.po .cpp.po .cxx.po:
- ${CXX} ${_${.IMPSRC:T}_FLAGS} ${PO_FLAG} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
.cc.So .C.So .cpp.So .cxx.So:
@@ -70,7 +72,7 @@ PO_FLAG=-pg
${FC} ${_${.IMPSRC:T}_FLAGS} ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
- ${FC} ${_${.IMPSRC:T}_FLAGS} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
+ ${FC} ${_${.IMPSRC:T}_FLAGS} ${PO_FLAG} ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
@@ -79,7 +81,7 @@ PO_FLAG=-pg
- ${OBJC} ${_${.IMPSRC:T}_FLAGS} ${OBJCFLAGS} -pg -c ${.IMPSRC} -o ${.TARGET}

0 comments on commit 2ec8bbd

Please sign in to comment.
Something went wrong with that request. Please try again.