From 458ca332d104240e7752eb1765660141fef878bd Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 4 Apr 2020 13:45:45 -0700 Subject: [PATCH] libgcc: only use __mmap if glibc >- 2.26 * generic-morestack.c: Only use __mmap on glibc >= 2.26. --- libgcc/ChangeLog | 4 ++++ libgcc/generic-morestack.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 66e57ece69c..ec225d1cb5a 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,7 @@ +2020-04-04 Ian Lance Taylor + + * generic-morestack.c: Only use __mmap on glibc >= 2.26. + 2020-04-03 Ian Lance Taylor * generic-morestack.c: On GNU/Linux use __mmap/__munmap rather diff --git a/libgcc/generic-morestack.c b/libgcc/generic-morestack.c index bb9f67a7366..fa2062e2bb3 100644 --- a/libgcc/generic-morestack.c +++ b/libgcc/generic-morestack.c @@ -60,7 +60,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see glibc on GNU/Linux we can avoid the problem by calling __mmap and __munmap. */ -#ifdef __gnu_linux__ +#if defined(__gnu_linux__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 26)) extern void *__mmap (void *, size_t, int, int, int, off_t); extern int __munmap (void *, size_t);