Print this page
8411 Build should warn when linking against libraries outside proto area


   4 # The contents of this file are subject to the terms of the
   5 # Common Development and Distribution License (the "License").
   6 # You may not use this file except in compliance with the License.
   7 #
   8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9 # or http://www.opensolaris.org/os/licensing.
  10 # See the License for the specific language governing permissions
  11 # and limitations under the License.
  12 #
  13 # When distributing Covered Code, include this CDDL HEADER in each
  14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15 # If applicable, add the following below this CDDL HEADER, with the
  16 # fields enclosed by brackets "[]" replaced with your own identifying
  17 # information: Portions Copyright [yyyy] [name of copyright owner]
  18 #
  19 # CDDL HEADER END
  20 #
  21 # Copyright 2015 Gary Mills
  22 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
  23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.

  24 #
  25 #
  26 # Definitions common to libraries.
  27 #
  28 # include global definitions; SRC should be defined in the shell.
  29 # SRC is needed until RFE 1026993 is implemented.
  30 
  31 include         $(SRC)/Makefile.master
  32 
  33 LORDER=         lorder
  34 TSORT=          tsort
  35 
  36 #
  37 # By default, we define the source directory for libraries to be
  38 # one level up from the ISA-specific directory, where the code is
  39 # actually built.  Many libraries define a 'common' directory to
  40 # contain the source.  These libraries must redefine SRCDIR as:
  41 #       SRCDIR = ../common
  42 # Other variations are possible (../port, ../src, etc).
  43 #


 120 DEMOFILESRCDIR=         common
 121 ROOTDEMODIRBASE=        __nonexistent_directory__
 122 ROOTDEMODIRS=
 123 ROOTDEMOFILES=  $(DEMOFILES:%=$(ROOTDEMODIRBASE)/%)
 124 $(ROOTDEMODIRS) :=      DIRMODE =       755
 125 
 126 LINTLIB=        llib-l$(LIBNAME).ln
 127 LINTFLAGS=      -uaxm
 128 LINTFLAGS64=    -uaxm -m64
 129 LINTSRC=        $(LINTLIB:%.ln=%)
 130 LINTOUT=        lint.out
 131 ARFLAGS=        r
 132 SONAME=         $(DYNLIB)
 133 # For most libraries, we should be able to resolve all symbols at link time,
 134 # either within the library or as dependencies, all text should be pure, and
 135 # combining relocations into one relocation table reduces startup costs.
 136 # All options are tunable to allow overload/omission from lower makefiles.
 137 
 138 
 139 HSONAME=        -h$(SONAME)
 140 DYNFLAGS=       $(HSONAME) $(ZTEXT) $(ZDEFS) $(BDIRECT) \
 141                 $(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
 142 
 143 LDLIBS=         $(LDLIBS.lib)
 144 
 145 OBJS=           $(OBJECTS:%=objs/%)
 146 PICS=           $(OBJECTS:%=pics/%)
 147 
 148 # Declare that all library .o's can all be made in parallel.
 149 # The DUMMY target is for those instances where OBJS and PICS
 150 # are empty (to avoid an unconditional .PARALLEL declaration).
 151 .PARALLEL:      $(OBJS) $(PICS) DUMMY
 152 
 153 # default value for "portable" source
 154 SRCS=           $(OBJECTS:%.o=$(SRCDIR)/%.c)
 155 
 156 # default build of an archive and a shared object,
 157 # overridden locally when extra processing is needed
 158 BUILD.AR=       $(AR) $(ARFLAGS) $@ $(AROBJS)
 159 BUILD.SO=       $(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
 160                 $(PICS) $(EXTPICS) $(LDLIBS)


 196 $(PICS)  :=     CCFLAGS += $(CC_PICFLAGS)
 197 $(PICS)  :=     CPPFLAGS += -DPIC -D_REENTRANT
 198 $(PICS)  :=     sparcv9_CCFLAGS += -xregs=no%appl $(sparcv9_CC_PICFLAGS)
 199 $(PICS)  :=     amd64_CCFLAGS += $(amd64_CC_PICFLAGS)
 200 $(PICS)  :=     CFLAGS += $(CTF_FLAGS)
 201 $(PICS)  :=     CFLAGS64 += $(CTF_FLAGS)
 202 $(PICS)  :=     CTFCONVERT_POST = $(CTFCONVERT_O)
 203 $(DYNLIB) :=    CTFMERGE_POST = $(CTFMERGE_LIB)
 204 
 205 $(LINTLIB):=    LOG = -DLOGGING
 206 $(LIBRARY):=    AROBJS = $(OBJS)
 207 $(LIBRARY):=    DIR = objs
 208 $(DYNLIB):=     DIR = pics
 209 $(DYNLIBCCC):=  DIR = pics
 210 
 211 SONAMECCC=      $(DYNLIBCCC)
 212 HSONAMECCC=     -h $(SONAMECCC)
 213 #
 214 # Keep in sync with the standard DYNFLAGS
 215 #
 216 $(DYNLIBCCC):=  DYNFLAGS = $(HSONAMECCC) $(ZTEXT) $(ZDEFS) \
 217                 $(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%) \
 218                 $(BDIRECT) $(NORUNPATH)
 219 
 220 
 221 # build rule for "portable" source 
 222 objs/%.o pics/%.o: %.c
 223         $(COMPILE.c) -o $@ $<
 224         $(POST_PROCESS_O)
 225 
 226 objs/%.o pics/%.o: %.cc
 227         $(COMPILE.cc) -o $@ $<
 228         $(POST_PROCESS_O)
 229 
 230 .PRECIOUS: $(LIBS)
 231 
 232 # Define the majority text domain in this directory.
 233 TEXT_DOMAIN= SUNW_OST_OSLIB
 234 
 235 $(ROOTMAN3)/%: %.sunman
 236         $(INS.rename)


   4 # The contents of this file are subject to the terms of the
   5 # Common Development and Distribution License (the "License").
   6 # You may not use this file except in compliance with the License.
   7 #
   8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9 # or http://www.opensolaris.org/os/licensing.
  10 # See the License for the specific language governing permissions
  11 # and limitations under the License.
  12 #
  13 # When distributing Covered Code, include this CDDL HEADER in each
  14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15 # If applicable, add the following below this CDDL HEADER, with the
  16 # fields enclosed by brackets "[]" replaced with your own identifying
  17 # information: Portions Copyright [yyyy] [name of copyright owner]
  18 #
  19 # CDDL HEADER END
  20 #
  21 # Copyright 2015 Gary Mills
  22 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
  23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  24 # Copyright 2017 RackTop Systems.
  25 #
  26 #
  27 # Definitions common to libraries.
  28 #
  29 # include global definitions; SRC should be defined in the shell.
  30 # SRC is needed until RFE 1026993 is implemented.
  31 
  32 include         $(SRC)/Makefile.master
  33 
  34 LORDER=         lorder
  35 TSORT=          tsort
  36 
  37 #
  38 # By default, we define the source directory for libraries to be
  39 # one level up from the ISA-specific directory, where the code is
  40 # actually built.  Many libraries define a 'common' directory to
  41 # contain the source.  These libraries must redefine SRCDIR as:
  42 #       SRCDIR = ../common
  43 # Other variations are possible (../port, ../src, etc).
  44 #


 121 DEMOFILESRCDIR=         common
 122 ROOTDEMODIRBASE=        __nonexistent_directory__
 123 ROOTDEMODIRS=
 124 ROOTDEMOFILES=  $(DEMOFILES:%=$(ROOTDEMODIRBASE)/%)
 125 $(ROOTDEMODIRS) :=      DIRMODE =       755
 126 
 127 LINTLIB=        llib-l$(LIBNAME).ln
 128 LINTFLAGS=      -uaxm
 129 LINTFLAGS64=    -uaxm -m64
 130 LINTSRC=        $(LINTLIB:%.ln=%)
 131 LINTOUT=        lint.out
 132 ARFLAGS=        r
 133 SONAME=         $(DYNLIB)
 134 # For most libraries, we should be able to resolve all symbols at link time,
 135 # either within the library or as dependencies, all text should be pure, and
 136 # combining relocations into one relocation table reduces startup costs.
 137 # All options are tunable to allow overload/omission from lower makefiles.
 138 
 139 
 140 HSONAME=        -h$(SONAME)
 141 DYNFLAGS=       $(HSONAME) $(ZTEXT) $(ZDEFS) $(ZASSERTDEFLIB) $(BDIRECT) \
 142                 $(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
 143 
 144 LDLIBS=         $(LDLIBS.lib)
 145 
 146 OBJS=           $(OBJECTS:%=objs/%)
 147 PICS=           $(OBJECTS:%=pics/%)
 148 
 149 # Declare that all library .o's can all be made in parallel.
 150 # The DUMMY target is for those instances where OBJS and PICS
 151 # are empty (to avoid an unconditional .PARALLEL declaration).
 152 .PARALLEL:      $(OBJS) $(PICS) DUMMY
 153 
 154 # default value for "portable" source
 155 SRCS=           $(OBJECTS:%.o=$(SRCDIR)/%.c)
 156 
 157 # default build of an archive and a shared object,
 158 # overridden locally when extra processing is needed
 159 BUILD.AR=       $(AR) $(ARFLAGS) $@ $(AROBJS)
 160 BUILD.SO=       $(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
 161                 $(PICS) $(EXTPICS) $(LDLIBS)


 197 $(PICS)  :=     CCFLAGS += $(CC_PICFLAGS)
 198 $(PICS)  :=     CPPFLAGS += -DPIC -D_REENTRANT
 199 $(PICS)  :=     sparcv9_CCFLAGS += -xregs=no%appl $(sparcv9_CC_PICFLAGS)
 200 $(PICS)  :=     amd64_CCFLAGS += $(amd64_CC_PICFLAGS)
 201 $(PICS)  :=     CFLAGS += $(CTF_FLAGS)
 202 $(PICS)  :=     CFLAGS64 += $(CTF_FLAGS)
 203 $(PICS)  :=     CTFCONVERT_POST = $(CTFCONVERT_O)
 204 $(DYNLIB) :=    CTFMERGE_POST = $(CTFMERGE_LIB)
 205 
 206 $(LINTLIB):=    LOG = -DLOGGING
 207 $(LIBRARY):=    AROBJS = $(OBJS)
 208 $(LIBRARY):=    DIR = objs
 209 $(DYNLIB):=     DIR = pics
 210 $(DYNLIBCCC):=  DIR = pics
 211 
 212 SONAMECCC=      $(DYNLIBCCC)
 213 HSONAMECCC=     -h $(SONAMECCC)
 214 #
 215 # Keep in sync with the standard DYNFLAGS
 216 #
 217 $(DYNLIBCCC):=  DYNFLAGS = $(HSONAMECCC) $(ZTEXT) $(ZDEFS) $(ZASSERTDEFLIB) \
 218                 $(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%) \
 219                 $(BDIRECT) $(NORUNPATH)
 220 
 221 
 222 # build rule for "portable" source 
 223 objs/%.o pics/%.o: %.c
 224         $(COMPILE.c) -o $@ $<
 225         $(POST_PROCESS_O)
 226 
 227 objs/%.o pics/%.o: %.cc
 228         $(COMPILE.cc) -o $@ $<
 229         $(POST_PROCESS_O)
 230 
 231 .PRECIOUS: $(LIBS)
 232 
 233 # Define the majority text domain in this directory.
 234 TEXT_DOMAIN= SUNW_OST_OSLIB
 235 
 236 $(ROOTMAN3)/%: %.sunman
 237         $(INS.rename)