mac compatible libc lookup in tests

see comments in 0ed0558a
Merge remote-tracking branch 'upstream/master' into mchedr