Print this page
5196 The cw wrapper restricts gcc to -O2

Split Close
Expand all
Collapse all
          --- old/usr/src/Makefile.master
          +++ new/usr/src/Makefile.master
↓ open down ↓ 15 lines elided ↑ open up ↑
  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  
  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 +# Copyright 2014 Gary Mills
  26   27  #
  27   28  
  28   29  #
  29   30  # Makefile.master, global definitions for system source
  30   31  #
  31   32  ROOT=           /proto
  32   33  
  33   34  #
  34   35  # Adjunct root, containing an additional proto area to be used for headers
  35   36  # and libraries.
↓ open down ↓ 371 lines elided ↑ open up ↑
 407  408  sparcv9_CFLAGS= $(sparcv9_XARCH) -dalign $(CCVERBOSE) $(V9ABIWARN) $(CCREGSYM) \
 408  409                  $(CCSTATICSYM)
 409  410  i386_CFLAGS=    $(i386_XARCH)
 410  411  amd64_CFLAGS=   $(amd64_XARCH)
 411  412  
 412  413  sparc_ASFLAGS=  $(sparc_AS_XARCH)
 413  414  sparcv9_ASFLAGS=$(sparcv9_AS_XARCH)
 414  415  i386_ASFLAGS=   $(i386_AS_XARCH)
 415  416  amd64_ASFLAGS=  $(amd64_AS_XARCH)
 416  417  
 417      -#
 418      -sparc_COPTFLAG=         -xO3
 419      -sparcv9_COPTFLAG=       -xO3
 420      -i386_COPTFLAG=          -O
 421      -amd64_COPTFLAG=         -xO3
      418 +# Default adjustments to specified gcc optimization level
      419 +# 
      420 +# For -O and -O1
      421 +ADJUST_OPT1=
      422 +# For -O2
      423 +ADJUST_OPT2=            -_gcc=-fno-strict-aliasing \
      424 +                        -_gcc=-fno-unit-at-a-time \
      425 +                        -_gcc=-fno-optimize-sibling-calls
 422  426  
 423      -COPTFLAG= $($(MACH)_COPTFLAG)
 424      -COPTFLAG64= $($(MACH64)_COPTFLAG)
      427 +sparc_ADJCOPT=          $(ADJUST_OPT2)
      428 +sparcv9_ADJCOPT=        $(ADJUST_OPT2)
      429 +i386_ADJCOPT=           $(ADJUST_OPT1)
      430 +amd64_ADJCOPT=          $(ADJUST_OPT2)
 425  431  
      432 +# Symbols that can be redefined in individual Makefiles
      433 +ADJCOPT= $($(MACH)_ADJCOPT)
      434 +ADJCOPT64= $($(MACH64)_ADJCOPT)
      435 +
      436 +# These symbols are sometimes redefined in individual Makefiles
      437 +sparc_COPTFLAG=         -_cc=-xO3 -_gcc=-O2
      438 +sparcv9_COPTFLAG=       -_cc=-xO3 -_gcc=-O2
      439 +i386_COPTFLAG=          -_cc=-O -_gcc=-O
      440 +amd64_COPTFLAG=         -_cc=-xO3 -_gcc=-O2
      441 +
      442 +# Documented symbols that can be redefined in individual Makefiles
      443 +COPTFLAG= $(ADJCOPT) $($(MACH)_COPTFLAG)
      444 +COPTFLAG64= $(ADJCOPT64) $($(MACH64)_COPTFLAG)
      445 +
 426  446  # When -g is used, the compiler globalizes static objects
 427  447  # (gives them a unique prefix). Disable that.
 428  448  CNOGLOBAL= -W0,-noglobal
 429  449  
 430  450  # Direct the Sun Studio compiler to use a static globalization prefix based on the
 431  451  # name of the module rather than something unique. Otherwise, objects
 432  452  # will not build deterministically, as subsequent compilations of identical
 433  453  # source will yeild objects that always look different.
 434  454  #
 435  455  # In the same spirit, this will also remove the date from the N_OPT stab.
↓ open down ↓ 160 lines elided ↑ open up ↑
 596  616                          $(CCERRWARN)
 597  617  i386_CCFLAGS=           -compat=4 \
 598  618                          -Qoption ccfe -messages=no%anachronism \
 599  619                          -Qoption ccfe -features=no%conststrings \
 600  620                          $(CCERRWARN)
 601  621  amd64_CCFLAGS=          $(amd64_XARCH) -compat=5 \
 602  622                          -Qoption ccfe -messages=no%anachronism \
 603  623                          -Qoption ccfe -features=no%conststrings \
 604  624                          $(CCERRWARN)
 605  625  
 606      -sparc_CCOPTFLAG=        -O
 607      -sparcv9_CCOPTFLAG=      -O
 608      -i386_CCOPTFLAG=         -O
 609      -amd64_CCOPTFLAG=        -O
      626 +sparc_CCOPTFLAG=        -_CC=-O -_g++=-O
      627 +sparcv9_CCOPTFLAG=      -_CC=-O -_g++=-O
      628 +i386_CCOPTFLAG=         -_CC=-O -_g++=-O
      629 +amd64_CCOPTFLAG=        -_CC=-O -_g++=-O
 610  630  
 611      -CCOPTFLAG=      $($(MACH)_CCOPTFLAG)
 612      -CCOPTFLAG64=    $($(MACH64)_CCOPTFLAG)
 613      -CCFLAGS=        $(CCOPTFLAG) $($(MACH)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
 614      -                $(CCUSERFLAGS)
 615      -CCFLAGS64=      $(CCOPTFLAG64) $($(MACH64)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
 616      -                $(CCUSERFLAGS64)
      631 +ADJCCOPT=       $(ADJUST_OPT1)
      632 +ADJCCOPT64=     $(ADJUST_OPT1)
 617  633  
      634 +CCOPTFLAG=      $(ADJCCOPT) $($(MACH)_CCOPTFLAG)
      635 +CCOPTFLAG64=    $(ADJCCOPT) $($(MACH64)_CCOPTFLAG)
      636 +CCFLAGS=        $(CCOPTFLAG) $($(MACH)_CCFLAGS) \
      637 +                $(CCSOURCEDEBUGFLAGS) $(CCUSERFLAGS)
      638 +CCFLAGS64=      $(CCOPTFLAG64) $($(MACH64)_CCFLAGS) \
      639 +                $(CCSOURCEDEBUGFLAGS) $(CCUSERFLAGS64)
      640 +
 618  641  #
 619  642  #
 620  643  #
 621  644  ELFWRAP_FLAGS   =
 622  645  ELFWRAP_FLAGS64 =       -64
 623  646  
 624  647  #
 625  648  # Various mapfiles that are used throughout the build, and delivered to
 626  649  # /usr/lib/ld.
 627  650  #
↓ open down ↓ 541 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX