Here is an example libxl module gcc command:
gcc -O1 -fno-omit-frame-pointer -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -D__XEN_TOOLS__ -MMD -MF .libxl.o.d -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fno-optimize-sibling-calls -Werror -Wno-format-zero-length -Wmissing-declarations -Wno-declaration-after-statement -Wformat-nonliteral -I. -fPIC -pthread -I/root/xen/tools/libxl/../../tools/libxc/include -I/root/xen/tools/libxl/../../tools/include -I/root/xen/tools/libxl/../../tools/libxc/include -I/root/xen/tools/libxl/../../tools/include -I/root/xen/tools/libxl/../../tools/xenstore/include -I/root/xen/tools/libxl/../../tools/include -I/root/xen/tools/libxl/../../tools/blktap2/control -I/root/xen/tools/libxl/../../tools/blktap2/include -I/root/xen/tools/libxl/../../tools/include -Wshadow -include /root/xen/tools/libxl/../../tools/config.h -c -o libxl.o libxl.c
I was unable to successfully make libvirt (more on that later), but here is an example libvirt module gcc command:
/bin/bash ../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I../gnulib/lib -I../gnulib/lib -I.. -I../include -I../include -I./util -DIN_LIBVIRT -Dabs_topbuilddir="\"/root/libvirt-1.2.12\"" -I/usr/include/libnl3 -I/usr/include/libnl3 -I/usr/include/libxml2 -W -Waddress -Waggressive-loop-optimizations -Wall -Warray-bounds -Wattributes -Wbad-function-cast -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcomments -Wcoverage-mismatch -Wcpp -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wdouble-promotion -Wempty-body -Wendif-labels -Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wformat-zero-length -Wfree-nonheap-object -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Winline -Wint-to-pointer-cast -Winvalid-memory-model -Winvalid-pch -Wjump-misses-init -Wlogical-op -Wmain -Wmaybe-uninitialized -Wmissing-braces -Wmissing-declarations -Wmissing-field-initializers -Wmissing-include-dirs -Wmissing-parameter-type -Wmissing-prototypes -Wmultichar -Wnarrowing -Wnested-externs -Wnonnull -Wold-style-declaration -Wold-style-definition -Woverflow -Woverride-init -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-sign -Wpointer-to-int-cast -Wpragmas -Wreturn-local-addr -Wreturn-type -Wsequence-point -Wshadow -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstrict-prototypes -Wsuggest-attribute=const -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wswitch -Wsync-nand -Wtrampolines -Wtrigraphs -Wtype-limits -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function -Wunused-label -Wunused-local-typedefs -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvarargs -Wvariadic-macros -Wvector-operation-performance -Wvolatile-register-var -Wwrite-strings -Wnormalized=nfc -Wno-sign-compare -Wjump-misses-init -Wno-format-nonliteral -Wframe-larger-than=4096 -fexceptions -fasynchronous-unwind-tables -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -fstack-protector-all -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I./conf -g -O2 -MT util/libvirt_util_la-viralloc.lo -MD -MP -MF util/.deps/libvirt_util_la-viralloc.Tpo -c -o util/libvirt_util_la-viralloc.lo `test -f 'util/viralloc.c' || echo './'`util/viralloc.c
libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I../gnulib/lib -I../gnulib/lib -I.. -I../include -I../include -I./util -DIN_LIBVIRT -Dabs_topbuilddir=\"/root/libvirt-1.2.12\" -I/usr/include/libnl3 -I/usr/include/libnl3 -I/usr/include/libxml2 -W -Waddress -Waggressive-loop-optimizations -Wall -Warray-bounds -Wattributes -Wbad-function-cast -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcomments -Wcoverage-mismatch -Wcpp -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wdouble-promotion -Wempty-body -Wendif-labels -Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wformat-zero-length -Wfree-nonheap-object -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Winline -Wint-to-pointer-cast -Winvalid-memory-model -Winvalid-pch -Wjump-misses-init -Wlogical-op -Wmain -Wmaybe-uninitialized -Wmissing-braces -Wmissing-declarations -Wmissing-field-initializers -Wmissing-include-dirs -Wmissing-parameter-type -Wmissing-prototypes -Wmultichar -Wnarrowing -Wnested-externs -Wnonnull -Wold-style-declaration -Wold-style-definition -Woverflow -Woverride-init -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-sign -Wpointer-to-int-cast -Wpragmas -Wreturn-local-addr -Wreturn-type -Wsequence-point -Wshadow -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstrict-prototypes -Wsuggest-attribute=const -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wswitch -Wsync-nand -Wtrampolines -Wtrigraphs -Wtype-limits -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function -Wunused-label -Wunused-local-typedefs -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvarargs -Wvariadic-macros -Wvector-operation-performance -Wvolatile-register-var -Wwrite-strings -Wnormalized=nfc -Wno-sign-compare -Wjump-misses-init -Wno-format-nonliteral -Wframe-larger-than=4096 -fexceptions -fasynchronous-unwind-tables -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -fstack-protector-all -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I./conf -g -O2 -MT util/libvirt_util_la-viralloc.lo -MD -MP -MF util/.deps/libvirt_util_la-viralloc.Tpo -c util/viralloc.c -fPIC -DPIC -o util/.libs/libvirt_util_la-viralloc.o
What compile flag differences would explain my failure?
Regarding libvirt build failure:
* I successfully installed dependencies with "apt-get build-dep libvirt"
* ./configure passed
* I ran plain 'make' but there was too little verbosity in the output to see the gcc flags. I let make run to completion though. I did notice these logs, but it did not cause make to fail:
make[3]: Entering directory `/root/libvirt-1.2.12/docs'
GEN html/index.html
missing XHTML1 DTD
* I ran a make clean, followed by "make V=1" to get more verbosity (see above log). However, now the "missing XHTML1 DTD" messages causes build failure:
make[3]: Entering directory `/root/libvirt-1.2.12/docs'
missing XHTML1 DTD
cat: 404.html.tmp: No such file or directory
make[3]: *** [404.html] Error 1
make[3]: Leaving directory `/root/libvirt-1.2.12/docs'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/libvirt-1.2.12/docs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/libvirt-1.2.12'
make: *** [all] Error 2
I did a little research. based on
https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=1135685 and similar threads, I installed this:
apt-get install w3c-dtd-xhtml
Plain 'make' now errors this way:
make[3]: Entering directory `/root/libvirt-1.2.12/docs'
Validating 404.html
warning: failed to load external entity "404.html.tmp"
make[3]: *** [404.html] Error 1
make[3]: Leaving directory `/root/libvirt-1.2.12/docs'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/libvirt-1.2.12/docs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/libvirt-1.2.12'
make: *** [all] Error 2
Based on some other threads I also tried these things:
* apt-get install libcurl4-gnutls-dev
build still fails.