Re-introduce glue layer closure building error.

This reverts part of b15ffe2, and fixes 'fail_compilation/fail10666'.