Current-Users archive

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

Re: Shlib major bumps and UPDATE builds

In article <>,
Havard Eidnes  <> wrote:
>maybe my build host is too slow, but I continue to do UPDATE
>builds of NetBSD-current.  This flagged a problem when Christos
>recently bumped the major version of a number of our shared
>libraries.  In short, some applications ended up linking the old
>version of the shared libraries, resulting in warnings which are
>transformed into errors by the use of -Werror for our in-tree
>Some digging with "readelf -d" revealed that some of the shared
>libraries the application linked with had a NEEDED attribute
>which pointed to a shared library with a now old major number.
>I've finally found out what causes this, and it is the way we
>link our shared libraries.  As an example I use lib/libdns, where
>a MAKEVERBOSE=2 build resulted in:
>/u/build/HEAD/tools/sgimips/bin/mipseb--netbsd-gcc  -Wl,-nostdlib
>  -L/u/build/HEAD/dest/sgimips/lib  -Wl,-x -shared
>-Wl,-soname, -Wl,--warn-shared-textrel -o 
>-Wl,--whole-archive libdns.a  -Wl,--no-whole-archive 
>-L/u/build/HEAD/obj/sgimips/lib/libpthread -lpthread
>-L/u/build/HEAD/obj/sgimips/lib/libcrypto -lcrypto  -Wl,--fatal-warnings
>You will note that -L${DESTDIR}/usr/lib and -L${DESTDIR}/lib
>comes before the shared libraries it wants to use, and even
>though care is taken to point to the OBJDIRS of those shared
>libraries, the previous -L.../usr/lib and -L.../lib will override
>those directories if the shared library is already installed in
>DESTDIR, as it typically will be with an UPDATE build.
>So... Because the shared libraries with the new major numbers
>have not been installed at this point in the build process
>(typically the "build all the libraries" phase), the shared
>library linking command above will pick up the shared libraries
>with the old major numbers from DESTDIR, causing conflicts/errors
>when applications are linked later on (I saw it with
>external/bsd/am-utils in my builds).
>In my case, I also wanted to easily trigger a rebuild of my
>shared libraries (without cleaning them...) so I ended up with
>the following local patch in my file:

Good catch! I saw that too. Luke is the person to ask if your change
is correct.


Home | Main Index | Thread Index | Old Index