#182 Make build opt-level/debuginfo/codegen-units configurable
Merged 2 years ago by zbyszek. Opened 2 years ago by zbyszek.
fedora-rust/ zbyszek/rust2rpm make-debuginfo-settable  into  main

file modified
+8 -3
@@ -1,19 +1,24 @@ 

  %__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=3

-   -Cdebuginfo=2

+   -Copt-level=%rustflags_opt_level

+   -Cdebuginfo=%rustflags_debuginfo

+   -Ccodegen-units=%rustflags_codegen_units

    -Clink-arg=-Wl,-z,relro

    -Clink-arg=-Wl,-z,now

    %{?_package_note_file:-Clink-arg=-Wl,-dT,%{_package_note_file}}

-   -Ccodegen-units=1

    --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 .. '", ')

no initial comment

2 new commits added

  • Allow easy overriding of the opt-level/debuginfo/codegen-units flags
  • Add comment about unused macro
2 years ago

This is even better than what we had before. Thanks, LGTM! :tophat:

Pull-Request has been merged by zbyszek

2 years ago
Metadata