Last active
June 18, 2018 11:34
-
-
Save angelorodem/73ea6893cab07e238fb324e11aa378c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For debugging | |
Linker: | |
-lgcov --coverage | |
Compiler: | |
-g -Og -dA -Wall -Wextra -Wcast-align -Wcast-qual -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimport -Winit-self -Winline -Winvalid-pch -Wlogical-op -Wmissing-declarations -Wno-missing-format-attribute -Wmissing-include-dirs -Wmultichar -Wpacked -Wpointer-arith -Wreturn-type -Wsequence-point -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Werror=undef -Wno-unused -Wvariadic-macros -Wwrite-strings -Werror=declaration-after-statement -Werror=implicit-function-declaration -Werror=nested-externs -Werror=strict-prototypes -fno-strict-aliasing -static #-Werror=missing-braces | |
for release | |
(if you have problems with fwhole-program use -flto instead and use -flto in the linker too) | |
Compiler (fast but not safe): | |
-Ofast -fwhole-program -fomit-frame-pointer -fmodulo-sched -fmodulo-sched-allow-regmoves -fgcse-sm -fgcse-las -fgcse-after-reload -funsafe-loop-optimizations -flive-range-shrinkage -fsched-spec-load-dangerous -fsched2-use-superblocks -floop-nest-optimize -floop-parallelize-all -ftree-parallelize-loops=8 -fprefetch-loop-arrays -ffinite-math-only -march=native -mtune=native -mfpmath="387+sse" -std=c++1z -static | |
(for a bit more performance use profiling guided optimization aswell) | |
For a hardened release (slow but safe): | |
Linker: | |
-Wl,-z,now -Wl,-z,relro | |
Compiler: | |
-Os -fwhole-program -s -fPIE -fvisibility-inlines-hidden -flto -fomit-frame-pointer -fstack-protector-all -D_FORTIFY_SOURCE=2 -fcf-protection=full -fvisibility=hidden -fsanitize=address -fsanitize=kernel-address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-cmp -mmpx -fcheck-pointer-bounds -static -fstack-check -fstack-clash-protection -fsplit-stack -fvtable-verify=preinit -fstack-reuse=none -fno-exceptions -freg-struct-return -fno-jump-tables -mfpmath="387+sse" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment