Print this page
9852 enable ld(1) guidance and deflib assertions for the illumos build

Split Close
Expand all
Collapse all
          --- old/usr/src/Makefile.master
          +++ new/usr/src/Makefile.master
↓ open down ↓ 32 lines elided ↑ open up ↑
  33   33  #
  34   34  # Makefile.master, global definitions for system source
  35   35  #
  36   36  ROOT=           /proto
  37   37  
  38   38  #
  39   39  # Adjunct root, containing an additional proto area to be used for headers
  40   40  # and libraries.
  41   41  #
  42   42  ADJUNCT_PROTO=
       43 +# HAVE_ADJUNCT_PROTO - ADJUNCT_PROTO is set to a non-default value
       44 +# NO_ADJUNCT_PROTO - ADJUNCT_PROTO is unset
       45 +#
       46 +# This works by replacing any value in ADJUNCT_PROTO with POUND_SIGN, which
       47 +# only happens if it has some value, and then setting HAVE_ADJUNCT_PROTO
       48 +# oppositely.
       49 +NO_ADJUNCT_PROTO=$(ADJUNCT_PROTO:%=$(POUND_SIGN))
       50 +$(NO_ADJUNCT_PROTO)HAVE_ADJUNCT_PROTO=$(POUND_SIGN)
  43   51  
  44   52  #
  45   53  # Adjunct for building things that run on the build machine.
  46   54  #
  47   55  NATIVE_ADJUNCT= /usr
  48   56  
  49   57  #
  50   58  # RELEASE_BUILD should be cleared for final release builds.
  51   59  # NOT_RELEASE_BUILD is exactly what the name implies.
  52   60  #
↓ open down ↓ 633 lines elided ↑ open up ↑
 686  694  # LDLIBS32 and LDLIBS64 can be set in the environment to override the following
 687  695  # assignments.
 688  696  #
 689  697  # These environment settings make sure that no libraries are searched outside
 690  698  # of the local workspace proto area:
 691  699  #       LDLIBS32=-YP,$ROOT/lib:$ROOT/usr/lib
 692  700  #       LDLIBS64=-YP,$ROOT/lib/$MACH64:$ROOT/usr/lib/$MACH64
 693  701  #
 694  702  LDLIBS32 =      $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3)
 695  703  LDLIBS32 +=     $(ADJUNCT_PROTO:%=-L%/usr/lib -L%/lib)
 696      -LDLIBS.cmd =    $(LDLIBS32)
      704 +LDLIBS.cmd =    $(LDLIBS32)
 697  705  LDLIBS.lib =    $(LDLIBS32)
 698  706  
 699  707  LDLIBS64 =      $(ENVLDLIBS1:%=%/$(MACH64)) \
 700  708                  $(ENVLDLIBS2:%=%/$(MACH64)) \
 701  709                  $(ENVLDLIBS3:%=%/$(MACH64))
 702  710  LDLIBS64 +=     $(ADJUNCT_PROTO:%=-L%/usr/lib/$(MACH64) -L%/lib/$(MACH64))
 703  711  
 704  712  #
 705  713  # Define compilation macros.
 706  714  #
↓ open down ↓ 12 lines elided ↑ open up ↑
 719  727  COMPILE.java=   $(JAVAC) $(JAVAFLAGS) -classpath $(CLASSPATH)
 720  728  
 721  729  #
 722  730  # Link time macros
 723  731  #
 724  732  CCNEEDED                = -lC
 725  733  CCEXTNEEDED             = -lCrun -lCstd
 726  734  $(__GNUC)CCNEEDED       = -L$(GCCLIBDIR) -lstdc++ -lgcc_s
 727  735  $(__GNUC)CCEXTNEEDED    = $(CCNEEDED)
 728  736  
 729      -LINK.c=         $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
 730      -LINK64.c=       $(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS)
      737 +# Libraries we expect to find in ADJUNCT_PROTO
      738 +ADJUNCT_LIBS=
      739 +# Libraries we expect to use natively on the build machine
      740 +NATIVE_LIBS=
      741 +
      742 +LDCHECKS                = $(ZASSERTDEFLIB) $(ZGUIDANCE) $(ZFATALWARNINGS)
      743 +LDCHECKS                += $(NATIVE_LIBS:%=$(ZASSERTDEFLIB)=%)
      744 +$(NO_ADJUNCT_PROTO)LDCHECKS += $(ADJUNCT_LIBS:%=$(ZASSERTDEFLIB)=%)
      745 +
      746 +LINK.c=         $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LDCHECKS)
      747 +LINK64.c=       $(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS) $(LDCHECKS)
 731  748  NORUNPATH=      -norunpath -nolib
 732  749  LINK.cc=        $(CCC) $(CCFLAGS) $(CPPFLAGS) $(NORUNPATH) \
 733      -                $(LDFLAGS) $(CCNEEDED)
      750 +                $(LDFLAGS) $(CCNEEDED) $(LDCHECKS)
 734  751  LINK64.cc=      $(CCC) $(CCFLAGS64) $(CPPFLAGS) $(NORUNPATH) \
 735      -                $(LDFLAGS) $(CCNEEDED)
      752 +                $(LDFLAGS) $(CCNEEDED) $(LDCHECKS)
 736  753  
 737  754  #
 738  755  # lint macros
 739  756  #
 740  757  # Note that the undefine of __PRAGMA_REDEFINE_EXTNAME can be removed once
 741  758  # ON is built with a version of lint that has the fix for 4484186.
 742  759  #
 743  760  ALWAYS_LINT_DEFS =      -errtags=yes -s
 744  761  ALWAYS_LINT_DEFS +=     -erroff=E_PTRDIFF_OVERFLOW
 745  762  ALWAYS_LINT_DEFS +=     -erroff=E_ASSIGN_NARROW_CONV
↓ open down ↓ 134 lines elided ↑ open up ↑
 880  897  ZNODLOPEN=      -znodlopen
 881  898  ZNODUMP=        -znodump
 882  899  ZNOLAZYLOAD=    -znolazyload
 883  900  ZNOLDYNSYM=     -znoldynsym
 884  901  ZNORELOC=       -znoreloc
 885  902  ZNOVERSION=     -znoversion
 886  903  ZRECORD=        -zrecord
 887  904  ZREDLOCSYM=     -zredlocsym
 888  905  ZTEXT=          -ztext
 889  906  ZVERBOSE=       -zverbose
      907 +ZASSERTDEFLIB=  -zassert-deflib
      908 +ZGUIDANCE=      -zguidance
      909 +ZFATALWARNINGS= -zfatal-warnings
 890  910  
 891  911  GSHARED=        -G
 892  912  CCMT=           -mt
 893  913  
 894  914  # Handle different PIC models on different ISAs
 895  915  # (May be overridden by lower-level Makefiles)
 896  916  
 897  917  sparc_C_PICFLAGS =      -K pic
 898  918  sparcv9_C_PICFLAGS =    -K pic
 899  919  i386_C_PICFLAGS =       -K pic
↓ open down ↓ 4 lines elided ↑ open up ↑
 904  924  sparc_C_BIGPICFLAGS =   -K PIC
 905  925  sparcv9_C_BIGPICFLAGS = -K PIC
 906  926  i386_C_BIGPICFLAGS =    -K PIC
 907  927  amd64_C_BIGPICFLAGS =   -K PIC
 908  928  C_BIGPICFLAGS =         $($(MACH)_C_BIGPICFLAGS)
 909  929  C_BIGPICFLAGS64 =       $($(MACH64)_C_BIGPICFLAGS)
 910  930  
 911  931  # CC requires there to be no space between '-K' and 'pic' or 'PIC'.
 912  932  sparc_CC_PICFLAGS =     -Kpic
 913  933  sparcv9_CC_PICFLAGS =   -KPIC
 914      -i386_CC_PICFLAGS =      -Kpic
 915      -amd64_CC_PICFLAGS =     -Kpic
      934 +i386_CC_PICFLAGS =      -Kpic
      935 +amd64_CC_PICFLAGS =     -Kpic
 916  936  CC_PICFLAGS =           $($(MACH)_CC_PICFLAGS)
 917  937  CC_PICFLAGS64 =         $($(MACH64)_CC_PICFLAGS)
 918  938  
 919  939  AS_PICFLAGS=            $(C_PICFLAGS)
 920  940  AS_BIGPICFLAGS=         $(C_BIGPICFLAGS)
 921  941  
 922  942  #
 923  943  # Default label for CTF sections
 924  944  #
 925  945  CTFCVTFLAGS=            -i -L VERSION
↓ open down ↓ 31 lines elided ↑ open up ↑
 957  977  #               add the standard comment (mcs -a $(RELEASE_CM))
 958  978  #               add the development specific comment (mcs -a $(DEV_CM))
 959  979  #
 960  980  #       If this is an release build:
 961  981  #               delete the comment section (mcs -d)
 962  982  #               add the standard comment (mcs -a $(RELEASE_CM))
 963  983  #
 964  984  # The following list of macros are used in the definition of RELEASE_CM
 965  985  # which is used to label all binaries in the build:
 966  986  #
 967      -#       RELEASE         Specific release of the build, eg: 5.2
      987 +#       RELEASE         Specific release of the build, eg: 5.2
 968  988  #       RELEASE_MAJOR   Major version number part of $(RELEASE)
 969  989  #       RELEASE_MINOR   Minor version number part of $(RELEASE)
 970  990  #       VERSION         Version of the build (alpha, beta, Generic)
 971  991  #       PATCHID         If this is a patch this value should contain
 972  992  #                       the patchid value (eg: "Generic 100832-01"), otherwise
 973  993  #                       it will be set to $(VERSION)
 974  994  #       RELEASE_DATE    Date of the Release Build
 975  995  #       PATCH_DATE      Date the patch was created, if this is blank it
 976  996  #                       will default to the RELEASE_DATE
 977  997  #
↓ open down ↓ 6 lines elided ↑ open up ↑
 984 1004  PATCH_DATE=     $(RELEASE_DATE)
 985 1005  RELEASE_CM=     "@($(POUND_SIGN))SunOS $(RELEASE) $(PATCHID) $(PATCH_DATE)"
 986 1006  DEV_CM=         "@($(POUND_SIGN))SunOS Internal Development: non-nightly build"
 987 1007  
 988 1008  PROCESS_COMMENT=  @?${MCS} -d -a $(RELEASE_CM) -a $(DEV_CM)
 989 1009  $(RELEASE_BUILD)PROCESS_COMMENT=   @?${MCS} -d -a $(RELEASE_CM)
 990 1010  
 991 1011  STRIP_STABS=                       $(STRIP) -x $@
 992 1012  $(SRCDBGBLD)STRIP_STABS=           :
 993 1013  
 994      -POST_PROCESS_O= 
     1014 +POST_PROCESS_O=
 995 1015  POST_PROCESS_A=
 996 1016  POST_PROCESS_SO=        $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
 997 1017                          $(ELFSIGN_OBJECT)
 998 1018  POST_PROCESS=           $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
 999 1019                          $(ELFSIGN_OBJECT)
1000 1020  
1001 1021  #
1002 1022  # chk4ubin is a tool that inspects a module for a symbol table
1003 1023  # ELF section size which can trigger an OBP bug on older platforms.
1004 1024  # This problem affects only specific sun4u bootable modules.
↓ open down ↓ 78 lines elided ↑ open up ↑
1083 1103  
1084 1104  .java.class:
1085 1105          $(COMPILE.java) $<
1086 1106  
1087 1107  # Bourne and Korn shell script message catalog build rules.
1088 1108  # We extract all gettext strings with sed(1) (being careful to permit
1089 1109  # multiple gettext strings on the same line), weed out the dups, and
1090 1110  # build the catalogue with awk(1).
1091 1111  
1092 1112  .sh.po .ksh.po:
1093      -        $(SED) -n -e ":a"                               \
1094      -                  -e "h"                                        \
     1113 +        $(SED) -n -e ":a"                                       \
     1114 +                  -e "h"                                        \
1095 1115                    -e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p"       \
1096 1116                    -e "x"                                        \
1097 1117                    -e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/"  \
1098 1118                    -e "t a"                                      \
1099 1119                 $< | sort -u | $(AWK) '{ print "msgid\t" $$0 "\nmsgstr" }' > $@
1100 1120  
1101 1121  #
1102 1122  # Python and Perl executable and message catalog build rules.
1103 1123  #
1104 1124  .SUFFIXES: .pl .pm .py .pyc
↓ open down ↓ 85 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX