Only specify -no-undefined on mingw It turns out that commit 3cbca8661f broke building with shared libraries on OSX. Since -no-undefined is only necessary on platforms like win32, only use it there. There may be a better fix for this. Should fix bug 2997775.