First of all, if checklib signals an error on one of your binary packages, DON'T PANIC. Read this text and please, pretty please, don't take it personal.
Also note that, while the problem finally manifests itself in your binary package, it doesn't always stem from (or can be fixed in) your source packge. It's pretty common that the problems come from buggy .pc or .la files in libraries you use.
"Notices" and "Problems" come from superfluous libraries passed on the linker commandline. Those libraries are not needed and can translate to unnecessary inter-package dependencies on the respective library packages.
As stated on the frontpage, problems and notices both stem from that issue, the only difference is that in case of a notice no additional dependencies resulted, while in case of a problem additional dependencies were caused.
Because unnecessary dependencies make library transitions more cumbersome then they need to be. This not only means more work for the release team, but also for you, since you'll have to update your package for transitions that shouldn't affect you in the first place.
Also, if you don't start fixing these problems, I'll start killing kittens.
Notices don't signal extra dependencies, so they aren't as bad as "problems". But notices still indicate superfluous libraries on the linker commandline. So?
All those libraries you specify there will be loaded by the dynamic linker when your program starts up (hint: this takes time and eats up some memory), and it will be searched when the dynamic linker needs to resolve a symbol (hint: takes time too).
So superfluous libraries make your program slower and more bloated then it needs to be. However it's not that bad normally. If you have time and passion, fix them, but they aren't as bad (by far) as checklib problems.
Elfutils has some notices, and I care about that package, so we'll look:
The following issues were found:
================================
/usr/bin/eu-readelf:
* Notice: Unnecessary NEEDED entry 'libdl.so.2',
probably for '/lib/libdl.so.2' in pkg 'libc6'. No extra dependencies caused.
/usr/bin/eu-nm:
* Notice: Unnecessary NEEDED entry 'libdl.so.2',
probably for '/lib/libdl.so.2' in pkg 'libc6'. No extra dependencies caused.
/usr/bin/eu-strip:
* Notice: Unnecessary NEEDED entry 'libdl.so.2',
probably for '/lib/libdl.so.2' in pkg 'libc6'. No extra dependencies caused.
RESULT: NOTICE, issues described above
So, eu-readelf, eu-nm and eu-strip seem to be guilty. Those 3 are built from the src/ subdirectory, so we'll look at src/Makefile.am (yes, elfutils uses automake). There we find:
readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl strip_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
Ho hum. *_LDADD is the automake way to add libraries to the linker commandline. You probably notice that -ldl there, which tells gcc (ld actually) that the binary feels a bit lonesome, and wants to have libdl loaded before it starts up.
Since ld doesn't actually have anything to do with starting the program, it just puts that information into the ELF file it creates (in form of those NEEDED entries I keep talking about), for the dynamic linker to use when starting up the program.
So, to fix the issue for elfutils, we just remove those 3 -ldl, re-automake-ify elfutils, and rebuild it. Whee!
$ readelf -d eu-strip | grep NEEDED 0x00000001 (NEEDED) Shared library: [libelf.so.1] 0x00000001 (NEEDED) Shared library: [libdl.so.2] 0x00000001 (NEEDED) Shared library: [libc.so.6]
The NEEDED entry for libdl.so.2 is still there. fsck. After some more poking around in src/Makefile.am it becomes obvious that the $(libdw) variable pulls in -ldl too:
if BUILD_STATIC libdw = $(libelf) ../libdw/libdw.a $(libebl) ../libdw/libdw.a -ldl libelf = ../libelf/libelf.a else libdw = $(libelf) ../libdw/libdw.a $(libebl) ../libdw/libdw.a -ldl libelf = ../libelf/libelf.so endif
After fixing that, autoreconf'ing and rebuilding the libdl.so.2 NEEDED entry is gone:
$ readelf -d eu-strip | grep NEEDED 0x00000001 (NEEDED) Shared library: [libelf.so.1] 0x00000001 (NEEDED) Shared library: [libc.so.6]
Since the library was given manually on the linker commandline, this could be fixed pretty easily. Usually you just have to look for -l<libname> or /usr/lib/lib<libname>.so on the linker commandline and remove them.
The nice thing is, if you get it wrong, the linking step will fail (well, actually that's only true if you're building a binary, not a library). So if it still builds, you didn't break anything (unless in cases I can't think of, but which will eventually happen and someone will want to hit me for it then).
... is when you don't specify the library on the ld cmdline directly, but when you're using libtool or pkgconfig and the lib gets pulled in automatically by one of those.
In this case you should look through the .pc/.la files you use and find out where the superfluous libraries are coming from, and fix the problem there (i.e. in the -dev package). That may be a bit troublesome though, since other packages could rely on the libraries pulled in via those files, thus they would FTBFS after such a change.
For this reason such changes may need a bit of coordination first, depending on the library package and its reverse dependencies.
If you have any question about problems or fixing them don't hesitate to contact me