fix PR 15821, port from fix for PR 14779, add test for PPC32/64-darwin