Fix #8200 (and reopen #8156)

As suggested my @nolta.  This seems to fix the build problems in #8200 for me.

Cc: @JeffBezanson