diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index 462dd4a226..a2b2c66a86 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -4299,7 +4299,7 @@ IssuePendingWritebacks(WritebackContext *context)
  * For best performance, keep the tests that are fastest and/or most likely to
  * exclude a page from old snapshot testing near the front.
  */
-extern void
+void
 TestForOldSnapshot(Snapshot snapshot, Relation relation, Page page)
 {
 	Assert(relation != NULL);
diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h
index afd8a847ef..86040610e7 100644
--- a/src/include/storage/bufmgr.h
+++ b/src/include/storage/bufmgr.h
@@ -252,6 +252,15 @@ extern void FreeAccessStrategy(BufferAccessStrategy strategy);
 
 /* inline functions */
 
+/*
+ * Although this header file is nominally backend-only, certain frontend
+ * programs like pg_xlogdump include it.  For compilers that emit static
+ * inline functions even when they're unused, that leads to unsatisfied
+ * external references; hence hide these with #ifndef FRONTEND.
+ */
+
+#ifndef FRONTEND
+
 /*
  * BufferGetPage
  *		Returns the page associated with a buffer.
@@ -272,4 +281,6 @@ BufferGetPage(Buffer buffer, Snapshot snapshot, Relation relation,
 	return page;
 }
 
-#endif
+#endif   /* FRONTEND */
+
+#endif   /* BUFMGR_H */