Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions nix/ext/patches/supautils-strtol-glibc-compat.patch
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,31 @@ index 18e5aee..cdfb63f 100644
+
static JSON_ACTION_RETURN_TYPE json_array_start(void *state) {
json_constrained_extension_parse_state *parse = state;

diff --git a/src/extension_custom_scripts.c b/src/extension_custom_scripts.c
index 337bd69..3f285cc 100644
--- a/src/extension_custom_scripts.c
+++ b/src/extension_custom_scripts.c
@@ -2,6 +2,22 @@
#include <errno.h>
#include <sys/stat.h>

+#if defined(__linux__) && defined(__GLIBC__) && (defined(__x86_64__) || defined(__aarch64__))
+# if defined(__x86_64__)
+# define SUPAUTILS_STAT_COMPAT_VER "GLIBC_2.2.5"
+# define SUPAUTILS_STAT_VER 1
+# else
+# define SUPAUTILS_STAT_COMPAT_VER "GLIBC_2.17"
+# define SUPAUTILS_STAT_VER 0
+# endif
+extern int __xstat(int ver, const char *path, struct stat *buf);
+__asm__(".symver __xstat,__xstat@" SUPAUTILS_STAT_COMPAT_VER);
+#undef stat
+#define stat(path, buf) __xstat(SUPAUTILS_STAT_VER, path, buf)
+#undef stat64
+#define stat64(path, buf) __xstat(SUPAUTILS_STAT_VER, path, buf)
+#endif
+
// Prevent recursively running custom scripts
static bool running_custom_script = false;

1 change: 1 addition & 0 deletions nix/ext/supautils.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ stdenv.mkDerivation rec {
hash = "sha256-Wsou5U7/Tuwj2E6aPEmlHg7uz7kGyBOGrb7UkjfEo9U=";
};

# remove once all Ubuntu 20.04 (glibc 2.31) hosts are decommissioned
patches = [ ./patches/supautils-strtol-glibc-compat.patch ];

installPhase = ''
Expand Down
Loading