net-misc/curl-7.21.7-r2 does not respect all aspects of the CFLAGS setting from make.conf. In particular, debug flags like -ggdb get stripped when using gcc, and will be replaced with -g0, thereby disabling debug symbol generation. The ebuild does apply a patch called curl-respect-cflags-2.patch, but that patch apparently only applies to the ibm c compiler. There is also an older curl-respect-cflags.patch, but that isn't applied at all any more.
Created attachment 283645 [details, diff] Proposed ebuild modification This replaces the patches with a sed script doing the same in a single line.
As an alternative, one could remove the calls to CURL_SET_COMPILER_DEBUG_OPTS and CURL_SET_COMPILER_OPTIMIZE_OPTS from configure.ac using a patch.
thanks, fixed. the -2 patch was needed because of syntax changes in that file, obviously I broke it