From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GgcpX-0000O3-L2 for qemu-devel@nongnu.org; Sun, 05 Nov 2006 02:54:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GgcpW-0000Nr-Va for qemu-devel@nongnu.org; Sun, 05 Nov 2006 02:54:11 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GgcpW-0000No-PG for qemu-devel@nongnu.org; Sun, 05 Nov 2006 02:54:10 -0500 Received: from [64.233.182.188] (helo=nf-out-0910.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GgcpW-00007P-Kj for qemu-devel@nongnu.org; Sun, 05 Nov 2006 02:54:11 -0500 Received: by nf-out-0910.google.com with SMTP id p48so2030938nfa for ; Sat, 04 Nov 2006 23:54:09 -0800 (PST) Message-ID: <5d649bdb0611042354p45d973ddj5ae3403b3cc6c62@mail.gmail.com> Date: Sun, 5 Nov 2006 01:54:08 -0600 From: "Neo Jia" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_43297_19794330.1162713248645" Subject: [Qemu-devel] Compilation error from CVS with "--static" configuration Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ------=_Part_43297_19794330.1162713248645 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline hi, I am trying to debug qemu with "--static" configuration but got the following error message: gcc -DQEMU_TOOL -Wall -O2 -g -fno-strict-aliasing -I. -g -static -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o qemu-img qemu-img.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c -lz -lrt /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_cancel.o)(.text+0x2e): In function `aio_cancel': : undefined reference to `pthread_mutex_lock' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_cancel.o)(.text+0x4f): In function `aio_cancel': : undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_cancel.o)(.text+0x113): In function `aio_cancel': : undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x165): In function `__aio_init': : undefined reference to `pthread_mutex_lock' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x1e8): In function `__aio_enqueue_request': : undefined reference to `pthread_self' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x1ee): In function `__aio_enqueue_request': : undefined reference to `pthread_getschedparam' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x203): In function `__aio_enqueue_request': : undefined reference to `pthread_mutex_lock' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x3a4): In function `__aio_enqueue_request': : undefined reference to `pthread_cond_signal' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x3b4): In function `__aio_enqueue_request': : undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x4cc): In function `__aio_enqueue_request': : undefined reference to `pthread_attr_init' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x4d9): In function `__aio_enqueue_request': : undefined reference to `pthread_attr_setdetachstate' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x4ed): In function `__aio_enqueue_request': : undefined reference to `pthread_create' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x4f8): In function `__aio_enqueue_request': : undefined reference to `pthread_attr_destroy' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x555): In function `__aio_enqueue_request': : undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x576): In function `handle_fildes_io': : undefined reference to `pthread_self' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x58c): In function `handle_fildes_io': : undefined reference to `pthread_getschedparam' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x5c1): In function `handle_fildes_io': : undefined reference to `pthread_setschedparam' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x60a): In function `handle_fildes_io': : undefined reference to `pthread_mutex_lock' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x6d4): In function `handle_fildes_io': : undefined reference to `pthread_cond_signal' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x6df): In function `handle_fildes_io': : undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x772): In function `handle_fildes_io': : undefined reference to `pthread_mutex_lock' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x981): In function `handle_fildes_io': : undefined reference to `pthread_mutex_lock' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x9e8): In function `handle_fildes_io': : undefined reference to `pthread_cond_timedwait' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0xa25): In function `handle_fildes_io': : undefined reference to `pthread_attr_init' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0xa2d): In function `handle_fildes_io': : undefined reference to `pthread_attr_setdetachstate' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0xa3e): In function `handle_fildes_io': : undefined reference to `pthread_create' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x1af): In function `__aio_init': : undefined reference to `pthread_mutex_unlock' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x8b): In function `__aio_notify_only': : undefined reference to `pthread_create' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0xa9): In function `__aio_notify_only': : undefined reference to `pthread_attr_init' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0xb1): In function `__aio_notify_only': : undefined reference to `pthread_attr_setdetachstate' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x15c): In function `__aio_notify': : undefined reference to `pthread_cond_signal' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x1a7): In function `__aio_notify': : undefined reference to `pthread_create' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x1fc): In function `__aio_notify': : undefined reference to `pthread_create' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x21c): In function `__aio_notify': : undefined reference to `pthread_attr_init' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x22c): In function `__aio_notify': : undefined reference to `pthread_attr_setdetachstate' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x242): In function `__aio_notify': : undefined reference to `pthread_attr_init' /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x24f): In function `__aio_notify': : undefined reference to `pthread_attr_setdetachstate' collect2: ld returned 1 exit status make: *** [qemu-img] Error 1 It seems that in the Makefile it misses to link library pthread. I modified Makefile and rebuild it without any problem. ifdef CONFIG_STATIC LDFLAGS+=-static LIBS+=-lpthread endif ifdef BUILD_DOCS DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 else DOCS= endif Thanks, Neo -- I would remember that if researchers were not ambitious probably today we haven't the technology we are using! ------=_Part_43297_19794330.1162713248645 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline hi,

I am trying to debug qemu with "--static" configuration but got the following error message:

gcc -DQEMU_TOOL -Wall -O2 -g -fno-strict-aliasing -I. -g -static -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o qemu-img qemu-img.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c -lz  -lrt
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_cancel.o)(.text+0x2e): In function `aio_cancel':
: undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_cancel.o)(.text+0x4f): In function `aio_cancel':
: undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_cancel.o)(.text+0x113): In function `aio_cancel':
: undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x165): In function `__aio_init':
: undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x1e8): In function `__aio_enqueue_request':
: undefined reference to `pthread_self'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x1ee): In function `__aio_enqueue_request':
: undefined reference to `pthread_getschedparam'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x203): In function `__aio_enqueue_request':
: undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x3a4): In function `__aio_enqueue_request':
: undefined reference to `pthread_cond_signal'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x3b4): In function `__aio_enqueue_request':
: undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x4cc): In function `__aio_enqueue_request':
: undefined reference to `pthread_attr_init'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x4d9): In function `__aio_enqueue_request':
: undefined reference to `pthread_attr_setdetachstate'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x4ed): In function `__aio_enqueue_request':
: undefined reference to `pthread_create'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x4f8): In function `__aio_enqueue_request':
: undefined reference to `pthread_attr_destroy'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x555): In function `__aio_enqueue_request':
: undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x576): In function `handle_fildes_io':
: undefined reference to `pthread_self'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x58c): In function `handle_fildes_io':
: undefined reference to `pthread_getschedparam'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x5c1): In function `handle_fildes_io':
: undefined reference to `pthread_setschedparam'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x60a): In function `handle_fildes_io':
: undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x6d4): In function `handle_fildes_io':
: undefined reference to `pthread_cond_signal'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x6df): In function `handle_fildes_io':
: undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x772): In function `handle_fildes_io':
: undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x981): In function `handle_fildes_io':
: undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x9e8): In function `handle_fildes_io':
: undefined reference to `pthread_cond_timedwait'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0xa25): In function `handle_fildes_io':
: undefined reference to `pthread_attr_init'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0xa2d): In function `handle_fildes_io':
: undefined reference to `pthread_attr_setdetachstate'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0xa3e): In function `handle_fildes_io':
: undefined reference to `pthread_create'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_misc.o)(.text+0x1af): In function `__aio_init':
: undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x8b): In function `__aio_notify_only':
: undefined reference to `pthread_create'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0xa9): In function `__aio_notify_only':
: undefined reference to `pthread_attr_init'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0xb1): In function `__aio_notify_only':
: undefined reference to `pthread_attr_setdetachstate'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x15c): In function `__aio_notify':
: undefined reference to `pthread_cond_signal'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x1a7): In function `__aio_notify':
: undefined reference to `pthread_create'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x1fc): In function `__aio_notify':
: undefined reference to `pthread_create'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x21c): In function `__aio_notify':
: undefined reference to `pthread_attr_init'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x22c): In function `__aio_notify':
: undefined reference to `pthread_attr_setdetachstate'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x242): In function `__aio_notify':
: undefined reference to `pthread_attr_init'
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../librt.a(aio_notify.o)(.text+0x24f): In function `__aio_notify':
: undefined reference to `pthread_attr_setdetachstate'
collect2: ld returned 1 exit status
make: *** [qemu-img] Error 1

It seems that in the Makefile it misses to link library pthread.

I modified Makefile and rebuild it without any problem.

ifdef CONFIG_STATIC
LDFLAGS+=-static
LIBS+=-lpthread
endif
ifdef BUILD_DOCS
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
else
DOCS=
endif

Thanks,
Neo
--
I would remember that if researchers were not ambitious
probably today we haven't the technology we are using!
------=_Part_43297_19794330.1162713248645--