macros: Pass -Ccodegen-units=1 in RUSTFLAGS

This has good impact on performance and binary size at cost of
compilation time. As nice side effect, it fixes bug which breaks
compilation of binaries in Fedora Rawhide.

For example, ffsend binary went from 107M to 70M.

References: https://bugzilla.redhat.com/show_bug.cgi?id=1701339
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2019-04-23 21:08:41 +02:00
parent bbd8cb71d3
commit 3076bbaa3a
No known key found for this signature in database
GPG key ID: 695714BD1BBC5F4C

View file

@ -2,7 +2,12 @@
%__rustdoc %{_bindir}/rustdoc
# Enable optimization, debuginfo, and link hardening.
%__global_rustflags -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now
%__global_rustflags %{shrink:
-Copt-level=3
-Cdebuginfo=2
-Clink-arg=-Wl,-z,relro,-z,now
-Ccodegen-units=1
}
%__global_rustflags_toml [%{lua:
for arg in string.gmatch(rpm.expand("%{__global_rustflags}"), "%S+") do