Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I noticed during code review of openzfs#4385 that the author had peppered the various Makefile.am files with $(TIRPC_LIBS) when putting it into lib/libspl/Makefile.am would have sufficed. Upon further examination, it seems that he had copied what we do with $(ZLIB), which unfortunately is wrong because it is only needed in the Makefile.am corresponding to libzpool. Autoconf is designed to propagate link dependencies to the binary into which the static object is incorporated and the ELF interpreter will load it for that binary without a problem. If we specify it multiple times, we end up with the situation where unless `LDFLAGS` contains `-Wl,--as-needed`, the ELF interpreter is told to load the same library multiple times, which is serves to load down ELF intialization at best and will lead to unnecessary libraries being loaded at worst. The worst case scenario does not happen with zlib because even with -Wl,--as-needed, it is loaded anyway for libuutil. However, we should clean this up to provide a better example of how the code should be written to future contributors. Otherwise, they will be inclined to make the same mistake (for consistency) and we will end up loading libraries that we do not need. Signed-off-by: Richard Yao <[email protected]>
- Loading branch information