[collectd] Re: Cross-compiling of collectd

Florian Forster octo at verplant.org
Wed Dec 14 19:07:40 CET 2005


Hello Stuart,

On Wed, Dec 14, 2005 at 12:54:05PM -0500, Stuart Nicholson wrote:
> I'm cross-compiling collectd, using an x86 for the build tools, with a
> PowerPC target.  Have you cross-compiled?  I've encountered two
> problems, one of which I've solved.

No, I myself haven't (yet), but I assume the folks who use it on
embedded systems do ;)

> Problem 1.  The modules were not finding global symbols in collectd
> (curtime, module_register, etc).  I fixed this by adding
> 'LDFLAGS="-rdynamic"' in front of ./configure, which forces ld to
> write the global symbols to the collectd executable image.  This was
> only a problem in the cross-compiling environment.  (The native
> powerpc gcc version 2.95 did not require this, nor did two different
> x86 gcc environments.)

I have to admit I don't know why this isn't set by the autotools or
libtool.. However, Niki Waibel has done many changes to the autotools
stuff and switched that dynamic library stuff to `libltdl'. Maybe this
solves that issue.. If not, let me know :)

> Problem 2.  I install the files into a "root filesystem build image" for 
> the PowerPC target (as opposed to /usr/local/lib/collectd on the x86 build 
> host.)  I do this by configuring 
> with --prefix=<path-to-root-filesystem-image>/usr/local/ and using "make 
> install".  Only problem is, collectd gets built with that path for 
> plugindir.  this can be overridden with the -P option, but it's kind of an 
> ugly solution leaving that string in the executable image and in the *.la 
> files.  Is there any way around this?  (need to install _here_, but execute 
> as if _there_)

I think what you need is the following:
1) Run the configure script with `--prefix=/usr/local'
2) Compile
3) Install using `make install DESTDIR=<path-to-root-filesystem-image>'

> Minor Problem 3.  I had to comment out line 82 in processes.c for my x86 
> build.  This line is:
> "int strsplit (char *string, char **fields, size_t size);"

Oh, that's a bug.. Why did that even compile? Well, it's fixed in the
repository.. :)

> Thanks again for a great project!  I'm off to create some modules
> specific to my platform.  I'll contribute back what's useful to
> others.

Great, I'm happy to hear that :)
Regards,
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- 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/20051214/bcd24d5f/attachment.pgp


More information about the Collectd mailing list