[Midnightbsd-cvs] [MidnightBSD/src] 7cb9b5: bsd.lib.mk: replace shared libraries atomically wh...

Lucas Holt noreply at github.com
Wed Sep 23 08:41:41 EDT 2026


  Branch: refs/heads/master
  Home:   https://github.com/MidnightBSD/src
  Commit: 7cb9b59f7650de7eb2116568e50e1a3055fe7365
      https://github.com/MidnightBSD/src/commit/7cb9b59f7650de7eb2116568e50e1a3055fe7365
  Author: Lucas Holt <luke at foolishgames.com>
  Date:   2026-09-22 (Tue, 22 Sep 2026)

  Changed paths:
    M share/mk/bsd.lib.mk

  Log Message:
  -----------
  bsd.lib.mk: replace shared libraries atomically when relinking

The ${SHLIB_NAME_FULL} rule removed ${SHLIB_NAME} and ${SHLIB_LINK}
before linking, and the objcopy step then wrote ${SHLIB_NAME} in place,
so a library disappeared from its OBJDIR for the whole relink.

With META_MODE, stage 4.2 of buildworld reinstalls libc, libc++, libm
and libgcc_s into WORLDTMP after the rest of lib/ has linked (installed
copies are stripped, so install -C always rewrites them), and stage 4.4
then relinks the shared libraries that read them.  Stage 4.4 builds lib
and usr.bin in parallel, and usr.bin/clang links libprivatellvm.so by
path from OBJTOP, so -j buildworld intermittently failed with

  c++: error: no such file or directory: .../libprivatellvm.so

while linking ld.lld.  Any consumer of a private library linked from
OBJTOP is exposed the same way.

Drop the rm: lld already writes its output to a temporary file and
renames it into place.  Have objcopy write ${SHLIB_NAME}.tmp and mv it
over ${SHLIB_NAME}, so readers always see a complete old or new file.

Tested by forcing a libllvm relink under META_MODE and polling for the
library every 0.2s: it was missing in 13 of 24 polls before this change
and in none of 22 after.  A clean -j14 buildworld of stable/4.1 with
this change relinked libllvm and 283 other shared libraries in stage
4.4 while the usr.bin/clang tools linked, and completed without error.

AI-Assisted-by: Claude Opus 5.5
Signed-off-by: Lucas Holt <luke at foolishgames.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply at anthropic.com>



To unsubscribe from these emails, change your notification settings at https://github.com/MidnightBSD/src/settings/notifications


More information about the Midnightbsd-cvs mailing list