rBb9c37608a9e959a896f5358d4ab3d3d001a70833 moved evaluation of versions.cmake before options.cmake, as a result of which BLENDER_PLATFORM_ARM is no longer defined in versions.cmake, causing it to choose the wrong OpenSSL version for aarch64, which fails to build.
Also, probably doesn't warrant changing, but building flex is crashing the GCC version shipped with Ubuntu 18.04, which was fixed by a later commit (https://github.com/westes/flex/commit/24fd0551333e7eded87b64dd36062da3df2f6380) that is not part of the flex release used. Included that commit as a patch to make it work, but since that GCC version is technically below the minimum supported by Blender at this point, I'm fine with leaving it out too.