build: select a working C++20 compiler for RPM builds

A compiler activated while installing dependencies does not survive in
the caller's shell, so make rpm could fall back to one that can't
compile mergerfs. Route the RPM build through buildtools/run-rpmbuild,
which keeps an explicit compiler and otherwise activates an installed
GCC Toolset when the default can't handle C++20. RPMBUILD and
RPMBUILD_FLAGS override the rpmbuild command.

Rocky 8's toolsets lack the annobin plugin the distribution's RPM
flags load. Test the effective compiler with the RPM flags and pass
--undefine _annotated_build only when that fails, instead of guessing
from the compiler's path in build-mergerfs. Native and container
builds use the same check.
This commit is contained in:
Antonio SJ Musumeci 2026-05-13 13:56:09 -05:00
parent 11e759101d
commit d83e01b40a
4 changed files with 106 additions and 16 deletions

View file

@ -351,7 +351,8 @@ rpm: tarball
$(SED) 's/__VERSION__/$(VERSION)/g' mergerfs.spec > \
rpmbuild/SOURCES/mergerfs.spec
cp -ar mergerfs-$(VERSION).tar.gz rpmbuild/SOURCES
$(RPMBUILD) $(RPMBUILD_FLAGS) -ba rpmbuild/SOURCES/mergerfs.spec \
./buildtools/run-rpmbuild $(RPMBUILD) $(RPMBUILD_FLAGS) \
-ba rpmbuild/SOURCES/mergerfs.spec \
--define "_topdir $(CURDIR)/rpmbuild"
.PHONY: install-build-pkgs