These patches are necessary to fix https://bugs.ruby-lang.org/issues/17725 which is unreleased. This is currently breaking our Ruby 3 build, so until 3.0.3 is out let's apply these independently.