#39485: Portfile for megatools ---------------------------+-------------------------------- Reporter: s.cloherty@… | Owner: macports-tickets@… Type: submission | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: | ---------------------------+-------------------------------- Comment (by larryv@…): Replying to [comment:13 egall@…]:
I thought if `otool -L` said that a library is linked against, that that means that it uses symbols from that library though? Is that not actually the case?
No, a binary can link against a library without actually using any of that library’s symbols. That’s what the whole [http://thread.gmane.org/gmane.os.apple.macports.devel/21805/focus=21822 Libtool fiasco] was about.
Previously I've only ever seen people on here use `otool -L` to decide if a library needs to be declared as a dependency, I hadn't ever heard of this policy of also needing to check with `nm`, too...
It doesn’t matter which tools you use; the salient question is whether the library in question is required or not. If a dependency is determined to actually be unused, it should be removed. End of story. Conversely, if a dependency is required, it should be declared directly by the port and not brought in indirectly through other dependencies. Sane builds won’t link libraries that the software in question does not need, so `otool(1)` usually suffices. But not all builds are sane. If there’s any doubt, use `nm(1)`; it requires a little more work but can provide a more accurate picture. -- Ticket URL: <https://trac.macports.org/ticket/39485#comment:14> MacPorts <http://www.macports.org/> Ports system for OS X