Bug 756258

Summary: cannot build qemu with "--static" configure option
Product: [Fedora] Fedora Reporter: Mr-4 <mr.dash.four>
Component: qemuAssignee: Justin M. Forbes <jforbes>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: amit.shah, berrange, dougsland, dwmw2, ehabkost, gcosta, itamar, jaswinder, jforbes, knoel, scottt.tw, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-23 06:35:57 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Mr-4 2011-11-22 22:58:21 EST
Description of problem:
Any attempt to build qemu with the "--static" configure option fails. I get an error, similar to this one:

/usr/bin/ld: cannot find -lssl3

It seems to be caused by pkg-config - for details see http://permalink.gmane.org/gmane.linux.mandrake.cooker.devel/313068

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. ./configure --target-list="x86_64-softmmu arm-softmmu x86_64-linux-user arm-linux-user armeb-linux-user" --disable-kvm --disable-strip --disable-xen --disable-spice --disable-werror --static
2. make V=1
Actual results:
gcc -m64 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing  -fstack-protector-all -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -I/home/gogo/rpmbuild/BUILD/qemu-kvm-0.15.1/libcacard -I/usr/include/nss3 -I/usr/include/nspr4      -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -I qapi-generated -O2 -g  -Wl,--warn-common -m64 -static -g  -o qemu-ga qemu-ga.o qga/guest-agent-command-state.o qga/guest-agent-commands.o qemu-tool.o qemu-error.o error.o osdep.o oslib-posix.o qemu-thread-posix.o trace.o cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o async.o nbd.o block.o aio.o aes.o qemu-config.o qemu-progress.o qemu-sockets.o posix-aio-compat.o compatfd.o block/raw.o block/cow.o block/qcow.o block/vdi.o block/vmdk.o block/cloop.o block/dmg.o block/bochs.o block/vpc.o block/vvfat.o block/qcow2.o block/qcow2-refcount.o block/qcow2-cluster.o block/qcow2-snapshot.o block/qcow2-cache.o block/qed.o block/qed-gencb.o block/qed-l2-cache.o block/qed-table.o block/qed-cluster.o block/qed-check.o block/parallels.o block/nbd.o block/blkdebug.o block/sheepdog.o block/blkverify.o block/raw-posix.o qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o qjson.o json-lexer.o json-streamer.o json-parser.o qerror.o qapi/qapi-visit-core.o qapi/qmp-input-visitor.o qapi/qmp-output-visitor.o qapi/qapi-dealloc-visitor.o qapi/qmp-registry.o qapi/qmp-dispatch.o qemu-timer-common.o qapi-generated/qga-qapi-visit.o qapi-generated/qga-qapi-types.o qapi-generated/qga-qmp-marshal.o -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl   -lrt -pthread  -lusbredirparser   -lz -lglib-2.0   
/usr/bin/ld: cannot find -lssl3
collect2: ld returned 1 exit status
make: *** [qemu-ga] Error 1

Expected results:
make to pass without errors

Additional info:
Currently there is no way I could build QEMU-[arch]-static executable - at least not without reverting to some hideous hacks! The -static version if QEMU is very useful in environments where dynamic linking is not possible (chroot for a different arch for example), thus enabling qemu to compile/build statically is important.
Comment 1 Daniel Berrange 2011-11-23 06:35:57 EST
The error shows you are missing the libssl3 library, which is not a QEMU bug. In addition the Fedora tracker is not the place to report problems with re-compiling QEMU yourself, rather for usage of provided Fedora QEMU RPMs. If you have problems compiling QEMU, it is best to take questions to the upstream QEMU mailing list where they can provide developer support.