1 export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
2 export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
3 export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
4 export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
15 PRIVATE_KERNELFILES = \
18 # Available only in xnu proper
23 INSTALL_MI_LIST = ${DATAFILES}
24 INSTALL_MI_LCL_LIST = ${PRIVATE_DATAFILES}
25 INSTALL_KF_MI_LIST = ${KERNELFILES}
26 INSTALL_KF_MI_LCL_LIST = ${KERNELFILES} ${PRIVATE_KERNELFILES}
28 EXPORT_MI_LIST = ${PRIVATE_XNUFILES} ${KERNELFILES} ${PRIVATE_KERNELFILES}
35 $(OBJROOT)/san/kasan-blacklist-%: $(SOURCE)/kasan-blacklist $(SOURCE)/ubsan-blacklist $(SOURCE)/kasan-blacklist-%
36 @$(LOG_GENERATE) "$(notdir $@)"
37 $(_v)sed -e 's,^src:\./,src:'"$(SRCROOT)/," $^ > $@
38 $(_v)$(SOURCE)/tools/validate_blacklist.sh "$@"
40 do_build_setup:: $(OBJROOT)/san/kasan-blacklist-x86_64 $(OBJROOT)/san/kasan-blacklist-arm64
43 # Kasan System.kext plugin
46 DSTROOT_KEXT_PATH = $(addprefix $(DSTROOT)$(INSTALL_EXTENSIONS_DIR),/System.kext/PlugIns/Kasan.kext)
47 SYMROOT_KEXT_PATH = $(addprefix $(SYMROOT),/System.kext/PlugIns/Kasan.kext)
49 ifneq ($(INSTALL_KASAN_ONLY),1)
50 DSTROOT_KEXT = $(DSTROOT_KEXT_PATH)/Kasan
51 SYMROOT_KEXT = $(SYMROOT_KEXT_PATH)/Kasan
52 SYMBOL_SET_BUILD = $(OBJPATH)/Kasan.symbolset
56 DSTROOT_KEXT += $(DSTROOT_KEXT_PATH)/Kasan_kasan
57 SYMROOT_KEXT += $(SYMROOT_KEXT_PATH)/Kasan_kasan
58 SYMBOL_SET_BUILD += $(OBJPATH)/Kasan_kasan.symbolset
61 ifneq ($(RC_ProjectName),xnu_libraries)
62 # Our external dependency on allsymbols is fine because this runs in a later phase (config_install vs. config_all)
63 $(OBJPATH)/%.symbolset: $(SOURCE)/%.exports
64 @$(LOG_SYMBOLSET) "$*$(Color0) ($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))"
65 $(_v)$(KEXT_CREATE_SYMBOL_SET) \
66 $(ARCH_FLAGS_$(CURRENT_ARCH_CONFIG)) \
67 -import $(OBJPATH)/allsymbols \
69 -output $@ $(_vstdout)
71 $(DSTROOT_KEXT): $(DSTROOT_KEXT_PATH)/% : $(SYMROOT_KEXT_PATH)/% ALWAYS
72 $(_v)$(MKDIR) $(dir $@)
73 @$(LOG_INSTALL) "$(@F)$(Color0) ($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))"
74 $(_v)$(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@
76 $(SYMROOT_KEXT): $(SYMBOL_SET_BUILD) ALWAYS
77 $(_v)$(MKDIR) $(dir $@)
78 @$(LOG_INSTALL) "$(@F)$(Color0) ($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))"
79 $(_v)if [ $(OBJROOT)/.symbolset.timestamp -nt $@ ]; then \
80 $(INSTALL) $(EXEC_INSTALL_FLAGS) $(OBJPATH)/$(@F).symbolset $@; \
83 $(LIPO) -create $@ $(OBJPATH)/$(@F).symbolset -output $@ 2>/dev/null || true; \
88 do_config_install:: $(SYMROOT_KEXT) $(DSTROOT_KEXT)
90 # We are building XNU as a static library - no need for the symbol kexts
93 # Install helper scripts
96 KASAN_HELPER_SCRIPTS += $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/kasan_install
99 $(KASAN_HELPER_SCRIPTS): $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/% : $(SOURCE)/tools/%
100 $(_v)$(MKDIR) $(dir $@)
101 @$(LOG_INSTALL) "$(@F)"
102 $(_v)$(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@
104 do_config_install:: $(KASAN_HELPER_SCRIPTS)
106 include $(MakeInc_rule)
107 include $(MakeInc_dir)