diff --git a/Makefile.inc1 b/Makefile.inc1 index 03b8322cf57c..ac69125183c4 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -761,7 +761,15 @@ _worldtmp: .PHONY .endif .else rm -rf ${WORLDTMP}/legacy/usr/include -.endif +.if ${USING_SYSTEM_COMPILER} == "yes" +.for cc in cc c++ + if [ -x ${WORLDTMP}/usr/bin/${cc} ]; then \ + inum=$$(stat -f %i ${WORLDTMP}/usr/bin/${cc}); \ + find ${WORLDTMP}/usr/bin -inum $${inum} -delete; \ + fi +.endfor +.endif # ${USING_SYSTEM_COMPILER} == "yes" +.endif # !defined(NO_CLEAN) # Our current approach to dependency tracking cannot cope with certain source # tree changes, particularly with respect to removing source files and