| |
@@ -49,3 +49,39 @@
|
| |
%cargo_test %__cargo test --release %{?_smp_mflags} --no-fail-fast
|
| |
|
| |
%cargo_install %__cargo install --no-track --path .
|
| |
+
|
| |
+ # From rust-srpm-macros 8+
|
| |
+ # rustflags_opt_level: default optimization level
|
| |
+ #
|
| |
+ # It corresponds to the "-Copt-level" rustc command line option.
|
| |
+ %rustflags_opt_level 3
|
| |
+
|
| |
+ # rustflags_debuginfo: default verbosity of debug information
|
| |
+ #
|
| |
+ # It corresponds to the "-Cdebuginfo" rustc command line option.
|
| |
+ # In some cases, it might be required to override this macro with "1" or even
|
| |
+ # "0", if memory usage gets too high during builds on some resource-constrained
|
| |
+ # architectures (most likely on 32-bit architectures), which will however
|
| |
+ # reduce the quality of the produced debug symbols.
|
| |
+ %rustflags_debuginfo 2
|
| |
+
|
| |
+ # rustflags_codegen_units: default number of parallel code generation units
|
| |
+ #
|
| |
+ # The default value of "1" results in generation of better code, but comes at
|
| |
+ # the cost of longer build times.
|
| |
+ %rustflags_codegen_units 1
|
| |
+
|
| |
+ # build_rustflags: default compiler flags for rustc (RUSTFLAGS)
|
| |
+ #
|
| |
+ # -Copt-level: set optimization level (default: highest optimization level)
|
| |
+ # -Cdebuginfo: set debuginfo verbosity (default: full debug information)
|
| |
+ # -Ccodegen-units: set number of parallel code generation units (default: 1)
|
| |
+ # Cforce-frame-pointers: force inclusion of frame pointers (default: enabled
|
| |
+ # on x86_64 and aarch64 on Fedora 37+)
|
| |
+ #
|
| |
+ # Additionally, sime linker flags are set which correspond to the default
|
| |
+ # Fedora compiler flags for hardening and for embedding package versions into
|
| |
+ # compiled binaries.
|
| |
+ #
|
| |
+ # ref. https://doc.rust-lang.org/rustc/codegen-options/index.html
|
| |
+ %build_rustflags -Copt-level=%rustflags_opt_level -Cdebuginfo=%rustflags_debuginfo -Ccodegen-units=%rustflags_codegen_units %{?_include_frame_pointers:-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
|
| |
The hope is to help with building clamav-1.0 for EPEL7, at least in a COPR.