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

Split Close
Expand all
Collapse all
          --- old/usr/src/Makefile.master
          +++ new/usr/src/Makefile.master
↓ open down ↓ 19 lines elided ↑ open up ↑
  20   20  #
  21   21  
  22   22  #
  23   23  # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24  # Copyright (c) 2012 by Delphix. All rights reserved.
  25   25  # Copyright 2014 Garrett D'Amore <garrett@damore.org>
  26   26  # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
  27   27  # Copyright 2015 Gary Mills
  28   28  # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
  29   29  # Copyright 2016 Toomas Soome <tsoome@me.com>
       30 +# Copyright 2017 RackTop Systems.
  30   31  #
  31   32  
  32   33  #
  33   34  # Makefile.master, global definitions for system source
  34   35  #
  35   36  ROOT=           /proto
  36   37  
  37   38  #
  38   39  # Adjunct root, containing an additional proto area to be used for headers
  39   40  # and libraries.
↓ open down ↓ 52 lines elided ↑ open up ↑
  92   93  #
  93   94  # The following version-specific options are operative regardless of which
  94   95  # compiler is primary, and control the versions of the given compilers to be
  95   96  # used.  They also allow compiler-version specific Makefile fragments.
  96   97  #
  97   98  
  98   99  __SUNC=                 $(POUND_SIGN)
  99  100  $(__SUNC)__GNUC=        $(POUND_SIGN)
 100  101  __GNUC64=               $(__GNUC)
 101  102  
      103 +# If ADJUNCT_PROTO was set we set ADJUNCT_PROTO_NOT_SET to POUND_SIGN so
      104 +# we can use it to turn off the -zassert-deflib exceptions that allow
      105 +# linking against host libraries.
      106 +ADJUNCT_PROTO_NOT_SET=          $(ADJUNCT_PROTO:%=$(POUND_SIGN))
      107 +$(ADJUNCT_PROTO_NOT_SET)ADJUNCT_PROTO_SET=      $(POUND_SIGN)
      108 +
 102  109  # Allow build-time "configuration" to enable or disable some things.
 103  110  # The default is POUND_SIGN, meaning "not enabled". If the environment
 104  111  # passes in an override like ENABLE_SMB_PRINTING= (empty) that will
 105  112  # uncomment things in the lower Makefiles to enable the feature.
 106  113  ENABLE_SMB_PRINTING=    $(POUND_SIGN)
 107  114  
 108  115  # CLOSED is the root of the tree that contains source which isn't released
 109  116  # as open source
 110  117  CLOSED=         $(SRC)/../closed
 111  118  
↓ open down ↓ 553 lines elided ↑ open up ↑
 665  672  #
 666  673  # A generic interface mapfile name, used by various dynamic objects to define
 667  674  # the interfaces and interposers the object must export.
 668  675  #
 669  676  MAPFILE.INT =           mapfile-intf
 670  677  
 671  678  #
 672  679  # LDLIBS32 and LDLIBS64 can be set in the environment to override the following
 673  680  # assignments.
 674  681  #
 675      -# These environment settings make sure that no libraries are searched outside
 676      -# of the local workspace proto area:
 677      -#       LDLIBS32=-YP,$ROOT/lib:$ROOT/usr/lib
 678      -#       LDLIBS64=-YP,$ROOT/lib/$MACH64:$ROOT/usr/lib/$MACH64
 679      -#
 680  682  LDLIBS32 =      $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3)
 681  683  LDLIBS32 +=     $(ADJUNCT_PROTO:%=-L%/usr/lib -L%/lib)
 682  684  LDLIBS.cmd =    $(LDLIBS32)
 683  685  LDLIBS.lib =    $(LDLIBS32)
 684  686  
 685  687  LDLIBS64 =      $(ENVLDLIBS1:%=%/$(MACH64)) \
 686  688                  $(ENVLDLIBS2:%=%/$(MACH64)) \
 687  689                  $(ENVLDLIBS3:%=%/$(MACH64))
 688  690  LDLIBS64 +=     $(ADJUNCT_PROTO:%=-L%/usr/lib/$(MACH64) -L%/lib/$(MACH64))
 689  691  
 690  692  #
      693 +# Defines to be used when overriding the default search path with -YP.
      694 +#
      695 +DEFLDPATH =     /lib:/usr/lib
      696 +DEFLDPATH64 =   /lib/64:/usr/lib/64
      697 +
      698 +#
 691  699  # Define compilation macros.
 692  700  #
 693  701  COMPILE.c=      $(CC) $(CFLAGS) $(CPPFLAGS) -c
 694  702  COMPILE64.c=    $(CC) $(CFLAGS64) $(CPPFLAGS) -c
 695  703  COMPILE.cc=     $(CCC) $(CCFLAGS) $(CPPFLAGS) -c
 696  704  COMPILE64.cc=   $(CCC) $(CCFLAGS64) $(CPPFLAGS) -c
 697  705  COMPILE.s=      $(AS) $(ASFLAGS) $(AS_CPPFLAGS)
 698  706  COMPILE64.s=    $(AS) $(ASFLAGS) $($(MACH64)_AS_XARCH) $(AS_CPPFLAGS)
 699  707  COMPILE.d=      $(DTRACE) -G -32
 700  708  COMPILE64.d=    $(DTRACE) -G -64
↓ open down ↓ 165 lines elided ↑ open up ↑
 866  874  ZNODLOPEN=      -znodlopen
 867  875  ZNODUMP=        -znodump
 868  876  ZNOLAZYLOAD=    -znolazyload
 869  877  ZNOLDYNSYM=     -znoldynsym
 870  878  ZNORELOC=       -znoreloc
 871  879  ZNOVERSION=     -znoversion
 872  880  ZRECORD=        -zrecord
 873  881  ZREDLOCSYM=     -zredlocsym
 874  882  ZTEXT=          -ztext
 875  883  ZVERBOSE=       -zverbose
      884 +ZASSERTDEFLIB=  -zassert-deflib
 876  885  
 877  886  GSHARED=        -G
 878  887  CCMT=           -mt
 879  888  
 880  889  # Handle different PIC models on different ISAs
 881  890  # (May be overridden by lower-level Makefiles)
 882  891  
 883  892  sparc_C_PICFLAGS =      -K pic
 884  893  sparcv9_C_PICFLAGS =    -K pic
 885  894  i386_C_PICFLAGS =       -K pic
↓ open down ↓ 290 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX