[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] Building on Solaris 11 Express

On Fri, 2011-06-03 at 09:11 +0200, Matthias Bolte wrote:
> That might be the problem. I don't have a Solaris at hand right now to
> test it so here is a speculative patch for this.

I tested this patch. I'll discuss that first and then recount the
problems I experienced along the way.

The patch seems to achieve the desired effect. libvirtd starts up as the
user xvm. (That said, with Oracle dropping the xvm feature, I'm not sure
if this is better than just running as root.)

VirtualBox (and VBoxSVC) were crashing with "Memory fault", apparently
because they couldn't create /.VirtualBox (xvm's ~ is /). Once I created
that directory (and chown'ed/chgrp'ed it to xvm), I could start VBoxSVC.
From there, virsh connects. It seems to intermittently have problems;
I'm trying to reproduce that issue before I can go much further.

For this testing, I thought it'd be good to use a git checkout, as we
had previously discussed. I was hung up for a while because the gnulib
git repository was down. Now it seems to be back up, so I'm trying
again. Unfortunately, I'm having a number of build issues:

1) I only have gettext 0.16, so I made these changes:

diff --git a/bootstrap.conf b/bootstrap.conf
index 769e57c..5427c17 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -164,7 +164,7 @@ buildreq="\
 autoconf   2.59
 automake   1.9.6
 autopoint  -
-gettext    0.17
+gettext    0.16
 git        1.5.5
 gzip       -
 libtool    -
diff --git a/configure.ac b/configure.ac
index 25669cf..c6346cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2062,7 +2062,7 @@ dnl Enable building libvirtd?
 AM_CONDITIONAL([WITH_LIBVIRTD],[test "x$with_libvirtd" = "xyes"])
 dnl Check for gettext - don't go any newer than what RHEL 5 supports
 ALL_LINGUAS=`cd "$srcdir/po" > /dev/null && ls *.po | sed 's+\.po$++'`

2) The script isn't finding my automake and aclocal, even though they're
installed. Solaris has those executables named with a version number.
I'm not experienced enough with Solaris to know if there's any standard
way via the package manger to make one available as just plain automake
(similar to Debian's alternatives system). So I just did this:

ACLOCAL=aclocal-1.9 AUTOMAKE=automake-1.9 ./autogen.sh

3) The bootstrap script previously (when I had manually copied in a
gnulib git checkout from a month-or-so-old libvirt checkout on Linux)
was complaining that rpcgen didn't exist. I've never heard of that
program, but I apparently have something by that name installed:

# rpcgen
rpcgen  (1.1)
usage:  rpcgen infile
        rpcgen [-abCLNTMA] [-Dname[=value]] [-i size] [-I [-K seconds]] [-Y path] infile
        rpcgen [-c | -h | -l | -m | -t | -Sc | -Ss | -Sm] [-o outfile] [infile]
        rpcgen [-s nettype]* [-o outfile] [infile]
        rpcgen [-n netid]* [-o outfile] [infile]
-a              generate all files, including samples
-A              generate code to enable automatic MT mode
-b              backward compatibility mode (generates code for SunOS 4.X)
-c              generate XDR routines
-C              ANSI C mode
-Dname[=value]  define a symbol (same as #define)
-h              generate header file
-i size         size at which to start generating inline code
-I              generate code for inetd support in server (for SunOS 4.X)
-K seconds      server exits after K seconds of inactivity
-l              generate client side stubs
-L              server errors will be printed to syslog
-m              generate server side stubs
-M              generate MT-safe code
-n netid        generate server code that supports named netid
-N              supports multiple arguments and call-by-value
-o outfile      name of the output file
-s nettype      generate server code that supports named nettype
-Sc             generate sample client code that uses remote procedures
-Ss             generate sample server code that defines remote procedures
-Sm             generate makefile template 
-t              generate RPC dispatch table
-T              generate code to support RPC dispatch tables
-v              print version information and exit
-Y path         path where cpp is found

4) The bootstrap script (well, really autopoint) failed because cvs is
not installed:
./bootstrap: cp ._bootmp/gnulib/lib/glthread/threadlib.c gnulib/lib/glthread/threadlib.c # with edits
./bootstrap: (cd ._bootmp2; autopoint) ...
autopoint: *** cvs program not found
autopoint: *** Stop.
Failed to bootstrap, please investigate.

Why on earth does it want cvs? Is that really used? I installed it so I
could move on.

5) pod2man is not in the PATH on Solaris. This patch detects it:

diff --git a/configure.ac b/configure.ac
index 25669cf..e6d31fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -153,6 +153,8 @@ AC_PATH_PROG([XMLLINT], [xmllint], [/usr/bin/xmllint])
 AC_PATH_PROG([XMLCATALOG], [xmlcatalog], [/usr/bin/xmlcatalog])
 AC_PATH_PROG([XSLTPROC], [xsltproc], [/usr/bin/xsltproc])
 AC_PATH_PROG([AUGPARSE], [augparse], [/usr/bin/augparse])
+AC_PATH_PROG([POD2MAN], [pod2man], [/usr/bin/pod2man], [$PATH$PATH_SEPARATOR/usr/perl5/bin])

 dnl External programs that we can use if they are available.
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index c1b4a9f..0e80f46 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -349,8 +349,7 @@ endif # WITH_LIBVIRTD
 # This is needed for 'make dist' too, so can't wrap in WITH_LIBVIRTD.
 EXTRA_DIST += probes.d libvirtd.stp

-POD2MAN = pod2man -c "Virtualization Support" \
-                       -r "$(PACKAGE)-$(VERSION)" -s 8
+POD2MAN += -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)" -s 8

 $(srcdir)/libvirtd.8.in: libvirtd.pod.in
        $(AM_V_GEN)$(POD2MAN) $< $@
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 826674a..77d8b10 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,5 +1,5 @@

-POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"
+POD2MAN += -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"

        libvirt_win_icon_16x16.ico \

6) I still had the issue with the version script code. Here's the error

creating libvirt.la
(cd .libs && rm -f libvirt.la && ln -s ../libvirt.la libvirt.la)
if /bin/sh ../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I. -I.. -I../gnulib/lib -I../gnulib/lib -I../include -I../src/util -I../include  -I/usr/include/libxml2   -Wall -W -Wformat-y2k -Wformat-security -Winit-self -Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wdisabled-optimization -Wpacked-bitfield-compat -Wmultichar -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables -funit-at-a-time  -DIN_LIBVIRT   -D_REENTRANT -D_REENTRANT  -g -O2 -MT libvirt_qemu_la-libvirt-qemu.lo -MD -MP -MF ".deps/libvirt_qemu_la-libvirt-qemu.Tpo" -c -o libvirt_qemu_la-libvirt-qemu.lo `test -f 'libvirt-qemu.c' || echo './'`libvirt-qemu.c; \
        then mv -f ".deps/libvirt_qemu_la-libvirt-qemu.Tpo" ".deps/libvirt_qemu_la-libvirt-qemu.Plo"; else rm -f ".deps/libvirt_qemu_la-libvirt-qemu.Tpo"; exit 1; fi
 gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I. -I.. -I../gnulib/lib -I../gnulib/lib -I../include -I../src/util -I../include -I/usr/include/libxml2 -Wall -W -Wformat-y2k -Wformat-security -Winit-self -Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wdisabled-optimization -Wpacked-bitfield-compat -Wmultichar -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables -funit-at-a-time -DIN_LIBVIRT -D_REENTRANT -D_REENTRANT -g -O2 -MT libvirt_qemu_la-libvirt-qemu.lo -MD -MP -MF .deps/libvirt_qemu_la-libvirt-qemu.Tpo -c libvirt-qemu.c  -fPIC -DPIC -o .libs/libvirt_qemu_la-libvirt-qemu.o
 gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I. -I.. -I../gnulib/lib -I../gnulib/lib -I../include -I../src/util -I../include -I/usr/include/libxml2 -Wall -W -Wformat-y2k -Wformat-security -Winit-self -Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wdisabled-optimization -Wpacked-bitfield-compat -Wmultichar -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables -funit-at-a-time -DIN_LIBVIRT -D_REENTRANT -D_REENTRANT -g -O2 -MT libvirt_qemu_la-libvirt-qemu.lo -MD -MP -MF .deps/libvirt_qemu_la-libvirt-qemu.Tpo -c libvirt-qemu.c -o libvirt_qemu_la-libvirt-qemu.o >/dev/null 2>&1
/bin/sh ../libtool --tag=CC --mode=link gcc -std=gnu99  -g -O2   -o libvirt-qemu.la -rpath /usr/local/lib -Wl,-M -Wl,./libvirt_qemu.syms -version-info 9:1:9    libvirt_qemu_la-libvirt-qemu.lo libvirt.la  -lnsl -lintl 
rm -fr  .libs/libvirt-qemu.a .libs/libvirt-qemu.la .libs/libvirt-qemu.lai .libs/libvirt-qemu.so .libs/libvirt-qemu.so.0 .libs/libvirt-qemu.so.0.9.1 .libs/libvirt-qemu.so.0.9.1T
gcc -std=gnu99 -shared -Wl,-h -Wl,libvirt-qemu.so.0 -o .libs/libvirt-qemu.so.0.9.1  .libs/libvirt_qemu_la-libvirt-qemu.o  -R/home/dtb/libvirt/src/.libs -R/usr/local/lib ./.libs/libvirt.so -lnsl -lintl -lc  -Wl,-M -Wl,./libvirt_qemu.syms
Undefined                       first referenced
 symbol                             in file
_fini                               /usr/lib/crti.o  (symbol has no version assigned)
_init                               /usr/lib/crti.o  (symbol has no version assigned)
__dso_handle                        /usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/crtbegin.o  (symbol has no version assigned)
_lib_version                        /usr/lib/values-Xa.o  (symbol has no version assigned)
ld: fatal: symbol referencing errors. No output written to .libs/libvirt-qemu.so.0.9.1
collect2: ld returned 1 exit status
make[3]: *** [libvirt-qemu.la] Error 1

As I mentioned before, this change "fixes" the problem:
         `$LD --help 2>&1 | grep -- --version-script >/dev/null` || \
        -    VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
        +    VERSION_SCRIPT_FLAGS=""

The more I look into this, though, the less I think that's correct. But
I don't know enough about symbol versioning, especially under Solaris,
to figure out the correct fix.


Since I was having so much trouble building from a git clone of libvirt
on Solaris 11 Express, I decided to do the git checkout on my Linux
machine and run `make dist` there. Unfortunately, make dist failed on
Linux (Ubuntu Natty):

  GEN    libvirt-api.xml
Rebuilding API description for libvirt
Parsing ./../include/libvirt/virterror.h
Parsing ./../include/libvirt/libvirt.h
Parsing ./../src/util/event.c
Parsing ./../src/util/virterror.c
Parsing ./../src/libvirt.c
Project libvirt : 2 headers, 3 modules
  307 public functions
  1 public variables
  19 public structs
  119 public typedefs
  27 public macros
Saving XML description ./libvirt-api.xml
Saving XML Cross References ./libvirt-refs.xml
Rebuilding the HTML pages from the XML API
missing XHTML1 DTD
Rebuilding devhelp files
cp: cannot stat `./api.html': No such file or directory
make[1]: *** [distdir] Error 1

As always, I welcome any thoughts or feedback.


Attachment: signature.asc
Description: This is a digitally signed message part

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]