|
From: | Lee Essen |
Subject: | Re: [Qemu-devel] Thoughts around dtrace linking... |
Date: | Wed, 21 Mar 2012 13:37:57 +0000 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 |
On 21/03/2012 13:01, Andreas Färber 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 switched them all to plaintext, but obviously not. Hopefully this is done now.
New version below ...
How compatible is this with FreeBSD - it doesn't sound like it's needed at all?Don't know about FreeBSD but on Darwin that step is indeed not needed or supported, so needs to be guarded. Andreas
Ok, so perhaps the easiest way to guard would be a new variable that matches both a backend of dtrace and OS of Solaris established via configure, for the moment I've just put a backend check, but clearly this wouldn't be enough.
LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(sort $(1)) $(LIBS)," LINK $(TARGET_DIR)$@")
DTRACE = $(call quiet-command,dtrace $(CONFIG_DTRACE_FLAGS) -o $(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,$^) endifIf you're happy that this is a sensible approach I'll put together a proper patch.
Regards, Lee.
[Prev in Thread] | Current Thread | [Next in Thread] |