program_invocation_short_name is a GNU libc extension; use __progname,
the BSD equivalent. Declare it extern as <stdlib.h> doesn't always expose it.

Index: shared/xalloc.h
--- shared/xalloc.h.orig
+++ shared/xalloc.h
@@ -36,6 +36,8 @@ extern "C" {
 #include <unistd.h>
 #include <string.h>
 
+extern char *__progname;
+
 static inline void *
 abort_oom_if_null(void *p)
 {
@@ -45,8 +47,8 @@ abort_oom_if_null(void *p)
 	if (p)
 		return p;
 
-	written = write(STDERR_FILENO, program_invocation_short_name,
-		        strlen(program_invocation_short_name));
+	written = write(STDERR_FILENO, __progname,
+		        strlen(__progname));
 	written = write(STDERR_FILENO, oommsg, strlen(oommsg));
 
 	abort();
