Index: common/debug.h
===================================================================
--- common.orig/debug.h	2015-07-09 17:38:06.000000000 +0200
+++ common/debug.h	2016-06-29 12:35:42.000000000 +0200
@@ -124,7 +124,7 @@
 #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_debugging
Index: p11-kit/modules.c
===================================================================
--- p11-kit.orig/modules.c	2015-10-21 08:20:53.000000000 +0200
+++ p11-kit/modules.c	2016-06-29 12:36:19.000000000 +0200
@@ -1807,7 +1807,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;
 	}
@@ -2597,7 +2597,7 @@
 
 		p11_message_clear ();
 
-		release_module_inlock_rentrant (module, __PRETTY_FUNCTION__);
+		release_module_inlock_rentrant (module, __FUNCTION__);
 
 	p11_unlock ();
 
@@ -2607,7 +2607,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__);
 }
 
 /**
Index: common/compat.c 
===================================================================
--- common.orig/compat.c    2015-10-19 11:32:31.000000000 +0200
+++ common/compat.c   2016-06-30 17:00:31.000000000 +0200
@@ -114,7 +114,13 @@
 #elif defined (HAVE___PROGNAME)
 	name = __progname;
 #else
+#ifdef _AIX
+#define DEF_NAME "progname-test"
+	name = (char *) malloc(sizeof(DEF_NAME)+1);
+	strcpy( name, DEF_NAME);
+#else
 	#error No way to retrieve short program name
+#endif
 #endif

 	return name;
