diff --git a/firefox.spec b/firefox.spec index 9d407b3..1486383 100644 --- a/firefox.spec +++ b/firefox.spec @@ -715,10 +715,34 @@ echo "ac_add_options MOZ_PGO=1" >> .mozconfig export CCACHE_DISABLE=1 %endif +%if 0%{?fedora} > 35 # Require 2 GB of RAM per CPU core %constrain_build -m 2048 - echo "mk_add_options MOZ_MAKE_FLAGS=\"-j%{_smp_build_ncpus}\"" >> .mozconfig +%else +# F35 doesn't have %%constrain_build +MOZ_SMP_FLAGS=-j1 +# On x86_64 architectures, Mozilla can build up to 4 jobs at once in parallel, +# however builds tend to fail on other arches when building in parallel. +%ifarch %{ix86} s390x %{arm} aarch64 +[ -z "$RPM_BUILD_NCPUS" ] && \ + RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" +[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2 +%endif +%ifarch x86_64 ppc ppc64 ppc64le +[ -z "$RPM_BUILD_NCPUS" ] && \ + RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" +[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2 +[ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4 +[ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j8 +[ "$RPM_BUILD_NCPUS" -ge 16 ] && MOZ_SMP_FLAGS=-j16 +[ "$RPM_BUILD_NCPUS" -ge 24 ] && MOZ_SMP_FLAGS=-j24 +[ "$RPM_BUILD_NCPUS" -ge 32 ] && MOZ_SMP_FLAGS=-j32 +[ "$RPM_BUILD_NCPUS" -ge 64 ] && MOZ_SMP_FLAGS=-j64 +%endif +echo "mk_add_options MOZ_MAKE_FLAGS=\"$MOZ_SMP_FLAGS\"" >> .mozconfig +%endif + echo "mk_add_options MOZ_SERVICES_SYNC=1" >> .mozconfig echo "export STRIP=/bin/true" >> .mozconfig #export MACH_USE_SYSTEM_PYTHON=1