gcc: fix linker errors on osx with gcc 4.4+