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
This commit is contained in:
parent
11224884f2
commit
7afab8a67e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user