From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qb51P-0006m6-VL for qemu-devel@nongnu.org; Mon, 27 Jun 2011 02:10:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qb51N-0006Q1-VK for qemu-devel@nongnu.org; Mon, 27 Jun 2011 02:10:11 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:64003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qb51N-0006PM-IA for qemu-devel@nongnu.org; Mon, 27 Jun 2011 02:10:09 -0400 Received: by ywb3 with SMTP id 3so2242347ywb.4 for ; Sun, 26 Jun 2011 23:10:08 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1309152553-25693-1-git-send-email-weil@mail.berlios.de> References: <20110626230312.56C4F3FC03@buildbot.b1-systems.de> <1309152553-25693-1-git-send-email-weil@mail.berlios.de> Date: Mon, 27 Jun 2011 07:10:08 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] vnc: Fix compilation with --enable-vnc-png List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Blue Swirl , qemu-devel@nongnu.org On Mon, Jun 27, 2011 at 6:29 AM, Stefan Weil wrote: > Commit f26e428da505709ec03b2ed2c9eb3db82b30bd7b fixed compilation > with --enable-vnc-png, but broke it with --enable-vnc-png. > > The breakage is caused by pngconfig.h which checks whether > setjmp.h was already included and fails because qemu-common.h > includes setjmp.h. > > The check is disabled by defining PNG_SKIP_SETJMP_CHECK. > > Cc: Blue Swirl > Signed-off-by: Stefan Weil > --- > =A0ui/vnc-enc-tight.c | =A0 =A03 +++ > =A01 files changed, 3 insertions(+), 0 deletions(-) Reviewed-by: Stefan Hajnoczi Some more info on why Stefan Weil's fix is correct: The setjmp(3) man page says, "POSIX does not specify whether setjmp() will save the signal mask. In System V it will not. In 4.3BSD it will, and there is a function _setjmp that will not. By default, Linux/glibc follows the System V behavior, but the BSD behavior is provided if the _BSD_SOURCE feature test macro is defined and none of _POSIX_SOURCE, _POSIX_C_SOURCE, _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED, _GNU_SOURCE, or _SVID_SOURCE is defined." Apparently libpng wants to make sure that the setjmp() which will not save signal masks is used on Linux. The problem is that Linux supports both versions and jmp_buf is part of the libpng API. That means the application and the library need to agree on which setjmp() semantics will be used. That said, QEMU doesn't seem to make use of the jmp_buf API in libpng, so this really shouldn't matter at all. We can skip the header check. Stefan