| |
@@ -94,3 +94,48 @@
|
| |
|
| |
# Arches that OpenJDK and dependent packages run on
|
| |
%java_arches aarch64 ppc64le s390x x86_64
|
| |
+
|
| |
+ # 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 %{shrink:
|
| |
+ -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 EPEL8, at least in a COPR.