patch to fix freebsd build