提交 df94811f 编写于 作者: E Eric Blake

build: avoid requiring -lm

log2() is heavy when ffs() can do the same thing.  But ffs()
requires gnulib support for mingw.

This patch solves this linker error on Fedora 14.

/usr/bin/ld: libvirt_lxc-domain_conf.o: undefined reference to symbol 'log2@@GLIBC_2.2.5'
/usr/bin/ld: note: 'log2@@GLIBC_2.2.5' is defined in DSO /lib64/libm.so.6 so try adding it to the linker command line
/lib64/libm.so.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status

* .gnulib: Update to latest, for ffs.
* bootstrap.conf (gnulib_modules): Import ffs.
* src/conf/domain_conf.c (virDomainDefParseXML): Use ffs instead
of log2.
Reported by Dave Allan.
上级 00d3c5a6
.gnulib @ a918da4d
Subproject commit 56005a21e8f9f434212a19dcb628c6d3b179fd08
Subproject commit a918da4d61d28be61a12605c9d35e2cf3966d866
......@@ -36,6 +36,7 @@ count-one-bits
crypto/md5
dirname-lgpl
fcntl-h
ffs
fnmatch
func
getaddrinfo
......
......@@ -29,7 +29,7 @@
#include <fcntl.h>
#include <dirent.h>
#include <sys/time.h>
#include <math.h>
#include <strings.h>
#include "virterror_internal.h"
#include "datatypes.h"
......@@ -5865,7 +5865,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected domain type %s, expecting %s"),
virDomainVirtTypeToString(def->virtType),
virDomainVirtTypeToString(log2(expectedVirtTypes)));
virDomainVirtTypeToString(ffs(expectedVirtTypes) - 1));
} else {
virBuffer buffer = VIR_BUFFER_INITIALIZER;
char *string;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册