Dependencies
------------
-* C++17 compiler (tested with GCC 11 through 14)
-
- bees uses `-Wall -Wextra -Werror -O3` and no other compiler flags.
- Be careful when adding extra flags such as `-flto` or
- `-D_GLIBCXX_ASSERTIONS` when building bees for distribution; these
- interact with known GCC bugs that produce false-positive warnings,
- breaking the build or crashing at runtime. Known-broken combinations:
-
- | GCC version | Flag(s) | Notes |
- |---|---|---|
- | 12 | `-flto=auto` | False-positive `-Wmaybe-uninitialized`; toolchain bug, not a bees bug |
- | 12 | `-D_GLIBCXX_ASSERTIONS` | Separate bug, possibly in libstdc++ |
- | 13 | — | All flags work correctly |
- | 14 | `-flto=auto` | Same `-Wmaybe-uninitialized` regression as GCC 12 |
-
- If your distribution's build system adds LTO or assertion flags by
- default, you may need to disable them for bees (e.g. with a `%define
- _lto_cflags %nil` spec override on RPM-based distros).
+* C++17 compiler (tested with GCC 11 through 14, and clang 19)
+
+ bees builds with `-Wall -Wextra -Werror -O3` and needs no other
+ compiler flags. `-Werror` makes any new compiler warning fatal, so
+ adding flags that change which warnings fire can break the build.
+
+ `-flto` is tested. `make build-check` builds bees and runs its unit
+ tests with GCC and with clang, both with `-flto`.
+
+ Set `CC` and `CXX` to the same toolchain when building with `-flto`.
+ LTO leaves compiler-specific intermediate code in the object files,
+ and the linker loads the plugin for whichever toolchain drives the
+ link, which cannot read the other's. bees compiles C as well as C++,
+ including `lib/xxhash.c` and the generated `src/bees-version.c`, so
+ overriding only `CXX` is enough to fail the link with `plugin needed
+ to handle lto object` and undefined references to `XXH64` and
+ `BEES_VERSION`.
* btrfs-progs