From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gf0HT-0007ZN-JE for qemu-devel@nongnu.org; Tue, 31 Oct 2006 15:32:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gf0HP-0007UZ-Gx for qemu-devel@nongnu.org; Tue, 31 Oct 2006 15:32:19 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gf0HP-0007UL-4p for qemu-devel@nongnu.org; Tue, 31 Oct 2006 15:32:15 -0500 Received: from [65.74.133.4] (helo=mail.codesourcery.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Gf0HO-000510-UM for qemu-devel@nongnu.org; Tue, 31 Oct 2006 15:32:15 -0500 From: Paul Brook Subject: Re: [Qemu-devel] ColdFire/m68k target Date: Tue, 31 Oct 2006 20:32:10 +0000 References: <200610220144.22013.paul@codesourcery.com> <5d649bdb0610311220vc802054q9ec008f95259bbb7@mail.gmail.com> In-Reply-To: <5d649bdb0610311220vc802054q9ec008f95259bbb7@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610312032.11227.paul@codesourcery.com> 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 On Tuesday 31 October 2006 20:20, Neo Jia wrote: > Paul, > > I just checkout from CVS repository and encountered the following problem > while building the code. > > It seems you eleminate your original arguments of function gen_op_divs and > gen_op_divu. > > Could you take a look? > > gcc -Wall -O2 -g -fno-strict-aliasing -I. -I.. > -I/home/cjia/research/Operating_Systems/qemu_cvs/target-m68k > -I/home/cjia/research/Operating_Systems/qemu_cvs > -I/home/cjia/research/Operating_Systems/qemu_cvs/linux-user > -I/home/cjia/research/Operating_Systems/qemu_cvs/linux-user/m68k > -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE > -I/home/cjia/research/Operating_Systems/qemu_cvs/fpu > -I/home/cjia/research/Operating_Systems/qemu_cvs/slirp -c -o > translate.o/home/cjia/research/Operating_Systems/qemu_cvs/target-m68k/trans >late.c > /home/cjia/research/Operating_Systems/qemu_cvs/target-m68k/translate.c: In > function `disas_divw': Ah, this is a dyngen bug. op_divw contains "if (PARAM1) {...}". PARAM1 is implemented by taking the address of a symbol. gcc knows that symbols can never have address zero (because the C standard says so), and eliminates the whole block of code. The patch below fixes it (weak symbols can be zero). However it break lame hosts that don't support weak symbols, eg. win32. I'm still trying to figure out a proper solution. Index: dyngen-exec.h =================================================================== RCS file: /sources/qemu/qemu/dyngen-exec.h,v retrieving revision 1.29 diff -u -p -r1.29 dyngen-exec.h --- dyngen-exec.h 18 Jul 2006 21:23:34 -0000 1.29 +++ dyngen-exec.h 31 Oct 2006 16:53:38 -0000 @@ -222,7 +222,7 @@ extern int __op_param3 __hidden; #if defined(__APPLE__) static int __op_param1, __op_param2, __op_param3; #else -extern int __op_param1, __op_param2, __op_param3; +extern int __attribute__((weak)) __op_param1, __op_param2, __op_param3; #endif #define PARAM1 ((long)(&__op_param1)) #define PARAM2 ((long)(&__op_param2))