]> granicus.if.org Git - sysstat/commit
Don't link sysstat's commands with sensors library if not needed.
authorSebastien Godard <sysstat@orange.fr>
Sun, 6 Mar 2011 19:19:51 +0000 (20:19 +0100)
committerSebastien Godard <sysstat@orange.fr>
Sun, 6 Mar 2011 19:19:51 +0000 (20:19 +0100)
commitb6d1f73859ec1fef3bf89d4bf5893aa2aaf11e10
tree66540e93641298659e3162075563e9830673a1b6
parent497fc3519799aa8813f184c4e3c3ec271e981574
Don't link sysstat's commands with sensors library if not needed.

Sebastien,

I'm forwarding a bug report I've got today. The submitter is right. The
only binary that actually needs sensors is sadc. but all the remaining
binaries are linked with the  library, and it's not easy to change it.

I was trying to find some way to fix the issue e.g. by using the
--as-needed linker option, but this doesn't worked well (even after
changing ordering of linking). Finally I've came up with an idea of
splitting rd_stats.c into two parts - one that requires sensors and the
other one that doesn't.

I'm attaching some proof of concept patch just to show the idea. It uses
preprocessor macro to compile a tiny version of rd_stats.c that is than
linked with all binaries except for sadc. I don't think the patch is
ready to be applied b you as is. It would be much better to manually
split the rd_stats.c file into two parts, and than make configure not to
add -lsensors to CFLAGS, but put -lsensors in some autoconf variable
that would be added to sadc's LFLAGS. Could you please look at it and
possbly make an appropriate changes for the next version of sysstat?

Thanks,
robert

------ Wiadomosc oryginalna ------
Temat: Bug#612571: sysstat: iostat links libsensors4 with no need
Odeslano-Data: Wed, 09 Feb 2011 09:18:01 +0000, Wed, 09 Feb 2011
09:18:04 +0000
Odeslano-Od: Mario 'BitKoenig' Holbe <Mario.Holbe@TU-Ilmenau.DE>
Odeslano-Do: debian-bugs-dist@lists.debian.org
Odeslano-Kopia: Robert Luberda <robert@debian.org>
Data: Wed, 9 Feb 2011 10:15:31 +0100
Nadawca: Mario 'BitKoenig' Holbe <Mario.Holbe@TU-Ilmenau.DE>
Odpowiedz-Do: Mario 'BitKoenig' Holbe <Mario.Holbe@TU-Ilmenau.DE>,
612571@bugs.debian.org
Adresat: submit@bugs.debian.org

Package: sysstat
Version: 9.1.7-2

Hello,

iostat from sysstat 9.1.7-2 links /usr/lib/libsensors.so.4.
The manual page doesn't reveal any new functions that could explain this
and according to ldd libsensors isn't used:

$ ldd -u /usr/bin/iostat
Unused direct dependencies:

        /usr/lib/libsensors.so.4

regards
   Mario
CHANGES
Makefile.in
activity.c
configure
configure.in
rd_sensors.c [new file with mode: 0644]
rd_sensors.h [new file with mode: 0644]
rd_stats.c
rd_stats.h
sa.h
sa_wrap.c