Index: gcc/c-family/c-common.cc
--- gcc/c-family/c-common.cc.orig
+++ gcc/c-family/c-common.cc
@@ -726,7 +726,7 @@ finish_fname_decls (void)
 /* Return the text name of the current function, suitably prettified
    by PRETTY_P.  Return string must be freed by caller.  */
 
-const char *
+extern "C" const char *
 fname_as_string (int pretty_p)
 {
   const char *name = "top level";
