PERFORCE change 95410 for review
John Birrell
jb at FreeBSD.org
Mon Apr 17 04:33:33 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=95410
Change 95410 by jb at jb_freebsd2 on 2006/04/17 04:33:11
Add a bucket load of ctfconvert statements to the default rules
so that whenever an object is built, it will have it's DWARF
debug info converted to CTF. If DEBUG_FLAGS were set, then the CTF
info is added rather than replacing the DWARF stuff.
Note: This only applies to the default rules. There are lots and
lots of places in the Makefiles where custom compilation takes
place. All these need the ctfconvert statements added. That is
work for much later. For now, what we've got is something that we
can work with for proof of concept. It's not expected to be
thorough yet. That's why I made the ctfconvert and ctfmerge tools
not fail if the CTF info isn't present.
We've got work to do to all the assembler code to get DWARF
data generated. At the moment, every assembler file compiled to
an object contains none of the required info for CTF. That's work
for later too.
Affected files ...
.. //depot/projects/dtrace/src/share/mk/sys.mk#2 edit
Differences ...
==== //depot/projects/dtrace/src/share/mk/sys.mk#2 (text+ko) ====
@@ -118,9 +118,15 @@
# SINGLE SUFFIX RULES
.c:
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC}
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
.f:
${FC} ${FFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC}
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
.sh:
cp ${.IMPSRC} ${.TARGET}
@@ -130,21 +136,33 @@
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
.f.o:
${FC} ${FFLAGS} -c ${.IMPSRC}
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
.y.o:
${YACC} ${YFLAGS} ${.IMPSRC}
${CC} ${CFLAGS} -c y.tab.c
rm -f y.tab.c
mv y.tab.o ${.TARGET}
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
.l.o:
${LEX} ${LFLAGS} ${.IMPSRC}
${CC} ${CFLAGS} -c lex.yy.c
rm -f lex.yy.c
mv lex.yy.o ${.TARGET}
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
.y.c:
${YACC} ${YFLAGS} ${.IMPSRC}
@@ -182,21 +200,39 @@
.c:
${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
.cc .cpp .cxx .C:
${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
.cc.o .cpp.o .cxx.o .C.o:
${CXX} ${CXXFLAGS} -c ${.IMPSRC}
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
.m.o:
${OBJC} ${OBJCFLAGS} -c ${.IMPSRC}
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
.p.o:
${PC} ${PFLAGS} -c ${.IMPSRC}
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
.e .r .F .f:
${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} \
@@ -207,23 +243,38 @@
.S.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
.asm.o:
${CC} -x assembler-with-cpp ${CFLAGS} -c ${.IMPSRC}
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
.s.o:
${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
# XXX not -j safe
.y.o:
${YACC} ${YFLAGS} ${.IMPSRC}
${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET}
rm -f y.tab.c
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
.l.o:
${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c
${CC} ${CFLAGS} -c ${.PREFIX}.tmp.c -o ${.TARGET}
rm -f ${.PREFIX}.tmp.c
+.if defined(CTFCONVERT)
+ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
# XXX not -j safe
.y.c:
@@ -269,3 +320,4 @@
.include <bsd.compat.mk>
.include <bsd.cpu.mk>
+.include <bsd.dtrace.mk>
More information about the p4-projects
mailing list