Print this page
OS-3643 lx brand: add USDT provider to lx_brand.so.1
OS-3644 lx brand: ptrace_init() never called

@@ -19,10 +19,11 @@
 # CDDL HEADER END
 #
 # Copyright 2015 Gary Mills
 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, Joyent, Inc.
 #
 #
 # Definitions common to libraries.
 #
 # include global definitions; SRC should be defined in the shell.

@@ -133,11 +134,28 @@
 # For most libraries, we should be able to resolve all symbols at link time,
 # either within the library or as dependencies, all text should be pure, and
 # combining relocations into one relocation table reduces startup costs.
 # All options are tunable to allow overload/omission from lower makefiles.
 
+#
+# DTrace related rules
+#
+# These allow for multiple USDT providers to be specified by a library.
+# If a library needs to break up the set of objects that are passed to
+# the dtrace -G invocation, then they can place the following in heir
+# Makefile.com:
+#
+# pics/<provider>.o     := USDT_G_PICS = <files>
+#
+# <provider> should be replaced with the basename of one of the USDT
+# providers specified in USDT_PROVIDERS in their Makefile.com.
+#
+USDT_HEADERS=   $(USDT_PROVIDERS:%.d=%_impl.h)
+USDT_PICS=      $(USDT_PROVIDERS:%.d=pics/%.o)
+USDT_G_PICS=    $(PICS)
 
+
 HSONAME=        -h$(SONAME)
 DYNFLAGS=       $(HSONAME) $(ZTEXT) $(ZDEFS) $(BDIRECT) \
                 $(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
 
 LDLIBS=         $(LDLIBS.lib)

@@ -155,11 +173,11 @@
 
 # default build of an archive and a shared object,
 # overridden locally when extra processing is needed
 BUILD.AR=       $(AR) $(ARFLAGS) $@ $(AROBJS)
 BUILD.SO=       $(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
-                $(PICS) $(EXTPICS) $(LDLIBS)
+                $(PICS) $(EXTPICS) $(USDT_PICS) $(LDLIBS)
 BUILDCCC.SO=    $(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
                 $(PICS) $(EXTPICS) $(LDLIBS)
 
 # default dynamic library symlink
 INS.liblink=    -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKS)$(VERS) $@