Received: from eggs.gnu.org ([208.118.235.92]:55736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SALjo-0000T9-MA for qemu-devel@nongnu.org; Wed, 21 Mar 2012 09:38:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SALjj-00064t-7R for qemu-devel@nongnu.org; Wed, 21 Mar 2012 09:38:04 -0400 Received: from 204.146.238.178.in-addr.arpa ([178.238.146.204]:41358 helo=mail.local) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SALji-00064G-Vl for qemu-devel@nongnu.org; Wed, 21 Mar 2012 09:37:59 -0400 Message-ID: <4F69D9B5.6090707@nowonline.co.uk> Date: Wed, 21 Mar 2012 13:37:57 +0000 From: Lee Essen MIME-Version: 1.0 References: <4F69B137.3070709@nowonline.co.uk> <4F69D142.7020307@suse.de> In-Reply-To: <4F69D142.7020307@suse.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Thoughts around dtrace linking... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Andreas_F=E4rber?= Cc: qemu-devel@nongnu.org, Stefan Hajnoczi On 21/03/2012 13:01, Andreas F=E4rber wrote: > Hi, > > Am 21.03.2012 11:45, schrieb Lee Essen: >> I've been trying to find a sensible way to solve the Solaris/Illumos >> dtrace requirement to pass all the objs to the dtrace command so that >> the resultant object file contains all the symbols needed to properly >> link the relevant binary. > > The two issues I see (as info for Stefan et al.) are > a) compiling DTrace probes into .o files requires linking those objects > with that additional .o file to avoid linker errors (even for tools > where using DTrace probes does not seem to make much sense), > b) the additional .o file depends on its input .o files, so must be > unique per executable. > This seems to be guaranteed when doing it at rules.mak level. Haven't > checked all the variables being passed back and forth here yet though; = I > really am not comfortable reviewing code that's HTML-formatted in my > mailer. ;) Sorry ... I've been jumping between machines and I'd thought I'd=20 switched them all to plaintext, but obviously not. Hopefully this is=20 done now. New version below ... > >> How compatible is this with FreeBSD - it doesn't sound like it's neede= d >> at all? > > Don't know about FreeBSD but on Darwin that step is indeed not needed o= r > supported, so needs to be guarded. > > Andreas > Ok, so perhaps the easiest way to guard would be a new variable that=20 matches both a backend of dtrace and OS of Solaris established via=20 configure, for the moment I've just put a backend check, but clearly=20 this wouldn't be enough. LINK =3D $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -= o=20 $@ $(sort $(1)) $(LIBS)," LINK $(TARGET_DIR)$@") DTRACE =3D $(call quiet-command,dtrace $(CONFIG_DTRACE_FLAGS) -o=20 $(1)-dtrace.o -G -s $(2) $(3), " GEN $(TARGET_DIR)$(1)-dtrace.o") %$(EXESUF): %.o ifeq ($(TRACE_BACKEND),dtrace) $(call DTRACE,$*,trace-dtrace.dtrace,$^) $(call LINK,$^ $*-dtrace.o) else $(call LINK,$^) endif If you're happy that this is a sensible approach I'll put together a=20 proper patch. Regards, Lee.