An ugly work-around: "-O1" seems to overcome the messy macro expansion of stpncpy.
So either compile everything with CFLAGS="-g -O1", Or compile everything with "-g -O0" until it fails, then compile two problematic objects with "-O1" and continue, Or just compile the program of interest and ignore the rest. Not ideal, but since my goal was to debug "rm", it suffices. A better solution could be to modify the code and override the definition of stpncpy (but I'm not meddling with gnulib). For completeness, the following works: $ ./configure CFLAGS="-g -O0" $ make ## will fail with unresolved "__strpncpy_chk" # Compile two objects with "-O1" $ rm -f src/ls.o src/src_ginstall-install.o $ make CFLAGS="-g -O1" src/ls.o src/src_ginstall-install.o # Compile the rest with "-O0" $ make