madler/zlib — pull request #26 by willglynn (2012-11-13 18:52:50+00:00)
Title: Mac OS X does not support --version-script

Mac OS X's linker is derived from LLVM, not GNU binutils, and it does not support `--version-script`.

This commit disables that option for `APPLE`. There are some possible problems with this:

* It might be too broad, since I understand CMake sets `APPLE` for all versions of Mac OS. I have no idea what toolchains exist on Mac OS 9 or earlier, so I have no way of knowing if this is correct.
* Without `--version-script`, there's nothing to restrict which symbols are visible in the resulting libraries.

I don't know if either of these are important. That said, I *do* know that Mac OS X is broken with both the current release and the current master:

Linking C shared library libz.dylib
ld: unknown option: --version-script
collect2: ld returned 1 exit status
make[2]: *** [libz.1.2.7.dylib] Error 1
make[1]: *** [CMakeFiles/zlib.dir/all] Error 2

It builds with this change.