Changeset View
Changeset View
Standalone View
Standalone View
sys/conf/kern.post.mk
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
.if defined(GCOV_CFLAGS) | .if defined(GCOV_CFLAGS) | ||||
MKMODULESENV+= GCOV_CFLAGS="${GCOV_CFLAGS}" | MKMODULESENV+= GCOV_CFLAGS="${GCOV_CFLAGS}" | ||||
.endif | .endif | ||||
.if !empty(COMPAT_FREEBSD32_ENABLED) | .if !empty(COMPAT_FREEBSD32_ENABLED) | ||||
MKMODULESENV+= COMPAT_FREEBSD32_ENABLED="yes" | MKMODULESENV+= COMPAT_FREEBSD32_ENABLED="yes" | ||||
.endif | .endif | ||||
.if ${MK_CTF} != "no" | |||||
KCTF_FILE= "kctf.raw" | |||||
.endif | |||||
# Allow overriding the kernel debug directory, so kernel and user debug may be | # Allow overriding the kernel debug directory, so kernel and user debug may be | ||||
# installed in different directories. Setting it to "" restores the historical | # installed in different directories. Setting it to "" restores the historical | ||||
# behavior of installing debug files in the kernel directory. | # behavior of installing debug files in the kernel directory. | ||||
KERN_DEBUGDIR?= ${DEBUGDIR} | KERN_DEBUGDIR?= ${DEBUGDIR} | ||||
.MAIN: all | .MAIN: all | ||||
.if !defined(NO_MODULES) | .if !defined(NO_MODULES) | ||||
▲ Show 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | ${FULLKERNEL}: ${SYSTEM_DEP} vers.o | ||||
@echo linking ${.TARGET} | @echo linking ${.TARGET} | ||||
${SYSTEM_LD} | ${SYSTEM_LD} | ||||
.if !empty(MD_ROOT_SIZE_CONFIGURED) && defined(MFS_IMAGE) | .if !empty(MD_ROOT_SIZE_CONFIGURED) && defined(MFS_IMAGE) | ||||
@sh ${S}/tools/embed_mfs.sh ${.TARGET} ${MFS_IMAGE} | @sh ${S}/tools/embed_mfs.sh ${.TARGET} ${MFS_IMAGE} | ||||
.endif | .endif | ||||
.if ${MK_CTF} != "no" | .if ${MK_CTF} != "no" | ||||
@echo ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ... | @echo ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ... | ||||
@${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o | @${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o | ||||
# Dump merged CTF data into a file and uncompress it | |||||
markj: How does this get set? Is it a kernel config option? Or is one expected to pass it on the… | |||||
Done Inline ActionsIt is set through a kernel config option - makeoptions SUNW_LOADABLE=1 bnovkov: It is set through a kernel config option -
```
makeoptions SUNW_LOADABLE=1
``` | |||||
@${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 | .endif | ||||
Not Done Inline ActionsIt's rather ugly that this has to be repeated. Ditto for the kernel link. I don't have a better suggestion offhand though. markj: It's rather ugly that this has to be repeated. Ditto for the kernel link. I don't have a better… | |||||
.if !defined(DEBUG) | .if !defined(DEBUG) | ||||
${OBJCOPY} --strip-debug ${.TARGET} | ${OBJCOPY} --strip-debug ${.TARGET} | ||||
.endif | .endif | ||||
${SYSTEM_LD_TAIL} | ${SYSTEM_LD_TAIL} | ||||
OBJS_DEPEND_GUESS+= offset.inc assym.inc vnode_if.h ${BEFORE_DEPEND:M*.h} \ | OBJS_DEPEND_GUESS+= offset.inc assym.inc vnode_if.h ${BEFORE_DEPEND:M*.h} \ | ||||
${MFILES:T:S/.m$/.h/} | ${MFILES:T:S/.m$/.h/} | ||||
.for mfile in ${MFILES} | .for mfile in ${MFILES} | ||||
# XXX the low quality .m.o rules gnerated by config are normally used | # XXX the low quality .m.o rules gnerated by config are normally used | ||||
# instead of the .m.c rules here. | # instead of the .m.c rules here. | ||||
Not Done Inline ActionsWith this approach, do we need to do any extra work for kernel modules? markj: With this approach, do we need to do any extra work for kernel modules? | |||||
Done Inline ActionsWe would need a bit of extra work, but this mostly boils down to slight ldscript modifications and adjusting the existing linker methods used for loading modules to load the section and unpack the data. This also wouldn't require any additional linker script symbols as we can load the section header string table. bnovkov: We would need a bit of extra work, but this mostly boils down to slight ldscript modifications… | |||||
${mfile:T:S/.m$/.c/}: ${mfile} | ${mfile:T:S/.m$/.c/}: ${mfile} | ||||
${AWK} -f $S/tools/makeobjops.awk ${mfile} -c | ${AWK} -f $S/tools/makeobjops.awk ${mfile} -c | ||||
${mfile:T:S/.m$/.h/}: ${mfile} | ${mfile:T:S/.m$/.h/}: ${mfile} | ||||
${AWK} -f $S/tools/makeobjops.awk ${mfile} -h | ${AWK} -f $S/tools/makeobjops.awk ${mfile} -h | ||||
.endfor | .endfor | ||||
kernel-clean: | kernel-clean: | ||||
rm -f *.o *.so *.pico *.ko *.s eddep errs \ | rm -f *.o *.so *.pico *.ko *.s eddep errs \ | ||||
▲ Show 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | if [ -n "${KERN_DEBUGDIR}" -a \ | ||||
rm -rf ${DESTDIR}${KERN_DEBUGDIR}${KODIR}.old ; \ | rm -rf ${DESTDIR}${KERN_DEBUGDIR}${KODIR}.old ; \ | ||||
mv ${DESTDIR}${KERN_DEBUGDIR}${KODIR} ${DESTDIR}${KERN_DEBUGDIR}${KODIR}.old ; \ | mv ${DESTDIR}${KERN_DEBUGDIR}${KODIR} ${DESTDIR}${KERN_DEBUGDIR}${KODIR}.old ; \ | ||||
fi ; \ | fi ; \ | ||||
sysctl kern.bootfile=${DESTDIR}${KODIR}.old/"`basename "$$thiskernel"`" ; \ | sysctl kern.bootfile=${DESTDIR}${KODIR}.old/"`basename "$$thiskernel"`" ; \ | ||||
fi | fi | ||||
.endif | .endif | ||||
mkdir -p ${DESTDIR}${KODIR} | mkdir -p ${DESTDIR}${KODIR} | ||||
${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO} ${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" | .if defined(DEBUG) && !defined(INSTALL_NODEBUG) && ${MK_KERNEL_SYMBOLS} != "no" | ||||
mkdir -p ${DESTDIR}${KERN_DEBUGDIR}${KODIR} | mkdir -p ${DESTDIR}${KERN_DEBUGDIR}${KODIR} | ||||
${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.debug ${DESTDIR}${KERN_DEBUGDIR}${KODIR}/ | ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.debug ${DESTDIR}${KERN_DEBUGDIR}${KODIR}/ | ||||
.endif | .endif | ||||
.if defined(KERNEL_EXTRA_INSTALL) | .if defined(KERNEL_EXTRA_INSTALL) | ||||
${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_EXTRA_INSTALL} ${DESTDIR}${KODIR}/ | ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_EXTRA_INSTALL} ${DESTDIR}${KODIR}/ | ||||
.endif | .endif | ||||
Show All 40 Lines |
How does this get set? Is it a kernel config option? Or is one expected to pass it on the command line, as in make -DSUNW_LOADABLE buildkernel?