[MacPorts] #59436: libxml2 @2.9.9: libxml2-config.cmake LIBXML2_LIBRARIES includes libxml2's dependencies, which results in overlinking

MacPorts noreply at macports.org
Tue Oct 22 14:45:17 UTC 2019


#59436: libxml2 @2.9.9: libxml2-config.cmake LIBXML2_LIBRARIES includes libxml2's
dependencies, which results in overlinking
------------------------+---------------------
 Reporter:  ryandesign  |      Owner:  (none)
     Type:  defect      |     Status:  new
 Priority:  Normal      |  Milestone:
Component:  ports       |    Version:  2.6.2
 Keywords:              |       Port:  libxml2
------------------------+---------------------
 libxml2 installs /opt/local/lib/cmake/libxml2/libxml2-config.cmake which
 contains:

 {{{
 list(APPEND LIBXML2_LIBRARIES -L/opt/local/lib -licui18n -licuuc -licudata
 -liconv -lm  )
 }}}

 This causes software that uses cmake to find libxml2 to overlink to
 libraries that aren't needed—when building dynamically-linked software.

 `/opt/local/bin/xml2-config --libs` also produces output that results in
 overlinking, but this cannot be avoided, since xml2-config does not
 distinguish between the use case of static linking (where these extra
 libraries are needed) and dynamic linking (where they are not). `pkg-
 config libxml-2.0 --libs` is a better way for programs to discover the
 libraries for dynamic linking.

 I don't know how software that uses cmake to find libxml2 uses
 LIBXML2_LIBRARIES—I don't know if it could be used for static linking or
 if it is only used for dynamic linking. If it could be used for static
 linking, then that sucks and we can't change this.

-- 
Ticket URL: <https://trac.macports.org/ticket/59436>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list