rust2rpm/data/macros.rust
2023-01-26 14:04:12 -08:00

26 lines
865 B
Text

%__rustc %{_bindir}/rustc
%__rustdoc %{_bindir}/rustdoc
%rustflags_opt_level 3
%rustflags_debuginfo 2
%rustflags_codegen_units 1
# Enable optimization, debuginfo, and link hardening.
%build_rustflags %{shrink:
-Copt-level=%rustflags_opt_level
-Cdebuginfo=%rustflags_debuginfo
-Ccodegen-units=%rustflags_codegen_units
%{expr:0%{?_include_frame_pointers} && ("%{_arch}" != "ppc64le" && "%{_arch}" != "s390x" && "%{_arch}" != "i386") ? "-Cforce-frame-pointers=yes" : ""}
-Clink-arg=-Wl,-z,relro
-Clink-arg=-Wl,-z,now
%{?_package_note_file:-Clink-arg=-Wl,-dT,%{_package_note_file}}
--cap-lints=warn
}
%__global_rustflags %{build_rustflags}
# Currently unused, retained for backwards compatibility.
%__global_rustflags_toml [%{lua:
for arg in string.gmatch(rpm.expand("%{build_rustflags}"), "%S+") do
print('"' .. arg .. '", ')
end}]