Print this page
9128 cw(1onbld) should be able to run multiple shadows
9129 file-locking tests shouldn't build multiple source files in one compiler invocation
9130 DTrace tst.gcc.d isn't useful
9132 cw(1onbld) shouldn't shadow pure preprocessing
Reviewed by: Andy Fiddaman <omnios@citrus-it.net>

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/env/illumos.sh
          +++ new/usr/src/tools/env/illumos.sh
↓ open down ↓ 32 lines elided ↑ open up ↑
  33   33  #       DEBUG build only (-D, -F)
  34   34  #       do not bringover from the parent (-n)
  35   35  #       runs 'make check' (-C)
  36   36  #       checks for new interfaces in libraries (-A)
  37   37  #       runs lint in usr/src (-l plus the LINTDIRS variable)
  38   38  #       sends mail on completion (-m and the MAILTO variable)
  39   39  #       creates packages for PIT/RE (-p)
  40   40  #       checks for changes in ELF runpaths (-r)
  41   41  #       build and use this workspace's tools in $SRC/tools (-t)
  42   42  #
  43      -# - This file is sourced by "bldenv.sh" and "nightly.sh" and should not 
       43 +# - This file is sourced by "bldenv.sh" and "nightly.sh" and should not
  44   44  #   be executed directly.
  45   45  # - This script is only interpreted by ksh93 and explicitly allows the
  46   46  #   use of ksh93 language extensions.
  47   47  #
  48   48  export NIGHTLY_OPTIONS='-FnCDAlmprt'
  49   49  
  50   50  # CODEMGR_WS - where is your workspace at
  51   51  #export CODEMGR_WS="$HOME/ws/illumos-gate"
  52   52  export CODEMGR_WS="`git rev-parse --show-toplevel`"
  53   53  
  54   54  # Maximum number of dmake jobs.  The recommended number is 2 + NCPUS,
  55   55  # where NCPUS is the number of logical CPUs on your build system.
  56   56  function maxjobs
  57   57  {
  58   58          nameref maxjobs=$1
  59   59          integer ncpu
  60   60          integer -r min_mem_per_job=512 # minimum amount of memory for a job
  61   61  
  62   62          ncpu=$(builtin getconf ; getconf 'NPROCESSORS_ONLN')
  63   63          (( maxjobs=ncpu + 2 ))
  64      -        
       64 +
  65   65          # Throttle number of parallel jobs launched by dmake to a value which
  66   66          # gurantees that all jobs have enough memory. This was added to avoid
  67   67          # excessive paging/swapping in cases of virtual machine installations
  68   68          # which have lots of CPUs but not enough memory assigned to handle
  69   69          # that many parallel jobs
  70   70          if [[ $(/usr/sbin/prtconf 2>'/dev/null') == ~(E)Memory\ size:\ ([[:digit:]]+)\ Megabytes ]] ; then
  71   71                  integer max_jobs_per_memory # parallel jobs which fit into physical memory
  72   72                  integer physical_memory # physical memory installed
  73   73  
  74   74                  # The array ".sh.match" contains the contents of capturing
  75   75                  # brackets in the last regex, .sh.match[1] will contain
  76   76                  # the value matched by ([[:digit:]]+), i.e. the amount of
  77   77                  # memory installed
  78   78                  physical_memory="10#${.sh.match[1]}"
  79      -                
       79 +
  80   80                  ((
  81   81                          max_jobs_per_memory=round(physical_memory/min_mem_per_job) ,
  82   82                          maxjobs=fmax(2, fmin(maxjobs, max_jobs_per_memory))
  83   83                  ))
  84   84          fi
  85   85  
  86   86          return 0
  87   87  }
  88   88  
  89   89  maxjobs DMAKE_MAX_JOBS # "DMAKE_MAX_JOBS" passed as ksh(1) name reference
↓ open down ↓ 99 lines elided ↑ open up ↑
 189  189  # variables allows you to get the compilers and onbld files locally.
 190  190  # Set BUILD_TOOLS to pull everything from one location.
 191  191  # Alternately, you can set ONBLD_TOOLS to where you keep the contents of
 192  192  # SUNWonbld and SPRO_ROOT to where you keep the compilers.  SPRO_VROOT
 193  193  # exists to make it easier to test new versions of the compiler.
 194  194  export BUILD_TOOLS='/opt'
 195  195  #export ONBLD_TOOLS='/opt/onbld'
 196  196  export SPRO_ROOT='/opt/SUNWspro'
 197  197  export SPRO_VROOT="$SPRO_ROOT"
 198  198  
 199      -# Disable shadow compilation by default.
 200      -export CW_NO_SHADOW='1'
      199 +# Compilers may be specified using the following variables:
      200 +# PRIMARY_CC    - primary C compiler
      201 +# PRIMARY_CCC   - primary C++ compiler
      202 +#
      203 +# SHADOW_CCS    - list of shadow C compilers
      204 +# SHADOW_CCCS   - list of shadow C++ compilers
      205 +#
      206 +# Each entry has the form <name>,<path to binary>,<style> where name is a
      207 +# free-form name (possibly used in the makefiles to guard options), path is
      208 +# the path to the executable.  style is the 'style' of command line taken by
      209 +# the compiler, currently either gnu (or gcc) or sun (or cc), which is also
      210 +# used by Makefiles to guard options.
      211 +#
      212 +# __SUNC and __GNUC must still be set to reflect the style of the primary
      213 +# compiler (and to influence the default primary, otherwise)
      214 +#
      215 +# for example:
      216 +# export PRIMARY_CC=gcc4,/opt/gcc/4.4.4/bin/gcc,gnu
      217 +# export PRIMARY_CCC=gcc4,/opt/gcc/4.4.4/bin/g++,gnu
      218 +# export SHADOW_CCS=studio12,/opt/SUNWspro/bin/cc,sun
      219 +# export SHADOW_CCCS=studio12,/opt/SUNWspro/bin/CC,sun
      220 +#
      221 +# There can be several space-separated entries in SHADOW_* to run multiple
      222 +# shadow compilers.
      223 +#
      224 +# To disable shadow compilation, unset SHADOW_* or set them to the empty string.
      225 +#
 201  226  
 202  227  # This goes along with lint - it is a series of the form "A [y|n]" which
 203  228  # means "go to directory A and run 'make lint'" Then mail me (y) the
 204  229  # difference in the lint output. 'y' should only be used if the area you're
 205  230  # linting is actually lint clean or you'll get lots of mail.
 206  231  # You shouldn't need to change this though.
 207  232  #export LINTDIRS="$SRC y"
 208  233  
 209  234  # Set this flag to 'n' to disable the use of 'checkpaths'.  The default,
 210  235  # if the 'N' option is not specified, is to run this test.
↓ open down ↓ 16 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX