Print this page
    
OS-3643 lx brand: add USDT provider to lx_brand.so.1
OS-3644 lx brand: ptrace_init() never called
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/lib/Makefile.lib
          +++ new/usr/src/lib/Makefile.lib
   1    1  #
   2    2  # CDDL HEADER START
   3    3  #
   4    4  # The contents of this file are subject to the terms of the
   5    5  # Common Development and Distribution License (the "License").
   6    6  # You may not use this file except in compliance with the License.
   7    7  #
   8    8  # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9  # or http://www.opensolaris.org/os/licensing.
  10   10  # See the License for the specific language governing permissions
  11   11  # and limitations under the License.
  12   12  #
  13   13  # When distributing Covered Code, include this CDDL HEADER in each
  
    | 
      ↓ open down ↓ | 
    13 lines elided | 
    
      ↑ open up ↑ | 
  
  14   14  # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15  # If applicable, add the following below this CDDL HEADER, with the
  16   16  # fields enclosed by brackets "[]" replaced with your own identifying
  17   17  # information: Portions Copyright [yyyy] [name of copyright owner]
  18   18  #
  19   19  # CDDL HEADER END
  20   20  #
  21   21  # Copyright 2015 Gary Mills
  22   22  # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
  23   23  # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
       24 +# Copyright (c) 2014, Joyent, Inc.
  24   25  #
  25   26  #
  26   27  # Definitions common to libraries.
  27   28  #
  28   29  # include global definitions; SRC should be defined in the shell.
  29   30  # SRC is needed until RFE 1026993 is implemented.
  30   31  
  31   32  include         $(SRC)/Makefile.master
  32   33  
  33   34  LORDER=         lorder
  34   35  TSORT=          tsort
  35   36  
  36   37  #
  37   38  # By default, we define the source directory for libraries to be
  38   39  # one level up from the ISA-specific directory, where the code is
  39   40  # actually built.  Many libraries define a 'common' directory to
  40   41  # contain the source.  These libraries must redefine SRCDIR as:
  41   42  #       SRCDIR = ../common
  42   43  # Other variations are possible (../port, ../src, etc).
  43   44  #
  44   45  SRCDIR =        ..
  45   46  
  46   47  #
  47   48  # We define MAPFILES here for the benefit of most libraries, those that
  48   49  # follow the convention of having source files and other common files
  49   50  # in the $(SRCDIR) directory.  Libraries that do not follow this
  50   51  # convention must define MAPFILES, or MAPFILEDIR for themselves.
  51   52  # Libraries that do follow this convention but that need supplemental
  52   53  # ISA-specific mapfiles can augment MAPFILES like this:
  53   54  #       MAPFILES += mapfile-vers
  54   55  #
  55   56  MAPFILEDIR =    $(SRCDIR)
  56   57  MAPFILES =      $(MAPFILEDIR)/mapfile-vers
  57   58  
  58   59  #
  59   60  # If HDRDIR is left unset, then it's possible for the $(ROOTHDRDIR)/%
  60   61  # install rule in lib/Makefile.targ to generate false matches if there
  61   62  # are any common directory names between / and /usr/include (`xfn' is
  62   63  # one common example).  To prevent this, we set HDRDIR to a directory
  63   64  # name that will almost surely not exist on the build machine.
  64   65  #
  65   66  HDRDIR=         /__nonexistent_directory__
  66   67  
  67   68  #
  68   69  # We don't build archive (*.a) libraries by default anymore.
  69   70  # If a component of the build needs to build an archive library
  70   71  # for its own internal purposes, it can define LIBS for itself
  71   72  # after including Makefile.lib, like this:
  72   73  #       LIBS = $(LIBRARY)
  73   74  # or:
  74   75  #       LIBS = $(LIBRARYCCC)
  75   76  # Archive libraries must not be installed in the proto area.
  76   77  #
  77   78  LIBS=
  78   79  MACHLIBS=       $(LIBS:%=$(MACH)/%)
  79   80  MACHLIBS64=     $(LIBS:%=$(MACH64)/%)
  80   81  DYNLIB=         $(LIBRARY:.a=.so$(VERS))
  81   82  DYNLIBPSR=      $(LIBRARY:.a=_psr.so$(VERS))
  82   83  DYNLIBCCC=      $(LIBRARYCCC:.a=.so$(VERS))
  83   84  LIBLINKS=       $(LIBRARY:.a=.so)
  84   85  LIBLINKSCCC=    $(LIBRARYCCC:.a=.so)
  85   86  LIBNAME=        $(LIBRARY:lib%.a=%)
  86   87  LIBLINKPATH=
  87   88  LIBNULL=        null.a
  88   89  ROOTHDRDIR=     $(ROOT)/usr/include
  89   90  ROOTLIBDIR=     $(ROOT)/usr/lib
  90   91  ROOTLIBDIR64=   $(ROOT)/usr/lib/$(MACH64)
  91   92  ROOTFS_LIBDIR=  $(ROOT)/lib
  92   93  ROOTFS_LIBDIR64=        $(ROOT)/lib/$(MACH64)
  93   94  ROOTLINTDIR=    $(ROOTLIBDIR)
  94   95  ROOTFS_LINTDIR= $(ROOTFS_LIBDIR)
  95   96  ROOTFS_LINTDIR64=       $(ROOTFS_LIBDIR64)
  96   97  ROOTHDRS=       $(HDRS:%=$(ROOTHDRDIR)/%)
  97   98  HDRSRCS=        $(HDRS:%=$(HDRDIR)/%)
  98   99  CHECKHDRS=      $(HDRSRCS:%.h=%.check)
  99  100  ROOTLIBS=       $(LIBS:%=$(ROOTLIBDIR)/%)
 100  101  ROOTLIBS64=     $(LIBS:%=$(ROOTLIBDIR64)/%)
 101  102  ROOTFS_LIBS=    $(DYNLIB:%=$(ROOTFS_LIBDIR)/%)
 102  103  ROOTFS_LIBS64=  $(DYNLIB:%=$(ROOTFS_LIBDIR64)/%)
 103  104  ROOTLINKS=      $(ROOTLIBDIR)/$(LIBLINKS)
 104  105  ROOTLINKS64=    $(ROOTLIBDIR64)/$(LIBLINKS)
 105  106  ROOTFS_LINKS=   $(ROOTFS_LIBDIR)/$(LIBLINKS)
 106  107  ROOTFS_LINKS64= $(ROOTFS_LIBDIR64)/$(LIBLINKS)
 107  108  ROOTLINKSCCC=   $(ROOTLIBDIR)/$(LIBLINKSCCC)
 108  109  ROOTLINKSCCC64= $(ROOTLIBDIR64)/$(LIBLINKSCCC)
 109  110  ROOTFS_LINKSCCC=        $(ROOTFS_LIBDIR)/$(LIBLINKSCCC)
 110  111  ROOTFS_LINKSCCC64=      $(ROOTFS_LIBDIR64)/$(LIBLINKSCCC)
 111  112  ROOTLINT=       $(LINTSRC:%=$(ROOTLINTDIR)/%)
 112  113  ROOTFS_LINT=    $(LINTSRC:%=$(ROOTFS_LINTDIR)/%)
 113  114  ROOTFS_LINT64=  $(LINTSRC:%=$(ROOTFS_LINTDIR64)/%)
 114  115  ROOTMAN3=     $(ROOT)/usr/share/man/man3
 115  116  ROOTMAN3FILES=        $(MAN3FILES:%=$(ROOTMAN3)/%)
 116  117  $(ROOTMAN3FILES) := FILEMODE= 444
 117  118  
 118  119  # Demo rules
 119  120  DEMOFILES=
 120  121  DEMOFILESRCDIR=         common
 121  122  ROOTDEMODIRBASE=        __nonexistent_directory__
 122  123  ROOTDEMODIRS=
 123  124  ROOTDEMOFILES=  $(DEMOFILES:%=$(ROOTDEMODIRBASE)/%)
 124  125  $(ROOTDEMODIRS) :=      DIRMODE =       755
 125  126  
 126  127  LINTLIB=        llib-l$(LIBNAME).ln
 127  128  LINTFLAGS=      -uaxm
  
    | 
      ↓ open down ↓ | 
    94 lines elided | 
    
      ↑ open up ↑ | 
  
 128  129  LINTFLAGS64=    -uaxm -m64
 129  130  LINTSRC=        $(LINTLIB:%.ln=%)
 130  131  LINTOUT=        lint.out
 131  132  ARFLAGS=        r
 132  133  SONAME=         $(DYNLIB)
 133  134  # For most libraries, we should be able to resolve all symbols at link time,
 134  135  # either within the library or as dependencies, all text should be pure, and
 135  136  # combining relocations into one relocation table reduces startup costs.
 136  137  # All options are tunable to allow overload/omission from lower makefiles.
 137  138  
      139 +#
      140 +# DTrace related rules
      141 +#
      142 +# These allow for multiple USDT providers to be specified by a library.
      143 +# If a library needs to break up the set of objects that are passed to
      144 +# the dtrace -G invocation, then they can place the following in heir
      145 +# Makefile.com:
      146 +#
      147 +# pics/<provider>.o     := USDT_G_PICS = <files>
      148 +#
      149 +# <provider> should be replaced with the basename of one of the USDT
      150 +# providers specified in USDT_PROVIDERS in their Makefile.com.
      151 +#
      152 +USDT_HEADERS=   $(USDT_PROVIDERS:%.d=%_impl.h)
      153 +USDT_PICS=      $(USDT_PROVIDERS:%.d=pics/%.o)
      154 +USDT_G_PICS=    $(PICS)
 138  155  
      156 +
 139  157  HSONAME=        -h$(SONAME)
 140  158  DYNFLAGS=       $(HSONAME) $(ZTEXT) $(ZDEFS) $(BDIRECT) \
 141  159                  $(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
 142  160  
 143  161  LDLIBS=         $(LDLIBS.lib)
 144  162  
 145  163  OBJS=           $(OBJECTS:%=objs/%)
 146  164  PICS=           $(OBJECTS:%=pics/%)
 147  165  
 148  166  # Declare that all library .o's can all be made in parallel.
 149  167  # The DUMMY target is for those instances where OBJS and PICS
  
    | 
      ↓ open down ↓ | 
    1 lines elided | 
    
      ↑ open up ↑ | 
  
 150  168  # are empty (to avoid an unconditional .PARALLEL declaration).
 151  169  .PARALLEL:      $(OBJS) $(PICS) DUMMY
 152  170  
 153  171  # default value for "portable" source
 154  172  SRCS=           $(OBJECTS:%.o=$(SRCDIR)/%.c)
 155  173  
 156  174  # default build of an archive and a shared object,
 157  175  # overridden locally when extra processing is needed
 158  176  BUILD.AR=       $(AR) $(ARFLAGS) $@ $(AROBJS)
 159  177  BUILD.SO=       $(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
 160      -                $(PICS) $(EXTPICS) $(LDLIBS)
      178 +                $(PICS) $(EXTPICS) $(USDT_PICS) $(LDLIBS)
 161  179  BUILDCCC.SO=    $(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
 162  180                  $(PICS) $(EXTPICS) $(LDLIBS)
 163  181  
 164  182  # default dynamic library symlink
 165  183  INS.liblink=    -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKS)$(VERS) $@
 166  184  INS.liblinkccc= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKSCCC)$(VERS) $@
 167  185  
 168  186  # default 64-bit dynamic library symlink
 169  187  INS.liblink64=  -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKS)$(VERS) $@
 170  188  INS.liblinkccc64= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKSCCC)$(VERS) $@
 171  189  
 172  190  #
 173  191  # If appropriate, augment POST_PROCESS_O and POST_PROCESS_SO to do CTF
 174  192  # processing.  We'd like to just conditionally append to POST_PROCESS_O and
 175  193  # POST_PROCESS_SO, but ParallelMake has a bug which causes the same value to
 176  194  # sometimes get appended more than once, which will cause ctfconvert to fail.
 177  195  # So, instead we introduce CTFCONVERT_POST and CTFMERGE_POST, which are always
 178  196  # appended to POST_PROCESS_O and POST_PROCESS_SO but are no-ops unless CTF
 179  197  # processing should be done.
 180  198  #
 181  199  CTFCONVERT_POST = :
 182  200  CTFMERGE_POST   = :
 183  201  POST_PROCESS_O += ; $(CTFCONVERT_POST)
 184  202  POST_PROCESS_SO += ; $(CTFMERGE_POST)
 185  203  
 186  204  CTFMERGE_LIB    = $(CTFMERGE) $(CTFMRGFLAGS) -t -f -L VERSION -o $@ $(PICS)
 187  205  
 188  206  # conditional assignments
 189  207  
 190  208  $(OBJS)  :=     sparc_CFLAGS += -xregs=no%appl
 191  209  
 192  210  $(PICS)  :=     sparc_CFLAGS += -xregs=no%appl $(sparc_C_PICFLAGS)
 193  211  $(PICS)  :=     sparcv9_CFLAGS += -xregs=no%appl $(sparcv9_C_PICFLAGS)
 194  212  $(PICS)  :=     i386_CFLAGS += $(i386_C_PICFLAGS)
 195  213  $(PICS)  :=     amd64_CFLAGS += $(amd64_C_PICFLAGS)
 196  214  $(PICS)  :=     CCFLAGS += $(CC_PICFLAGS)
 197  215  $(PICS)  :=     CPPFLAGS += -DPIC -D_REENTRANT
 198  216  $(PICS)  :=     sparcv9_CCFLAGS += -xregs=no%appl $(sparcv9_CC_PICFLAGS)
 199  217  $(PICS)  :=     amd64_CCFLAGS += $(amd64_CC_PICFLAGS)
 200  218  $(PICS)  :=     CFLAGS += $(CTF_FLAGS)
 201  219  $(PICS)  :=     CFLAGS64 += $(CTF_FLAGS)
 202  220  $(PICS)  :=     CTFCONVERT_POST = $(CTFCONVERT_O)
 203  221  $(DYNLIB) :=    CTFMERGE_POST = $(CTFMERGE_LIB)
 204  222  
 205  223  $(LINTLIB):=    LOG = -DLOGGING
 206  224  $(LIBRARY):=    AROBJS = $(OBJS)
 207  225  $(LIBRARY):=    DIR = objs
 208  226  $(DYNLIB):=     DIR = pics
 209  227  $(DYNLIBCCC):=  DIR = pics
 210  228  
 211  229  SONAMECCC=      $(DYNLIBCCC)
 212  230  HSONAMECCC=     -h $(SONAMECCC)
 213  231  #
 214  232  # Keep in sync with the standard DYNFLAGS
 215  233  #
 216  234  $(DYNLIBCCC):=  DYNFLAGS = $(HSONAMECCC) $(ZTEXT) $(ZDEFS) \
 217  235                  $(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%) \
 218  236                  $(BDIRECT) $(NORUNPATH)
 219  237  
 220  238  
 221  239  # build rule for "portable" source 
 222  240  objs/%.o pics/%.o: %.c
 223  241          $(COMPILE.c) -o $@ $<
 224  242          $(POST_PROCESS_O)
 225  243  
 226  244  objs/%.o pics/%.o: %.cc
 227  245          $(COMPILE.cc) -o $@ $<
 228  246          $(POST_PROCESS_O)
 229  247  
 230  248  .PRECIOUS: $(LIBS)
 231  249  
 232  250  # Define the majority text domain in this directory.
 233  251  TEXT_DOMAIN= SUNW_OST_OSLIB
 234  252  
 235  253  $(ROOTMAN3)/%: %.sunman
 236  254          $(INS.rename)
 237  255  
 238  256  #
 239  257  # For library source code, we expect that some symbols may not be used or
 240  258  # may *appear* to be able to rescoped to static; shut lint up.  Never add
 241  259  # a flag here unless you're *sure* that all libraries need to be linted
 242  260  # with it.
 243  261  #
 244  262  LINTCHECKFLAGS = -m -erroff=E_NAME_DEF_NOT_USED2
 245  263  LINTCHECKFLAGS += -erroff=E_NAME_DECL_NOT_USED_DEF2 
 246  264  
 247  265  #
 248  266  # Target Architecture
 249  267  #
 250  268  TARGETMACH=     $(MACH)
 251  269  
 252  270  #
 253  271  # Allow people to define their own clobber rules.  Normal makefiles
 254  272  # shouldn't override this - they should override $(CLOBBERFILES) instead.
 255  273  #
 256  274  CLOBBERTARGFILES= $(LIBS) $(DYNLIB) $(CLOBBERFILES)
  
    | 
      ↓ open down ↓ | 
    86 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX