I got this when compiling the latest Fedora source RPM (7.5.1-32). My default CFLAGS is -O3 instead of the default -O2: In function 'strncat', inlined from 'svr4_create_solib_event_breakpoints' at ../../gdb/solib-svr4.c:2076: /usr/include/bits/string3.h:152: error: call to __builtin___strncat_chk might overflow destination buffer this correctly fails the build. The fix was simple, as the correct use of strncat for the same data is one line below: if (with_prefix) strncat (name, "rtld_", sizeof (name)); strncat (name, probe_info[i].name, sizeof (name) - sizeof ("rtld_")); becomes if (with_prefix) strncat (name, "rtld_", sizeof (name) - sizeof("rtld_")); strncat (name, probe_info[i].name, sizeof (name) - sizeof ("rtld_")); and this eliminates the warning/error.
Thanks for the report, but this bug has to be opened against Fedora's GDB. Closing as INVALID. I have contacted the reporter and asked him to do so.
I filed this as https://bugzilla.redhat.com/show_bug.cgi?id=895527