Backport !3976 - Simplify the build of static binaries
Context
Changes in !3976 (merged) touch src/proto_alpha and we need them in snapshotted Protocol I. Cherry-picked all commits from it using the following commands.
$ git checkout -b proto-i-backport-3976
$ git cherry-pick 1e34e499d079d7edb003ff593d1337bb034b7ab8^..2a9e1e8fc7a423384cd08e9604e946c0cf9612a4
Manually testing the MR
Check CI.
Edited by Fedor Sheremetyev