I announced my intention to retire the polymake package on the Fedora developers list. Kevin Kofler remarked that pointers to Perl_ck_fun can be found in PL_check array, and that the body of Perl_save_pushptrptr can be copied verbatim into the polymake code. That got me wondering how many more such tricks could be found. Starting with Kevin's ideas, I came up with this patch:
https://jjames.fedorapeople.org/polymak ... 5.38.patch. It is not complete. Polymake can be compiled and linked successfully, but there is a heap corruption issue. Just running "polymake --reconfigure" only works about 1 out of 8 tries, otherwise polymake segfaults. I can see that an SV on the free list (PL_sv_root) has a bad "next" pointer (sv_any). Once that SV is popped off of the free list, the root pointer is bad, leading to the segfault. I haven't yet figured out how that happens.
One disadvantage of this approach is that the code in lib/core/src/perl/perl.cc was copied from the perl 5.38.0 release. It carries the license notice of other perl code. That code would have to be compared with upstream perl code on every subsequent polymake release.
I was careful to wrap changes in #if PerlVersion >= 5380 ... #endif, even when the code in question should work for earlier perl versions. Most changes should be fairly obvious, but the intercept_pp_anoncode change is due to the change described here:
https://perldoc.perl.org/perl5380delta# ... hancements.
Does this approach interest you at all?