diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index e5235a92a201..31794951a593 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -48,7 +48,9 @@ dyn_hack.so: # Since moving rtld-elf to /libexec, we need to create a symlink. # Fixup the existing binary that's there so we can symlink over it. beforeinstall: +.if exists(${DESTDIR}/usr/libexec/${PROG}) -chflags noschg ${DESTDIR}/usr/libexec/${PROG} +.endif .PATH: ${.CURDIR}/${MACHINE_ARCH}