try adding -D_FORTIFY_SOURCE to your CFLAGS I always use some optimisation too
sry for that -U_FORTIFY_SOURCE of course not -D_FORTIFY_SOURCE
that's at least what i got from the glibc mailing-list and it worked for me.
export CFLAGS="-O2 -D_FORTIFY_SOURCE" <- Wrong
export CFLAGS="-O2 -U_FORTIFY_SOURCE" <- Right"
I'm not exactly sure what fortify does. Here's what Ubuntu says about it
First enabled in Ubuntu 8.10. Provides compile-time best-practices errors for certain libc functions, and provides run-time checks of buffer lengths and memory regions. Only activated when compiled with -O2 or higher. Most problems are related to common unsafe uses of certain libc functions.
They use D_FORTIFY_SOURCE=2 instead of only D_FORTIFY_SOURCE. I don't know if there is a big difference.