summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--UPDATING10
-rw-r--r--share/man/man7/build.711
-rw-r--r--share/mk/bsd.lib.mk53
-rw-r--r--share/mk/bsd.port.mk5
-rw-r--r--share/mk/bsd.prog.mk13
-rw-r--r--share/mk/sys.mk82
-rw-r--r--sys/conf/kern.mk8
-rw-r--r--sys/conf/kern.post.mk12
-rw-r--r--sys/conf/kern.pre.mk11
-rw-r--r--sys/conf/kmod.mk5
10 files changed, 92 insertions, 118 deletions
diff --git a/UPDATING b/UPDATING
index fd8a611..553e961 100644
--- a/UPDATING
+++ b/UPDATING
@@ -22,6 +22,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.x IS SLOW:
machines to maximize performance. (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
+20100402:
+ WITH_CTF can now be specified in src.conf (not recommended, there
+ are some problems with static executables), make.conf (would also
+ affect ports which do not use GNU make and do not override the
+ compile targets) or in the kernel config (via "makeoptions
+ WITH_CTF=yes").
+ When WITH_CTF was specified there before this was silently ignored,
+ so make sure that WITH_CTF is not used in places which could lead
+ to unwanted behavior.
+
20100311:
The kernel option COMPAT_IA32 has been replaced with COMPAT_FREEBSD32
to allow 32-bit compatibility on non-x86 platforms. All kernel
diff --git a/share/man/man7/build.7 b/share/man/man7/build.7
index 3015776..67a2445 100644
--- a/share/man/man7/build.7
+++ b/share/man/man7/build.7
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 31, 2010
+.Dd April 02, 2010
.Dt BUILD 7
.Os
.Sh NAME
@@ -341,6 +341,15 @@ or the command line.
.It Va NO_WERROR
If defined, compiler warnings will not cause the build to halt,
even if the makefile says otherwise.
+.It Va WITH_CTF
+If defined, the build process will run the DTrace CTF conversion
+tools on built objects.
+Please note that this WITH_ option is handled differently than all
+other WITH_ options (there is no
+.Va WITHOUT_CTF ,
+or corresponding
+.Va MK_CTF
+in the build system).
.El
.Pp
Additionally, builds in
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 470d9d4..67a09d7 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -33,6 +33,11 @@ CFLAGS+= -DNDEBUG
NO_WERROR=
.endif
+# Enable CTF conversion on request.
+.if defined(WITH_CTF)
+.undef NO_CTF
+.endif
+
.if defined(DEBUG_FLAGS)
CFLAGS+= ${DEBUG_FLAGS}
@@ -68,15 +73,11 @@ PO_FLAG=-pg
.c.po:
${CC} ${PO_FLAG} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.c.So:
${CC} ${PICFLAG} -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.cc.po .C.po .cpp.po .cxx.po:
${CXX} ${PO_FLAG} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@@ -86,58 +87,40 @@ PO_FLAG=-pg
.f.po:
${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.f.So:
${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.m.po:
${OBJC} ${OBJCFLAGS} -pg -c ${.IMPSRC} -o ${.TARGET}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.m.So:
${OBJC} ${PICFLAG} -DPIC ${OBJCFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.s.po .s.So:
${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.asm.po:
${CC} -x assembler-with-cpp -DPROF ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.asm.So:
${CC} -x assembler-with-cpp ${PICFLAG} -DPIC ${CFLAGS} \
-c ${.IMPSRC} -o ${.TARGET}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.S.po:
${CC} -DPROF ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.S.So:
${CC} ${PICFLAG} -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
all: objwarn
@@ -208,9 +191,7 @@ ${SHLIB_NAME}: ${SOBJS}
-o ${.TARGET} -Wl,-soname,${SONAME} \
`NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD}
.endif
-.if defined(CTFMERGE)
- ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS}
-.endif
+ @[ -z "${CTFMERGE}" -o -n "${NO_CTF}" ] || ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS}
.endif
.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no"
diff --git a/share/mk/bsd.port.mk b/share/mk/bsd.port.mk
index 99374a5..87e4935 100644
--- a/share/mk/bsd.port.mk
+++ b/share/mk/bsd.port.mk
@@ -7,5 +7,10 @@ BSDPORTMK?= ${PORTSDIR}/Mk/bsd.port.mk
# and setting MK_* variables when building ports.
_WITHOUT_SRCCONF=
+# Enable CTF conversion on request.
+.if defined(WITH_CTF)
+.undef NO_CTF
+.endif
+
.include <bsd.own.mk>
.include "${BSDPORTMK}"
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index 4de78cb..810a83b 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -15,6 +15,11 @@ CFLAGS+= -DNDEBUG
NO_WERROR=
.endif
+# Enable CTF conversion on request.
+.if defined(WITH_CTF)
+.undef NO_CTF
+.endif
+
.if defined(DEBUG_FLAGS)
CFLAGS+=${DEBUG_FLAGS}
CXXFLAGS+=${DEBUG_FLAGS}
@@ -61,9 +66,7 @@ ${PROG}: ${OBJS}
.else
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
.endif
-.if defined(CTFMERGE)
- ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}
-.endif
+ @[ -z "${CTFMERGE}" -o -n "${NO_CTF}" ] || ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}
.else # !defined(SRCS)
@@ -87,9 +90,7 @@ ${PROG}: ${OBJS}
.else
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
.endif
-.if defined(CTFMERGE)
- ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}
-.endif
+ @[ -z "${CTFMERGE}" -o -n "${NO_CTF}" ] || ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}
.endif
.endif
diff --git a/share/mk/sys.mk b/share/mk/sys.mk
index 51ec039..80ad3fa 100644
--- a/share/mk/sys.mk
+++ b/share/mk/sys.mk
@@ -55,14 +55,14 @@ NO_CTF = 1
# C Type Format data is required for DTrace
CTFFLAGS ?= -L VERSION
-.if !defined(NO_CTF)
CTFCONVERT ?= ctfconvert
CTFMERGE ?= ctfmerge
.if defined(CFLAGS) && (${CFLAGS:M-g} != "")
CTFFLAGS += -g
.else
-CFLAGS += -g
-.endif
+# XXX: What to do here? Is removing the CFLAGS part completely ok here?
+# For now comment it out to not compile with -g unconditionally.
+#CFLAGS += -g
.endif
CXX ?= c++
@@ -144,15 +144,11 @@ YFLAGS ?= -d
# SINGLE SUFFIX RULES
.c:
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.f:
${FC} ${FFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.sh:
cp ${.IMPSRC} ${.TARGET}
@@ -162,33 +158,25 @@ YFLAGS ?= -d
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.f.o:
${FC} ${FFLAGS} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.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
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.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
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.y.c:
${YACC} ${YFLAGS} ${.IMPSRC}
@@ -226,15 +214,11 @@ YFLAGS ?= -d
.c:
${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.cc .cpp .cxx .C:
${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
@@ -244,15 +228,11 @@ YFLAGS ?= -d
.m.o:
${OBJC} ${OBJCFLAGS} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.p.o:
${PC} ${PFLAGS} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.e .r .F .f:
${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} \
@@ -263,38 +243,28 @@ YFLAGS ?= -d
.S.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.asm.o:
${CC} -x assembler-with-cpp ${CFLAGS} -c ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.s.o:
${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
# 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
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.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
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
# XXX not -j safe
.y.c:
@@ -306,34 +276,26 @@ YFLAGS ?= -d
.s.out .c.out .o.out:
${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.f.out .F.out .r.out .e.out:
${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} \
${LDLIBS} -o ${.TARGET}
rm -f ${.PREFIX}.o
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
# XXX not -j safe
.y.out:
${YACC} ${YFLAGS} ${.IMPSRC}
${CC} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET}
rm -f y.tab.c
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
.l.out:
${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c
${CC} ${CFLAGS} ${LDFLAGS} ${.PREFIX}.tmp.c ${LDLIBS} -ll -o ${.TARGET}
rm -f ${.PREFIX}.tmp.c
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
# FreeBSD build pollution. Hide it in the non-POSIX part of the ifdef.
__MAKE_CONF?=/etc/make.conf
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index 0f5cd66..7e23a80 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -108,3 +108,11 @@ CFLAGS+= -restrict
${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips"
CFLAGS+= -fstack-protector
.endif
+
+#
+# Enable CTF conversation on request.
+#
+.if defined(WITH_CTF)
+.undef NO_CTF
+.endif
+
diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk
index f808c95..c5c9c34 100644
--- a/sys/conf/kern.post.mk
+++ b/sys/conf/kern.post.mk
@@ -19,6 +19,10 @@ MKMODULESENV+= KERNBUILDDIR="${.CURDIR}" SYSDIR="${SYSDIR}"
MKMODULESENV+= CONF_CFLAGS="${CONF_CFLAGS}"
.endif
+.if defined(WITH_CTF)
+MKMODULESENV+= WITH_CTF="${WITH_CTF}"
+.endif
+
.MAIN: all
.for target in all clean cleandepend cleandir clobber depend install \
@@ -90,9 +94,7 @@ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o
@rm -f ${.TARGET}
@echo linking ${.TARGET}
${SYSTEM_LD}
-.if defined(CTFMERGE)
- ${SYSTEM_CTFMERGE}
-.endif
+ @${SYSTEM_CTFMERGE}
.if !defined(DEBUG)
${OBJCOPY} --strip-debug ${.TARGET}
.endif
@@ -240,9 +242,7 @@ kernel-reinstall:
config.o env.o hints.o vers.o vnode_if.o:
${NORMAL_C}
-.if defined(CTFCONVERT)
- ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+ @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
config.ln env.ln hints.ln vers.ln vnode_if.ln:
${NORMAL_LINT}
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index ee74a9e..39a045a 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -128,11 +128,7 @@ NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${PROF} ${.IMPSRC}
NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \
${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c
-.if defined(CTFCONVERT)
-NORMAL_CTFCONVERT= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.else
-NORMAL_CTFCONVERT=
-.endif
+NORMAL_CTFCONVERT= [ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
NORMAL_LINT= ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC}
@@ -142,10 +138,7 @@ SYSTEM_DEP= Makefile ${SYSTEM_OBJS}
SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS}
SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o}
SYSTEM_OBJS+= hack.So
-.if defined(CTFMERGE)
-SYSTEM_CTFMERGE= ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o
-LD+= -g
-.endif
+SYSTEM_CTFMERGE= [ -z "${CTFMERGE}" -o -n "${NO_CTF}" ] || ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o
SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} \
-warn-common -export-dynamic -dynamic-linker /red/herring \
-o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 2cd7509..526eec7 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -69,6 +69,11 @@ OBJCOPY?= objcopy
.error "Do not use KMODDEPS on 5.0+; use MODULE_VERSION/MODULE_DEPEND"
.endif
+# Enable CTF conversion on request.
+.if defined(WITH_CTF)
+.undef NO_CTF
+.endif
+
.include <bsd.init.mk>
.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S
OpenPOWER on IntegriCloud