On OS X at least, it will think the link itself is the executable, then calculate sysroot based on that. Thanks to kyle for the report.