You're using /usr/bin/ld... this implies you haven't installed the ld64
port which would provide /opt/local/bin/ld which would have been used
instead and which would have understood the `-compatibility_version` flag.
This implies you are using the apple-gcc42 port with its +bootstrap
variant, since if you were not, ld64 would have been a dependency of it.
So the solution is to reinstall apple-gcc42 without the +bootstrap
variant. When you originally installed the apple-gcc42 port with the
+bootstrap variant, it should have printed a note telling you to do that,
but I know it's easy to overlook those notes, especially if many other
ports' notes were printed at the same time.