Backport upstream commit 85287081c4a25785dec1ec48c488a5879b3c37ac which is required for building newer versions of hare. ok bcallah@