[libvirt] Linking fails on FreeBSD

Roman Bogorodskiy bogorodskiy at gmail.com
Mon Jul 29 13:23:40 UTC 2013


  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!

-- 
> |: 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 :|

Roman Bogorodskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130729/8a4bbb89/attachment-0001.sig>


More information about the libvir-list mailing list