From 5e0c5a7968a2046529ad3bcf595a3044556e03d3 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Wed, 6 Nov 2019 00:25:34 +0000 Subject: [PATCH] AIX/PASE support. Actually, just PASE. librb dies horrible flaming deaths on AIX, but bizarrely not PASE. It's like a program that only works in WSL. Go figure. To do this: - disable posix_spawn because it calls an unimplement syscall in PASE, bad juju - implement bare minimum of endianness macros, since AIX lacks though. only tested on gcc. This commit was brought to you by a *dare*. --- librb/src/crypt.c | 6 ++++++ librb/src/unix.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/librb/src/crypt.c b/librb/src/crypt.c index b2e372401..daac4508a 100644 --- a/librb/src/crypt.c +++ b/librb/src/crypt.c @@ -777,6 +777,12 @@ static void MD5Final (unsigned char [16], MD5_CTX *); * a multiple of 4. */ +#ifdef _AIX +/* AIX lacks the endian.h header, so reimplement. AIX is always BE. */ +#define htole32(x) __builtin_bswap32(x) +#define le32toh(x) __builtin_bswap32(x) +#endif + static void Encode (unsigned char *output, uint32_t *input, unsigned int len) { diff --git a/librb/src/unix.c b/librb/src/unix.c index b2b8a89bd..6af77368a 100644 --- a/librb/src/unix.c +++ b/librb/src/unix.c @@ -45,7 +45,8 @@ #include #endif -#if defined(HAVE_SPAWN_H) && defined(HAVE_POSIX_SPAWN) +/* it dies violently in PASE due to posix_spawnattr_init calling the unimplemented */ +#if defined(HAVE_SPAWN_H) && defined(HAVE_POSIX_SPAWN) && !defined(_AIX) #include #ifndef __APPLE__