Use -S for library installations except for -DNO_ROOT builds.
authorbdrewery <bdrewery@FreeBSD.org>
Wed, 16 Aug 2017 05:02:31 +0000 (05:02 +0000)
committerbdrewery <bdrewery@FreeBSD.org>
Wed, 16 Aug 2017 05:02:31 +0000 (05:02 +0000)
commitba9b1ddcf5495624dcf458b125bd65ab9e5a8459
tree5b7d0abe5632bd650d84ea56ee3b1ae57e59f9f2
parent5bec095fcbe133830135dc8ac3e15cdae3a0ed80
Use -S for library installations except for -DNO_ROOT builds.

Also disable this if NO_SAFE_LIBINSTALL is defined.

There is little harm in always using -S and it fixes several issues:
- A race during 'make libraries' where, for example, libgcc_s is being
  installed while another library is trying to link against it.  This is
  possible because libgcc_s is connected in both _prereq_libs and
  _startup_libs.  The first build (_prereq_libs) sets MK_PROFILE=no
  while the 2nd pass (_startup_libs) enables MK_PROFILE.  Thus the
  libgcc_s library *is* present in WORLDTMP for other libraries to
  link to, so serializing further items in _startup_libs is not
  required.  Just ensuring that libgcc_s is installed atomically (via
  rename(2)) is enough. [1]
- Installation to a running system where some library that cannot be
  detected, copied and used from the temporary INSTALLTMP with LD_LIBRARY_PATH
  that the build itself uses for installation.  Such an example is having the
  install an NSS module for user lookups that install(1) uses while
  concurrently installing the module in another process.  This is not
  a problem for the FreeBSD base build but can be for downstream
  vendors.  While this is a very specific case, installation to a
  running system with non-atomic library installation is prone to many
  problems.  A further step still is to install in proper dependency
  ordering.

Reported by: dhw many times [1]
Sponsored by: Dell EMC Isilon
MFC after: 2 weeks
share/mk/bsd.lib.mk