Author: bdrewery
Date: Sat Jul  8 16:39:55 2017
New Revision: 320806
URL: https://svnweb.freebsd.org/changeset/base/320806

Log:
  SYSTEM_COMPILER: Ensure there is not a stale compiler in WORLDTMP.
  
  In a scenario of cross-building it is possible that an OBJDIR's WORLDTMP
  contains an older compiler in WORLDTMP/usr/bin/cc that is not rebuilt
  if SYSTEM_COMPILER logic is triggered.  This compiler was still
  incorrectly used.  Address this by removing WORLDTMP/usr/bin/cc and all
  of the hardlinked files associated with it.  Also do this for c++ for
  GCC builds.
  
  Sponsored by: Dell EMC Isilon
  MFC after:    1 week

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1  Sat Jul  8 15:01:55 2017        (r320805)
+++ head/Makefile.inc1  Sat Jul  8 16:39:55 2017        (r320806)
@@ -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
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to