Packaging/32bit Applications: Difference between revisions

Sewer56 (talk | contribs)
Sewer56 (talk | contribs)
Added Rust and LTO Cross Compile Notes
 
Line 27: Line 27:


You will want something similar to the following in your <code>flake.nix</code>, <code>devenv.sh</code> , or whatever you're using as your entry point.
You will want something similar to the following in your <code>flake.nix</code>, <code>devenv.sh</code> , or whatever you're using as your entry point.
==== Rust LTO & cargo bench ====
If you are using LTO and are having trouble building benchmarks (<code>cargo bench</code>) you may need to disable it at the build step until someone documents a better workaround here.<syntaxhighlight lang="nix">
env = {
  # Disable LTO for C/C++ code compiled by the `cc` crate for i686.
  # Some crates (like `alloca`) add -flto when CC=clang, but binutils ld can't
  # process LLVM IR bitcode. Using -fno-lto ensures native object files.
  CFLAGS_i686_unknown_linux_gnu = "-fno-lto";
  CXXFLAGS_i686_unknown_linux_gnu = "-fno-lto";
};
</syntaxhighlight>
[[Category:Development]]
[[Category:Development]]