From a5abe5add6788f529e435af615fd092610cd7f52 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 29 Mar 2020 07:30:46 -0400 Subject: [PATCH 1/4] increase minimum dependency versions --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6b27ab9..ceec241 100644 --- a/README.md +++ b/README.md @@ -63,12 +63,12 @@ used instead as this allocator fundamentally doesn't support that environment. ## Dependencies -Debian oldstable (currently Debian 9) determines the most ancient set of +Debian stable (currently Debian 10) determines the most ancient set of supported dependencies: -* glibc 2.24 -* Linux 4.9 -* Clang 3.8 or GCC 6.3 +* glibc 2.28 +* Linux 4.19 +* Clang 7.0 or GCC 8.3.0 However, using more recent releases is highly recommended. Older versions of the dependencies may be compatible at the moment but are not tested and will From 3af44d2e6a07b0be06fc2f7674d81055d1d1606d Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 29 Mar 2020 07:31:45 -0400 Subject: [PATCH 2/4] can now depend on libc having a getrandom wrapper --- random.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/random.c b/random.c index 0b4cbdc..8883531 100644 --- a/random.c +++ b/random.c @@ -5,17 +5,7 @@ #include "random.h" #include "util.h" -#if __has_include() -// glibc 2.25 and later #include -#else -#include -#include - -static ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) { - return syscall(SYS_getrandom, buf, buflen, flags); -} -#endif static void get_random_seed(void *buf, size_t size) { while (size) { From 043622709278cab8ad486eb7177ec36615b3f3cf Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 29 Mar 2020 07:39:23 -0400 Subject: [PATCH 3/4] no longer need glibc pthread_atfork workaround --- h_malloc.c | 2 +- util.h | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/h_malloc.c b/h_malloc.c index d855e0e..998de6f 100644 --- a/h_malloc.c +++ b/h_malloc.c @@ -1156,7 +1156,7 @@ COLD static void init_slow_path(void) { mutex_unlock(&lock); // may allocate, so wait until the allocator is initialized to avoid deadlocking - if (atfork(full_lock, full_unlock, post_fork_child)) { + if (pthread_atfork(full_lock, full_unlock, post_fork_child)) { fatal_error("pthread_atfork failed"); } } diff --git a/util.h b/util.h index 5f2274a..3e07d8c 100644 --- a/util.h +++ b/util.h @@ -38,19 +38,6 @@ typedef uint32_t u32; typedef uint64_t u64; typedef unsigned __int128 u128; -// use __register_atfork directly to avoid linking with libpthread for glibc < 2.28 -#ifdef __GLIBC__ -#if !__GLIBC_PREREQ(2, 28) -extern void *__dso_handle; -extern int __register_atfork(void (*)(void), void (*)(void), void (*)(void), void *); -#define atfork(prepare, parent, child) __register_atfork(prepare, parent, child, __dso_handle) -#endif -#endif - -#ifndef atfork -#define atfork pthread_atfork -#endif - #if CONFIG_SEAL_METADATA #ifdef __GLIBC__ From 466d351e9361705e7c8a44d9395f5eca3873369b Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 29 Mar 2020 07:41:18 -0400 Subject: [PATCH 4/4] drop legacy glibc version check for pkey support --- util.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/util.h b/util.h index 3e07d8c..f22ece5 100644 --- a/util.h +++ b/util.h @@ -41,12 +41,8 @@ typedef unsigned __int128 u128; #if CONFIG_SEAL_METADATA #ifdef __GLIBC__ -#if __GLIBC_PREREQ(2, 27) #define USE_PKEY -#endif -#endif - -#ifndef USE_PKEY +#else #error "CONFIG_SEAL_METADATA requires Memory Protection Key support" #endif