From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAJ2d-0002bM-NP for qemu-devel@nongnu.org; Wed, 21 Mar 2012 06:45:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SAJ2X-0006r9-H0 for qemu-devel@nongnu.org; Wed, 21 Mar 2012 06:45:19 -0400 Received: from 204.146.238.178.in-addr.arpa ([178.238.146.204]:61631 helo=mail.local) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAJ2X-0006r3-A4 for qemu-devel@nongnu.org; Wed, 21 Mar 2012 06:45:13 -0400 Message-ID: <4F69B137.3070709@nowonline.co.uk> Date: Wed, 21 Mar 2012 10:45:11 +0000 From: Lee Essen MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------060309040800090807080407" Subject: [Qemu-devel] Thoughts around dtrace linking... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Stefan Hajnoczi This is a multi-part message in MIME format. --------------060309040800090807080407 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, 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 easiest way to do this is just prior to linking the binary, so something like this (in rules.mak): 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 $(call DTRACE,$*,trace-dtrace.dtrace,$^) $(call LINK,$^ $*-dtrace.o) Obviously with the relevant tests around it to check the trace backend, and also an adjustment in Makefile.target to cause the right thing to happen for each target. Or, is there a better way? How compatible is this with FreeBSD - it doesn't sound like it's needed at all? Regards, Lee. --------------060309040800090807080407 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi,

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 easiest way to do this is just prior to linking the binary, so something like this (in rules.mak):
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
  $(call DTRACE,$*,trace-dtrace.dtrace,$^)
  $(call LINK,$^ $*-dtrace.o)
Obviously with the relevant tests around it to check the trace backend, and also an adjustment in Makefile.target to cause the right thing to happen for each target.

Or, is there a better way?
How compatible is this with FreeBSD - it doesn't sound like it's needed at all?

Regards,

Lee.

--------------060309040800090807080407--