[libvirt] Linking fails on FreeBSD

Daniel P. Berrange berrange at redhat.com
Mon Jul 29 13:33:07 UTC 2013


On Mon, Jul 29, 2013 at 05:23:40PM +0400, Roman Bogorodskiy wrote:
>   Daniel P. Berrange wrote:
> 
> > On Mon, Jul 29, 2013 at 10:30:15AM +0400, Roman Bogorodskiy wrote:
> > > Hi,
> > > 
> > > Linking fails on FreeBSD:
> > > 
> > >   CCLD     libvirt.la
> > >   /usr/bin/ld: ./.libs/libvirt_util.a(libvirt_util_la-vircgroup.o):
> > >   relocation R_X86_64_PC32 against `virCgroupPartitionEscape' can not be
> > >   used when making a shared object; recompile with -fPIC
> > >   /usr/bin/ld: final link failed: Bad value
> > > 
> > > Following the suggestion and re-compiling with -fPIC doesn't help.
> > > Anybody has an idea how to fix that?
> > 
> > Try building with thsi patch
> > 
> > diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
> > index 68ec953..62b1b1e 100644
> > --- a/src/util/vircgroup.c
> > +++ b/src/util/vircgroup.c
> > @@ -95,6 +95,7 @@ bool virCgroupAvailable(void)
> >      return ret;
> >  }
> >  
> > +#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
> >  static bool
> >  virCgroupValidateMachineGroup(virCgroupPtr group,
> >                                const char *name,
> > @@ -149,7 +150,16 @@ virCgroupValidateMachineGroup(virCgroupPtr group,
> >      VIR_FREE(partname);
> >      return valid;
> >  }
> > -
> > +#else
> > +static bool
> > +virCgroupValidateMachineGroup(virCgroupPtr group ATTRIBUTE_UNUSED,
> > +                              const char *name ATTRIBUTE_UNUSED,
> > +                              const char *drivername ATTRIBUTE_UNUSED,
> > +                              bool stripEmulatorSuffix ATTRIBUTE_UNUSED)
> > +{
> > +    return true;
> > +}
> > +#endif
> >  
> >  /**
> >   * virCgroupFree:
> 
> Yes, it works, thanks!

Ok, I'll push this shortly.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list