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>


 472 #
 473 # Flags used to build in debug mode for ctf generation.  Bugs in the Devpro
 474 # compilers currently prevent us from building with cc-emitted DWARF.
 475 #
 476 CTF_FLAGS_sparc = -g -Wc,-Qiselect-T1 $(CSTD) $(CNOGLOBAL) $(CDWARFSTR)
 477 CTF_FLAGS_i386  = -g $(CSTD) $(CNOGLOBAL) $(CDWARFSTR)
 478 
 479 CTF_FLAGS_sparcv9       = $(CTF_FLAGS_sparc)
 480 CTF_FLAGS_amd64         = $(CTF_FLAGS_i386)
 481 
 482 # Sun Studio produces broken userland code when saving arguments.
 483 $(__GNUC)CTF_FLAGS_amd64 += $(SAVEARGS)
 484 
 485 CTF_FLAGS_32    = $(CTF_FLAGS_$(MACH)) $(DEBUGFORMAT)
 486 CTF_FLAGS_64    = $(CTF_FLAGS_$(MACH64)) $(DEBUGFORMAT)
 487 CTF_FLAGS       = $(CTF_FLAGS_32)
 488 
 489 #
 490 # Flags used with genoffsets
 491 #
 492 GOFLAGS = -_noecho \
 493         $(CALLSYMS) \
 494         $(CDWARFSTR)
 495 
 496 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
 497         $(CC) $(GOFLAGS) $(CFLAGS) $(CPPFLAGS)
 498 
 499 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
 500         $(CC) $(GOFLAGS) $(CFLAGS64) $(CPPFLAGS)
 501 
 502 #
 503 # tradeoff time for space (smaller is better)
 504 #
 505 sparc_SPACEFLAG         = -xspace -W0,-Lt
 506 sparcv9_SPACEFLAG       = -xspace -W0,-Lt
 507 i386_SPACEFLAG          = -xspace
 508 amd64_SPACEFLAG         =
 509 
 510 SPACEFLAG               = $($(MACH)_SPACEFLAG)
 511 SPACEFLAG64             = $($(MACH64)_SPACEFLAG)
 512 
 513 #
 514 # The Sun Studio 11 compiler has changed the behaviour of integer
 515 # wrap arounds and so a flag is needed to use the legacy behaviour
 516 # (without this flag panics/hangs could be exposed within the source).
 517 #
 518 sparc_IROPTFLAG         = -W2,-xwrap_int
 519 sparcv9_IROPTFLAG       = -W2,-xwrap_int
 520 i386_IROPTFLAG          =


 769                 $(ALWAYS_LINT_DEFS)
 770 LINT.s=         $(LINT.c)
 771 
 772 # For some future builds, NATIVE_MACH and MACH might be different.
 773 # Therefore, NATIVE_MACH needs to be redefined in the
 774 # environment as `uname -p` to override this macro.
 775 #
 776 # For now at least, we cross-compile amd64 on i386 machines.
 777 NATIVE_MACH=    $(MACH:amd64=i386)
 778 
 779 # Define native compilation macros
 780 #
 781 
 782 # Base directory where compilers are loaded.
 783 # Defined here so it can be overridden by developer.
 784 #
 785 SPRO_ROOT=              $(BUILD_TOOLS)/SUNWspro
 786 SPRO_VROOT=             $(SPRO_ROOT)/SS12
 787 GNU_ROOT=               /usr
 788 









 789 # Till SS12u1 formally becomes the NV CBE, LINT is hard
 790 # coded to be picked up from the $SPRO_ROOT/sunstudio12.1/
 791 # location. Impacted variables are sparc_LINT, sparcv9_LINT,
 792 # i386_LINT, amd64_LINT.
 793 # Reset them when SS12u1 is rolled out.
 794 #
 795 
 796 # Specify platform compiler versions for languages
 797 # that we use (currently only c and c++).
 798 #
 799 sparc_CC=               $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
 800 $(__GNUC)sparc_CC=      $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
 801 sparc_CCC=              $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
 802 $(__GNUC)sparc_CCC=     $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
 803 sparc_CPP=              /usr/ccs/lib/cpp
 804 sparc_AS=               /usr/ccs/bin/as -xregsym=no
 805 sparc_LD=               /usr/ccs/bin/ld
 806 sparc_LINT=             $(SPRO_ROOT)/sunstudio12.1/bin/lint
 807 
 808 sparcv9_CC=             $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
 809 $(__GNUC64)sparcv9_CC=  $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
 810 sparcv9_CCC=            $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
 811 $(__GNUC64)sparcv9_CCC= $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
 812 sparcv9_CPP=            /usr/ccs/lib/cpp
 813 sparcv9_AS=             /usr/ccs/bin/as -xregsym=no
 814 sparcv9_LD=             /usr/ccs/bin/ld
 815 sparcv9_LINT=           $(SPRO_ROOT)/sunstudio12.1/bin/lint
 816 
 817 i386_CC=                $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
 818 $(__GNUC)i386_CC=       $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
 819 i386_CCC=               $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
 820 $(__GNUC)i386_CCC=      $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
 821 i386_CPP=               /usr/ccs/lib/cpp









 822 i386_AS=                /usr/ccs/bin/as
 823 $(__GNUC)i386_AS=       $(ONBLD_TOOLS)/bin/$(MACH)/aw
 824 i386_LD=                /usr/ccs/bin/ld
 825 i386_LINT=              $(SPRO_ROOT)/sunstudio12.1/bin/lint
 826 
 827 amd64_CC=               $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
 828 $(__GNUC64)amd64_CC=    $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
 829 amd64_CCC=              $(ONBLD_TOOLS)/bin/$(MACH)/cw -_CC
 830 $(__GNUC64)amd64_CCC=   $(ONBLD_TOOLS)/bin/$(MACH)/cw -_g++
 831 amd64_CPP=              /usr/ccs/lib/cpp
 832 amd64_AS=               $(ONBLD_TOOLS)/bin/$(MACH)/aw
 833 amd64_LD=               /usr/ccs/bin/ld
 834 amd64_LINT=             $(SPRO_ROOT)/sunstudio12.1/bin/lint
 835 
 836 NATIVECC=               $($(NATIVE_MACH)_CC)
 837 NATIVECCC=              $($(NATIVE_MACH)_CCC)
 838 NATIVECPP=              $($(NATIVE_MACH)_CPP)
 839 NATIVEAS=               $($(NATIVE_MACH)_AS)
 840 NATIVELD=               $($(NATIVE_MACH)_LD)
 841 NATIVELINT=             $($(NATIVE_MACH)_LINT)
 842 
 843 #
 844 # Makefile.master.64 overrides these settings
 845 #
 846 CC=                     $(NATIVECC)
 847 CCC=                    $(NATIVECCC)
 848 CPP=                    $(NATIVECPP)
 849 AS=                     $(NATIVEAS)
 850 LD=                     $(NATIVELD)
 851 LINT=                   $(NATIVELINT)
 852 
 853 # The real compilers used for this build
 854 CW_CC_CMD=              $(CC) -_compiler
 855 CW_CCC_CMD=             $(CCC) -_compiler
 856 REAL_CC=                $(CW_CC_CMD:sh)
 857 REAL_CCC=               $(CW_CCC_CMD:sh)
 858 
 859 # Pass -Y flag to cpp (method of which is release-dependent)
 860 CCYFLAG=                -Y I,
 861 
 862 BDIRECT=        -Bdirect
 863 BDYNAMIC=       -Bdynamic
 864 BLOCAL=         -Blocal
 865 BNODIRECT=      -Bnodirect
 866 BREDUCE=        -Breduce
 867 BSTATIC=        -Bstatic
 868 
 869 ZDEFS=          -zdefs
 870 ZDIRECT=        -zdirect
 871 ZIGNORE=        -zignore
 872 ZINITFIRST=     -zinitfirst
 873 ZINTERPOSE=     -zinterpose
 874 ZLAZYLOAD=      -zlazyload
 875 ZLOADFLTR=      -zloadfltr
 876 ZMULDEFS=       -zmuldefs
 877 ZNODEFAULTLIB=  -znodefaultlib
 878 ZNODEFS=        -znodefs




 472 #
 473 # Flags used to build in debug mode for ctf generation.  Bugs in the Devpro
 474 # compilers currently prevent us from building with cc-emitted DWARF.
 475 #
 476 CTF_FLAGS_sparc = -g -Wc,-Qiselect-T1 $(CSTD) $(CNOGLOBAL) $(CDWARFSTR)
 477 CTF_FLAGS_i386  = -g $(CSTD) $(CNOGLOBAL) $(CDWARFSTR)
 478 
 479 CTF_FLAGS_sparcv9       = $(CTF_FLAGS_sparc)
 480 CTF_FLAGS_amd64         = $(CTF_FLAGS_i386)
 481 
 482 # Sun Studio produces broken userland code when saving arguments.
 483 $(__GNUC)CTF_FLAGS_amd64 += $(SAVEARGS)
 484 
 485 CTF_FLAGS_32    = $(CTF_FLAGS_$(MACH)) $(DEBUGFORMAT)
 486 CTF_FLAGS_64    = $(CTF_FLAGS_$(MACH64)) $(DEBUGFORMAT)
 487 CTF_FLAGS       = $(CTF_FLAGS_32)
 488 
 489 #
 490 # Flags used with genoffsets
 491 #
 492 GOFLAGS = $(CALLSYMS) $(CDWARFSTR)


 493 
 494 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
 495         $(CW) --noecho $(CW_CC_COMPILERS) -- $(GOFLAGS) $(CFLAGS) $(CPPFLAGS)
 496 
 497 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
 498         $(CW) --noecho $(CW_CC_COMPILERS) -- $(GOFLAGS) $(CFLAGS64) $(CPPFLAGS)
 499 
 500 #
 501 # tradeoff time for space (smaller is better)
 502 #
 503 sparc_SPACEFLAG         = -xspace -W0,-Lt
 504 sparcv9_SPACEFLAG       = -xspace -W0,-Lt
 505 i386_SPACEFLAG          = -xspace
 506 amd64_SPACEFLAG         =
 507 
 508 SPACEFLAG               = $($(MACH)_SPACEFLAG)
 509 SPACEFLAG64             = $($(MACH64)_SPACEFLAG)
 510 
 511 #
 512 # The Sun Studio 11 compiler has changed the behaviour of integer
 513 # wrap arounds and so a flag is needed to use the legacy behaviour
 514 # (without this flag panics/hangs could be exposed within the source).
 515 #
 516 sparc_IROPTFLAG         = -W2,-xwrap_int
 517 sparcv9_IROPTFLAG       = -W2,-xwrap_int
 518 i386_IROPTFLAG          =


 767                 $(ALWAYS_LINT_DEFS)
 768 LINT.s=         $(LINT.c)
 769 
 770 # For some future builds, NATIVE_MACH and MACH might be different.
 771 # Therefore, NATIVE_MACH needs to be redefined in the
 772 # environment as `uname -p` to override this macro.
 773 #
 774 # For now at least, we cross-compile amd64 on i386 machines.
 775 NATIVE_MACH=    $(MACH:amd64=i386)
 776 
 777 # Define native compilation macros
 778 #
 779 
 780 # Base directory where compilers are loaded.
 781 # Defined here so it can be overridden by developer.
 782 #
 783 SPRO_ROOT=              $(BUILD_TOOLS)/SUNWspro
 784 SPRO_VROOT=             $(SPRO_ROOT)/SS12
 785 GNU_ROOT=               /usr
 786 
 787 $(__GNUC)PRIMARY_CC=    gcc4,$(GNUC_ROOT)/bin/gcc,gnu
 788 $(__SUNC)PRIMARY_CC=    studio12,$(SPRO_VROOT)/bin/cc,sun
 789 $(__GNUC)PRIMARY_CCC=   gcc4,$(GNUC_ROOT)/bin/g++,gnu
 790 $(__SUNC)PRIMARY_CCC=   studio12,$(SPRO_VROOT)/bin/CC,sun
 791 
 792 CW_CC_COMPILERS=        $(PRIMARY_CC:%=--primary %) $(SHADOW_CCS:%=--shadow %)
 793 CW_CCC_COMPILERS=       $(PRIMARY_CCC:%=--primary %) $(SHADOW_CCCS:%=--shadow %)
 794 
 795 
 796 # Till SS12u1 formally becomes the NV CBE, LINT is hard
 797 # coded to be picked up from the $SPRO_ROOT/sunstudio12.1/
 798 # location. Impacted variables are sparc_LINT, sparcv9_LINT,
 799 # i386_LINT, amd64_LINT.
 800 # Reset them when SS12u1 is rolled out.
 801 #
 802 
 803 # Specify platform compiler versions for languages
 804 # that we use (currently only c and c++).
 805 #
 806 CW=                     $(ONBLD_TOOLS)/bin/$(MACH)/cw







 807 
 808 BUILD_CC=               $(CW) $(CW_CC_COMPILERS) --
 809 BUILD_CCC=              $(CW) -C $(CW_CCC_COMPILERS) --
 810 BUILD_CPP=              /usr/ccs/lib/cpp
 811 BUILD_LD=               /usr/ccs/bin/ld
 812 BUILD_LINT=             $(SPRO_ROOT)/sunstudio12.1/bin/lint



 813 
 814 $(MACH)_CC=             $(BUILD_CC)
 815 $(MACH)_CCC=            $(BUILD_CCC)
 816 $(MACH)_CPP=            $(BUILD_CPP)
 817 $(MACH)_LD=             $(BUILD_LD)
 818 $(MACH)_LINT=           $(BUILD_LINT)
 819 $(MACH64)_CC=           $(BUILD_CC)
 820 $(MACH64)_CCC=          $(BUILD_CCC)
 821 $(MACH64)_CPP=          $(BUILD_CPP)
 822 $(MACH64)_LD=           $(BUILD_LD)
 823 $(MACH64)_LINT=         $(BUILD_LINT)
 824 
 825 sparc_AS=               /usr/ccs/bin/as -xregsym=no
 826 sparcv9_AS=             $($(MACH)_AS)
 827 
 828 i386_AS=                /usr/ccs/bin/as
 829 $(__GNUC)i386_AS=       $(ONBLD_TOOLS)/bin/$(MACH)/aw








 830 amd64_AS=               $(ONBLD_TOOLS)/bin/$(MACH)/aw


 831 
 832 NATIVECC=               $($(NATIVE_MACH)_CC)
 833 NATIVECCC=              $($(NATIVE_MACH)_CCC)
 834 NATIVECPP=              $($(NATIVE_MACH)_CPP)
 835 NATIVEAS=               $($(NATIVE_MACH)_AS)
 836 NATIVELD=               $($(NATIVE_MACH)_LD)
 837 NATIVELINT=             $($(NATIVE_MACH)_LINT)
 838 
 839 #
 840 # Makefile.master.64 overrides these settings
 841 #
 842 CC=                     $(NATIVECC)
 843 CCC=                    $(NATIVECCC)
 844 CPP=                    $(NATIVECPP)
 845 AS=                     $(NATIVEAS)
 846 LD=                     $(NATIVELD)
 847 LINT=                   $(NATIVELINT)
 848 






 849 # Pass -Y flag to cpp (method of which is release-dependent)
 850 CCYFLAG=                -Y I,
 851 
 852 BDIRECT=        -Bdirect
 853 BDYNAMIC=       -Bdynamic
 854 BLOCAL=         -Blocal
 855 BNODIRECT=      -Bnodirect
 856 BREDUCE=        -Breduce
 857 BSTATIC=        -Bstatic
 858 
 859 ZDEFS=          -zdefs
 860 ZDIRECT=        -zdirect
 861 ZIGNORE=        -zignore
 862 ZINITFIRST=     -zinitfirst
 863 ZINTERPOSE=     -zinterpose
 864 ZLAZYLOAD=      -zlazyload
 865 ZLOADFLTR=      -zloadfltr
 866 ZMULDEFS=       -zmuldefs
 867 ZNODEFAULTLIB=  -znodefaultlib
 868 ZNODEFS=        -znodefs