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.

Reply via email to