I was looking through the diffs between GCC 8.1.0 and GCC 8.2.0 and saw this change, which doesn't look right to me: it changes munmap() to use the new static_pagesize variable, but that variable is not assigned until after it's used. Since it's global it's always 0, so this code runs munmap(0, 0) which doesn't seem too useful to me.
I checked and the current SVN trunk still has this change as-is. @@ -825,7 +811,12 @@ TLS accessor function is resolved. */ mmap (__morestack_current_segment, 0, PROT_READ, MAP_ANONYMOUS, -1, 0); mprotect (NULL, 0, 0); - munmap (0, getpagesize ()); + munmap (0, static_pagesize); + + /* Initialize these values here, so as to avoid dynamic linker + activity as part of a __morestack call. */ + static_pagesize = getpagesize(); + use_guard_page = getenv ("SPLIT_STACK_GUARD") != 0; } /* This function may be used to iterate over the stack segments.