[collectd] Static Build

Sebastian Harl sh at tokkee.org
Tue Jun 17 22:48:04 CEST 2008


Hi,

On Tue, Jun 17, 2008 at 08:46:50PM +0200, Sebastian Harl wrote:
> On Fri, Jun 13, 2008 at 08:33:29AM -0700, Jesse Dutton wrote:
> > On Fri, Jun 13, 2008 at 1:50 AM, Sebastian Harl <sh at tokkee.org> wrote:
> > > I can't think of any way to get that working with collectd unless you're
> > > using a single plugin only. All plugins are implemented as shared
> > > objects and the code heavily depends on that.
> > There are other systems that have this same problem (e.g. linux kernel
> > modules). They use a macro to expose a static module_register function
> > when the module is not built-in. In the built-in case, we could mangle
> > the function names so that they are unique, and use the HAVE_PLUGIN_X
> > #defines to call each module_register in turn during startup.
> > Thoughts?
[...]
> Anyway, I think this should be doable fairly easily using the following
> two steps:
[...]
> So, if we can use the dlsym() thingy, the whole patch should be about 20
> lines + replacing module_register with MODULE_REGISTER in all plugins...

Okay... I wanted to know if that's really gonna work, so I gave it a
quick try. I will send the patch in another E-mail in a minute. The
following plugins fail to build on my Debian Sid box after applying the
patch because of some undefined symbols when linking:

 * apache, ascent, nginx (because of some libcurl symbols)
 * notify_desktop (because of some libglib, libcairo, etc. symbols)
 * libvirt (because of some libvirt symbols)

All of the appropriate libraries are available as static libraries as
well, so I guess that this can be fixed in collectd somehow. I'm not
sure where to look at though...

I noticed that the generated collectd binary is still linked against
quite a few shared libraries. I don't know if libtool should handle all
of that or if collectd has to handle that somehow. Any pointers would be
appreciated.

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080617/b4a42703/attachment-0001.pgp 


More information about the collectd mailing list