The fix from JDK-8246112 breaks the build with old (but according to comments still supported) glibc versions, when ld defaults to the --as-needed behavior.
The reason for that is the passing of a library (-lrt) in a LDFLAGS macro, not in a LIBS macro.
A quick workaround is
--- a/make/autoconf/flags-ldflags.m4
+++ b/make/autoconf/flags-ldflags.m4
@@ -113,7 +113,7 @@
# But once our supported minimum build and runtime platform
# has glibc 2.17, this can be removed as the functions are
# in libc.
- OS_LDFLAGS_JVM_ONLY="-lrt"
+ OS_LDFLAGS_JVM_ONLY="-Wl,--no-as-needed -lrt"
fi
fi
So -lrt should be passed in the macros which are used to pass -ldl -lpthread ...