diff --git a/Makefile b/Makefile index 483a6b12d..c1b131acd 100644 --- a/Makefile +++ b/Makefile @@ -27,10 +27,18 @@ TAR_REPRODUCIBLE = tar --mtime="@${SOURCE_DATE_EPOCH}" --sort=name --owner=0 --g # (Note we should also make installation of the units conditional on the rhsm feature) CARGO_FEATURES ?= $(shell . /usr/lib/os-release; if echo "$$ID_LIKE" |grep -qF rhel; then echo rhsm; fi) +# https://issues.redhat.com/browse/RHEL-116881 +ARCH ?= $(shell uname -m) +ID ?= $(shell [ -f /etc/os-release ] && . /etc/os-release && echo $$ID) +VERSION_ID ?= $(shell [ -f /etc/os-release ] && . /etc/os-release && echo $$VERSION_ID) +ifeq ($(ARCH)-$(ID)-$(VERSION_ID),s390x-centos-10) +CARGO_BUILD_ENV ?= MALLOC_MMAP_MAX_=0 +endif + all: bin manpages bin: - cargo build --release --features "$(CARGO_FEATURES)" + $(CARGO_BUILD_ENV) cargo build --release --features "$(CARGO_FEATURES)" .PHONY: manpages manpages: diff --git a/contrib/packaging/bootc.spec b/contrib/packaging/bootc.spec index 1e5c10ecd..245259692 100644 --- a/contrib/packaging/bootc.spec +++ b/contrib/packaging/bootc.spec @@ -95,6 +95,13 @@ cat vendor-config.toml >> .cargo/config.toml rm vendor-config.toml %build +# https://issues.redhat.com/browse/RHEL-116881 +%if 0%{?rhel} >= 10 +if test $(arch) = s390x; then + export MALLOC_MMAP_MAX_=0 +fi +%endif + # Build the main bootc binary %if %new_cargo_macros %cargo_build %{?with_rhsm:-f rhsm}