mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Packages] Improve compile options and document them
This commit is contained in:
parent
5cda91672c
commit
692c9b459d
1 changed files with 21 additions and 5 deletions
26
packages.nix
26
packages.nix
|
|
@ -24,19 +24,35 @@ in
|
|||
compileFlags = mkOption {
|
||||
default = [
|
||||
"-O3" "-march=${generalCfg.cpuArch}" "-mtune=${generalCfg.cpuTune}"
|
||||
"-feliminate-unused-debug-types" "--param=ssp-buffer-size=32"
|
||||
# "-Wl,--copy-dt-needed-entries-m64-fasynchronous-unwind-tables"
|
||||
"-fasynchronous-unwind-tables"
|
||||
"-fno-semantic-interposition"
|
||||
"-feliminate-unused-debug-types"
|
||||
"--param=ssp-buffer-size=32"
|
||||
|
||||
"-fno-asynchronous-unwind-tables"
|
||||
|
||||
# Fat LTO objects are object files that contain both the intermediate language and the object code. This makes them usable for both LTO linking and normal linking.
|
||||
"-flto=auto" # Use -flto=auto to use GNU make’s job server, if available, or otherwise fall back to autodetection of the number of CPU threads present in your system.
|
||||
"-ffat-lto-objects"
|
||||
|
||||
# Math optimizations leading to loss of precision
|
||||
"-fno-signed-zeros"
|
||||
"-fno-trapping-math"
|
||||
"-fassociative-math"
|
||||
"-fexceptions"
|
||||
|
||||
# Perform loop distribution of patterns that can be code generated with calls to a library (activated at O3 and more)
|
||||
"-ftree-loop-distribute-patterns"
|
||||
|
||||
"-Wl,-sort-common"
|
||||
|
||||
# The compiler assumes that if interposition happens for functions the overwriting function will have precisely the same semantics (and side effects)
|
||||
"-fno-semantic-interposition"
|
||||
|
||||
# Perform interprocedural pointer analysis and interprocedural modification and reference analysis. This option can cause excessive memory and compile-time usage on large compilation units.
|
||||
"-fipa-pta"
|
||||
|
||||
|
||||
"-fdevirtualize-speculatively"
|
||||
|
||||
# Stream extra information needed for aggressive devirtualization when running the link-time optimizer in local transformation mode.
|
||||
"-fdevirtualize-at-ltrans"
|
||||
];
|
||||
example = [ "-O2" "-mavx" ];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue