Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F159941646
D37898.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D37898.diff
View Options
diff --git a/share/mk/sys.mk b/share/mk/sys.mk
--- a/share/mk/sys.mk
+++ b/share/mk/sys.mk
@@ -172,6 +172,7 @@
CTFCONVERT ?= ctfconvert
CTFMERGE ?= ctfmerge
+CTFDUMP ?= ctfdump
.if defined(CFLAGS) && (${CFLAGS:M-g} != "")
CTFFLAGS += -g
diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk
--- a/sys/conf/kern.post.mk
+++ b/sys/conf/kern.post.mk
@@ -54,6 +54,10 @@
MKMODULESENV+= COMPAT_FREEBSD32_ENABLED="yes"
.endif
+.if ${MK_CTF} != "no"
+KCTF_FILE= "kctf.raw"
+.endif
+
# Allow overriding the kernel debug directory, so kernel and user debug may be
# installed in different directories. Setting it to "" restores the historical
# behavior of installing debug files in the kernel directory.
@@ -201,6 +205,13 @@
.if ${MK_CTF} != "no"
@echo ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ...
@${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o
+# Dump merged CTF data into a file and uncompress it
+ @${OBJCOPY} --set-section-flags .SUNW_ctf=alloc,load ${.TARGET}
+ @${OBJCOPY} -O binary -j ".SUNW_ctf" ${.TARGET} kctf.bin
+ @${OBJCOPY} --set-section-flags .SUNW_ctf=readonly ${.TARGET}
+ @${CTFDUMP} -u ${KCTF_FILE} kctf.bin
+ @rm kctf.bin
+
.endif
.if !defined(DEBUG)
${OBJCOPY} --strip-debug ${.TARGET}
@@ -423,6 +434,9 @@
.endif
mkdir -p ${DESTDIR}${KODIR}
${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO} ${DESTDIR}${KODIR}/
+.if ${MK_CTF} != "no"
+ ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KCTF_FILE} ${DESTDIR}${KODIR}/
+.endif
.if defined(DEBUG) && !defined(INSTALL_NODEBUG) && ${MK_KERNEL_SYMBOLS} != "no"
mkdir -p ${DESTDIR}${KERN_DEBUGDIR}${KODIR}
${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.debug ${DESTDIR}${KERN_DEBUGDIR}${KODIR}/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jun 20, 6:57 PM (3 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34125389
Default Alt Text
D37898.diff (1 KB)
Attached To
Mode
D37898: ddb: Add basic CTF support [1/2]
Attached
Detach File
Event Timeline
Log In to Comment