[Packages] Improve compile options and document them

This commit is contained in:
Antoine Viallon 2022-04-10 22:34:18 +02:00
parent 5cda91672c
commit 692c9b459d
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -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 makes 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" ];