aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2020-09-18 19:03:34 +0000
committerMark Johnston <markj@FreeBSD.org>2020-09-18 19:03:34 +0000
commit7afab8a67ee7f4114887bc3b024cc58f8c6dedf1 (patch)
tree5e566d61c01b4e1f1bcf5ad485f59e296b444481
parent11224884f285481ccecb61f57381b51661d77c6d (diff)
downloadsrc-7afab8a67ee7f4114887bc3b024cc58f8c6dedf1.tar.gz
src-7afab8a67ee7f4114887bc3b024cc58f8c6dedf1.zip
Install library symlinks atomically.
As we do for shared library binaries, pass -S to install(1) when installing symlinks. Doing so helps avoid transient failures when libraries are being reinstalled, which seems to be the root cause of spurious libgcc_s.so link failures during CI builds. PR: 233769 Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26453
Notes
Notes: svn path=/head/; revision=365889
-rw-r--r--share/mk/bsd.lib.mk20
1 files changed, 12 insertions, 8 deletions
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index f1bc3bf836d7..9997bfa979df 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -403,6 +403,7 @@ SHLINSTALLFLAGS+= -fschg
# that are only creating an image.
.if !defined(NO_SAFE_LIBINSTALL) && !defined(NO_ROOT)
SHLINSTALLFLAGS+= -S
+SHLINSTALLSYMLINKFLAGS+= -S
.endif
_INSTALLFLAGS:= ${INSTALLFLAGS}
@@ -410,6 +411,7 @@ _INSTALLFLAGS:= ${INSTALLFLAGS}
_INSTALLFLAGS:= ${_INSTALLFLAGS${ie}}
.endfor
_SHLINSTALLFLAGS:= ${SHLINSTALLFLAGS}
+_SHLINSTALLSYMLINKFLAGS:= ${SHLINSTALLSYMLINKFLAGS}
.for ie in ${INSTALLFLAGS_EDIT}
_SHLINSTALLFLAGS:= ${_SHLINSTALLFLAGS${ie}}
.endfor
@@ -444,29 +446,31 @@ _libinstall:
${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \
${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
.for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS}
- ${INSTALL_LIBSYMLINK} ${TAG_ARGS} ${SHLIB_LINK} ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK}
+ ${INSTALL_LIBSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS} ${SHLIB_LINK} \
+ ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK}
.endfor
.else
.if ${_SHLIBDIR} == ${_LIBDIR}
.if ${SHLIB_LINK:Mlib*}
- ${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
+ ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS:D${TAG_ARGS},dev} \
+ ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
.else
- ${INSTALL_RSYMLINK} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \
+ ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \
${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
.endif
.else
.if ${SHLIB_LINK:Mlib*}
- ${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \
- ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
+ ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS:D${TAG_ARGS},dev} \
+ ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
.else
- ${INSTALL_RSYMLINK} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \
- ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
+ ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS} \
+ ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
.endif
.if exists(${DESTDIR}${_LIBDIR}/${SHLIB_NAME})
-chflags noschg ${DESTDIR}${_LIBDIR}/${SHLIB_NAME}
rm -f ${DESTDIR}${_LIBDIR}/${SHLIB_NAME}
.endif
-.endif
+.endif # _SHLIBDIR == _LIBDIR
.endif # SHLIB_LDSCRIPT
.endif # SHLIB_LINK
.endif # SHIB_NAME