Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 619674

Summary: sys-devel/gcc add support for debug friendly optimizations levels
Product: Gentoo Linux Reporter: Alessandro Barbieri <lssndrbarbieri>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED WONTFIX    
Severity: enhancement CC: jstein
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 59506    

Description Alessandro Barbieri 2017-05-25 12:59:17 UTC
I had to build gcc with debug use and -g etc. for having the symbols in the backtraces BUT it still uses -O2 that is not debug friendly, please add support for -Og or -O0


sys-devel/gcc-5.4.0-r3::gentoo was built with the following:
USE="cilk cxx debug fortran gcj go graphite hardened mpx nls nptl objc objc++ objc-gc openmp (pie) (ssp) vtv (-altivec) (-awt) -doc (-fixed-point) (-jit) (-libssp) (-multilib) -nopie -nossp -regression-test (-sanitize) -vanilla" RUBY_TARGETS="rbx"
CFLAGS="-O2 -pipe -march=native -mtune=native -Wformat -Wformat-security -O2 -g2 -ggdb2 -fno-omit-frame-pointer -Wl,-O1 -Wl,--as-needed -Wl,-O2 -Wno-error=implicit-function-declaration"
CXXFLAGS="-O2 -pipe -march=native -mtune=native -Wformat -Wformat-security -O2 -g2 -ggdb2 -fno-omit-frame-pointer -Wl,-O1 -Wl,--as-needed -Wl,-O2 -Wno-error=implicit-function-declaration"
Comment 1 Andreas K. Hüttel archtester gentoo-dev 2017-12-02 17:45:22 UTC
This makes no sense, since the *code* changes with -O0... you end up debugging something different...