[FreeBSD-Announce] FreeBSD Errata Notice FreeBSD-EN-21:05.libatomic

FreeBSD Errata Notices errata-notices at freebsd.org
Fri Jan 29 02:34:26 UTC 2021

Hash: SHA512

FreeBSD-EN-21:05.libatomic                                      Errata Notice
                                                          The FreeBSD Project

Topic:          Addition of atomic and bswap functions to libcompiler_rt

Category:       core
Module:         libcompiler_rt
Announced:      2021-01-29
Affects:        FreeBSD 11.4
Corrected:      2020-09-12 16:33:05 UTC (stable/11, 11.4-STABLE)
                2021-01-29 00:20:06 UTC (releng/11.4, 11.4-RELEASE-p7)

For general information regarding FreeBSD Errata Notices and Security
Advisories, including descriptions of the fields above, security
branches, and the following sections, please visit

I.   Background

libcompiler_rt is a simple library that provides an implementation of low-level
target-specific functionality required by the Clang compiler.

II.  Problem Description

The FreeBSD build system does not include all source files of libcompiler_rt.
In particular, it misses the atomic.c file, which implements atomic memory
routines for the i386 architecture.

III. Impact

When compiling software that makes use of atomic functions, as well as __bswap*
functions, the compiler emits calls to them expecting that these will be
available from libcompiler_rt.  Due to this, the linker fails to resolve
mentioned functions and the build fails.

The problem occurs only when targeting the i386 platform.

IV.  Workaround

The problem can be worked around by using GCC compiler to build the software.

V.   Solution

Upgrade your system to a supported FreeBSD stable or release / security
branch (releng) dated after the correction date.

Perform one of the following:

1) To update your system via a binary patch:

Systems running a RELEASE version of FreeBSD on the i386 or amd64
platforms can be updated via the freebsd-update(8) utility:

# freebsd-update fetch
# freebsd-update install

2) To update your system via a source code patch:

The following patches have been verified to apply to the applicable
FreeBSD release branches.

a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.

# fetch https://security.FreeBSD.org/patches/EN-21:05/libatomic.patch
# fetch https://security.FreeBSD.org/patches/EN-21:05/libatomic.patch.asc
# gpg --verify libatomic.patch.asc

b) Apply the patch.  Execute the following commands as root:

# cd /usr/src
# patch < /path/to/patch

c) Recompile the operating system using buildworld and installworld as
described in <URL:https://www.FreeBSD.org/handbook/makeworld.html>.

Restart all daemons that use the library, or reboot the system.

VI.  Correction details

The following list contains the correction revision numbers for each
affected branch.

Branch/path                                                      Revision
- -------------------------------------------------------------------------
stable/11/                                                        r365661
releng/11.4/                                                      r369155
- -------------------------------------------------------------------------

To see which files were modified by a particular revision, run the
following command, replacing NNNNNN with the revision number, on a
machine with Subversion installed:

# svn diff -cNNNNNN --summarize svn://svn.freebsd.org/base

Or visit the following URL, replacing NNNNNN with the revision number:


VII. References

The latest revision of this advisory is available at


More information about the freebsd-announce mailing list