Disable LTO on aarch64

... as done in the standalone mozjs115 package on RHEL.

Related: RHEL-30208
This commit is contained in:
Florian Müllner 2024-05-13 16:12:19 +02:00
parent 314a048f68
commit 74edea8499
No known key found for this signature in database

View File

@ -8,6 +8,21 @@
%global mozjs_major 115
%global mozjs_version 115.7.0
# LTO - Enable in Release builds, but consider disabling for development as it increases compile time
%global mozjs_build_with_lto 1
%if 0%{?mozjs_build_with_lto}
# LTO is the default
%else
%define _lto_cflags %{nil}
%endif
# Disable LTO on aarch64 (borked since GCC14)
# https://bugzilla.redhat.com/show_bug.cgi?id=2260867
%ifarch aarch64
%define _lto_cflags %{nil}
%endif
# Big endian platforms
%ifarch ppc ppc64 s390 s390x
%global big_endian 1
@ -198,8 +213,10 @@ export CXX=g++
# https://github.com/japaric/cargo-call-stack/issues/25
export RUSTFLAGS="-C embed-bitcode"
%if 0%{?mozjs_build_with_lto}
# https://github.com/ptomato/mozjs/commit/36bb7982b41e0ef9a65f7174252ab996cd6777bd
export CARGO_PROFILE_RELEASE_LTO=true
%endif
export LINKFLAGS="%{?__global_ldflags}"
export PYTHON="%{__python3}"