Patch for automake plugin to compile again

Andreas Pakulat apaku at gmx.de
Fri Mar 4 10:30:05 UTC 2011


On 04.03.11 10:49:36, Milian Wolff wrote:
> Lambert CLARA, 04.03.2011:
> > Hi all,
> > 
> > I've stumbled across a build error when I tried to compile the automake
> > plugin from playground.
> > 
> > It fails when linking lib/libkdevautomakeparser.a(makefileinterface.o) :
> > > relocation R_X86_64_32 against `MakefileInterface::staticMetaObject' can
> > > not be used when making a shared object; recompile with -fPIC
> > 
> > It seems that it was trying to link a static library to a dynamic one.
> 
> is this not allowed?

It is allowed, but only under some circuumstances (need to compile the
static lib with -fPIC which IIRC is not supported on all *nix platforms
that distro's build packages for) and it has one major problem: Not all
symbols of the static library will end up in the shared one. Only those
used by code in the shared library, anything else will be dropped.

> > Attached is a patch that fixes the compilation of the plugin and its unit
> > tests. I also increased the X-KDevelop-Version to 12.
> 
> practically I'm fine with it, if it fixes a problem. I wouldn't have guessed 
> this would be a problem though (not that I wrote that code).
> 
> anyways, if noone objects it can be merged.

The alternative would be another private shared lib like cmake has.
Downside being that distro packagers will yell again at you :)

Andreas





More information about the KDevelop-devel mailing list