tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: warning about conflicting libraries from base and pkgsrc



In article <20080403202142.GA11947%silence.homedns.org@localhost> Klaus wrote:
: Hi,

: on NetBSD 3.1 with /usr/lib/libz.so.0.4  and /usr/pkg/lib/libz.so.1.0.2
: (from zlib-1.2.3) I just saw this, building a program without pkgsrc:

:  gcc -I/usr/pkg/include -g -O2  -L/usr/pkg/lib -lcurl -L/usr/pkg/lib
:   -Wl,-R/usr/pkg/lib -lidn -lssl -lcrypto -lz -o esniper  auction.o
:   auctionfile.o  auctioninfo.o buffer.o esniper.o  history.o html.o http.o
:   options.o util.o -L/usr/pkg/lib -lcurl -L/usr/pkg/lib -Wl,-R/usr/pkg/lib
:   -lidn -lssl -lcrypto -lz 
:  ld: warning: libz.so.0, needed by /usr/pkg/lib/libcurl.so, may conflict
:   with libz.so.1
:  ld: warning: libz.so.0, needed by /usr/pkg/lib/libcurl.so, may conflict
:   with libz.so.1


: The resulting binary includes this information

:   $ objdump -x esniper
:   ...
:   Dynamic Section:
:     NEEDED      libcurl.so.4
:     NEEDED      libidn.so.11
:     NEEDED      libssl.so.3
:     NEEDED      libcrypto.so.2
:     NEEDED      libz.so.1
:     NEEDED      libc.so.12
:     RPATH       /usr/pkg/lib

: NOTE: take a look at the version of libz.

:   $ ldd esniper
:   esniper:
:         -lintl.0 => /usr/lib/libintl.so.0
:         -lidn.11 => /usr/pkg/lib/libidn.so.11
:         -lcrypt.0 => /lib/libcrypt.so.0
:         -lcrypto.2 => /usr/lib/libcrypto.so.2
:         -lssl.3 => /usr/lib/libssl.so.3
:         -lz.0 => /usr/lib/libz.so.0
:         -lcurl.4 => /usr/pkg/lib/libcurl.so.4
:         -lz.1 => /usr/pkg/lib/libz.so.1
:         -lc.12 => /usr/lib/libc.so.12

: NOTE: two versions of libz will be used by this program.

: Building the software within the pkgsrc framework gives me this

:   $ objdump -x esniper
:   ...
:   Dynamic Section:
:     NEEDED      libcurl.so.4
:     NEEDED      libidn.so.11
:     NEEDED      libssl.so.3
:     NEEDED      libcrypto.so.2
:     NEEDED      libz.so.0
:     NEEDED      libc.so.12
:     RPATH       /usr/pkg/lib

:   $ ldd esniper
:   esniper:
:         -lintl.0 => /usr/lib/libintl.so.0
:         -lidn.11 => /usr/pkg/lib/libidn.so.11
:         -lcrypt.0 => /lib/libcrypt.so.0
:         -lcrypto.2 => /usr/lib/libcrypto.so.2
:         -lssl.3 => /usr/lib/libssl.so.3
:         -lz.0 => /usr/lib/libz.so.0
:         -lcurl.4 => /usr/pkg/lib/libcurl.so.4
:         -lc.12 => /usr/lib/libc.so.12

: Without digging further I suppose the correct result (only libz.so.0 is
: recorded in the binary) comes from using "buildlink3" in pkgsrc.

  That would be my guess, too.

: However, I am curious how to avoid the warning when not using pkgsrc. I
: suppose there _are_ people who build software now and then without pkgsrc.

  What does the following command produce (add /usr/lib to the front
of the link-time library search path)?

$ gcc -I/usr/pkg/include -g -O2 -L/usr/lib -L/usr/pkg/lib -lcurl -L/usr/pkg/lib
   -Wl,-R/usr/pkg/lib -lidn -lssl -lcrypto -lz -o esniper  auction.o

                                           yours,
                                           dillo


Home | Main Index | Thread Index | Old Index