4 ms·
If you found out through gdb that your code compiled with -O0 was still somehow optimized by gcc, or if you found out that your gcc did not optimize your code a
by jxy 10y ago
If you found out through gdb that your code compiled with -O0 was still somehow optimized by gcc, or if you found out that your gcc did not optimize your code aggressively enough although you gave it -Ofast, check out this issue [0].
[0] https://github.com/NixOS/nixpkgs/issues/18995 https://github.com/NixOS/nixpkgs/issues/18995
Yeah. The devs believed it was okay to make gcc -O2 by default and impossible to override from the command line you gave to gcc.
If you encountered this issue I hope google could quickly bring you to that issue on github. Good luck and don't waste hours to figure out why.
- secure 10y agoRelated: enabling debug symbols for all packages by default (in a separated output): https://github.com/NixOS/nixpkgs/issues/18530 https://github.com/NixOS/nixpkgs/issues/18530
- oever 10y agoHaving debug symbols enabled should be the default in my opinion. Especially in a partially self-compiled distribution like NixOS. The threshold to submitting bugs should be low. Unf I'm seeing a unicorn (GitHub fail whale) currently, so I cannot see the issue.
- grhmc 10y agoIt looks like there is a workaround. I'm sorry this broke your optimizations :(
- AndyKelley 10y agoMeanwhile, if you were me, you spent weeks wondering what was happening before finally tracking the problem down and filing the issue :-) I still love NixOS! A little hiccup here and there but it's still a great idea that I am happy to support.