I tried locally rebuilding sagemath against GAP 4r10p2-2. It seems we need https://github.com/sagemath/sage/commit/e6e80bfa0f36688904716f93e04ad0121b7a4136.patch to account for changes to the GAP_Initialize signature from https://github.com/gap-system/gap/commit/5dad0ef01e5527d83d7ade6677891b855381aee3 and https://github.com/gap-system/gap/commit/eab71117db3a3afd1adec9a87e96b3b4a9414f60.
Unfortunately the patch doesn't apply cleanly, and I don't have time just now to massage it. So I'm sending what information I have in case someone else can cherry-pick it in. Without this, I get a SIGSEGV when loading sage.libs.gap.libgap because the address of a data structure (the old env argument) is treated as a function pointer that gets called during garbage collection. The error doesn't stop the build at that point, but it causes the documentation build to hang indefinitely eventually, similar to bug #901532. Check sage/logs/dochtml.log for the actual problem report.