--- ./common/debug.h.orig	2021-04-30 10:27:15 +0000
+++ ./common/debug.h	2021-04-30 10:28:31 +0000
@@ -129,13 +129,13 @@
 #undef p11_debug
 #define p11_debug(format, ...) do { \
 	if (P11_DEBUG_FLAG & p11_debug_current_flags) \
-		p11_debug_message (P11_DEBUG_FLAG, "%s: " format, __PRETTY_FUNCTION__, ##__VA_ARGS__); \
+		p11_debug_message (P11_DEBUG_FLAG, "%s: " format, __FUNCTION__, ##__VA_ARGS__); \
 	} while (0)
 
 #undef p11_debug_err
 #define p11_debug_err(errnum, format, ...) do {	      \
 	if (P11_DEBUG_FLAG & p11_debug_current_flags) \
-		p11_debug_message_err (P11_DEBUG_FLAG, errnum, "%s: " format, __PRETTY_FUNCTION__, ##__VA_ARGS__); \
+		p11_debug_message_err (P11_DEBUG_FLAG, errnum, "%s: " format, __FUNCTION__, ##__VA_ARGS__); \
 	} while (0)
 
 #undef p11_debugging
--- ./p11-kit/client-init.c.orig	2021-04-30 10:31:38 +0000
+++ ./p11-kit/client-init.c	2021-04-30 10:33:09 +0000
@@ -40,6 +40,8 @@
 #include "client.h"
 #include "pkcs11.h"
 
+#include <stdbool.h>
+
 /* p11_proxy_module_check() is defined as a weak symbol in modules.c */
 #ifndef __GNUC__
 bool       p11_proxy_module_check                    (CK_FUNCTION_LIST_PTR module);
--- ./p11-kit/modules.c.orig	2021-04-30 10:33:52 +0000
+++ ./p11-kit/modules.c	2021-04-30 10:37:02 +0000
@@ -1891,7 +1891,7 @@
 	int i;
 
 	for (i = 0; modules[i] != NULL; i++) {
-		rv = release_module_inlock_rentrant (modules[i], __PRETTY_FUNCTION__);
+		rv = release_module_inlock_rentrant (modules[i], __FUNCTION__);
 		if (rv != CKR_OK)
 			ret = rv;
 	}
@@ -2704,7 +2704,7 @@
 
 		p11_message_clear ();
 
-		release_module_inlock_rentrant (module, __PRETTY_FUNCTION__);
+		release_module_inlock_rentrant (module, __FUNCTION__);
 
 	p11_unlock ();
 
@@ -2714,7 +2714,7 @@
 CK_RV
 p11_module_release_inlock_reentrant (CK_FUNCTION_LIST *module)
 {
-	return release_module_inlock_rentrant (module, __PRETTY_FUNCTION__);
+	return release_module_inlock_rentrant (module, __FUNCTION__);
 }
 
 /**
--- ./common/compat.c.orig	2021-04-30 10:40:23 +0000
+++ ./common/compat.c	2021-04-30 10:41:17 +0000
@@ -120,8 +120,14 @@
 #elif defined (HAVE___PROGNAME)
 	name = __progname;
 #else
+#ifdef _AIX
+#define DEF_NAME "p11-kit" /* name is p11-kit, not progname_test */
+       name = (char *) malloc(sizeof(DEF_NAME)+1); /* argv[0] is undeclared */
+       strcpy( name, DEF_NAME);
+#else
 	#error No way to retrieve short program name
 #endif
+#endif
 
 	return name;
 }
