Print this page
Code review comments


 467 COPTFLAG= $($(MACH)_COPTFLAG)
 468 COPTFLAG64= $($(MACH64)_COPTFLAG)
 469 
 470 # When -g is used, the compiler globalizes static objects
 471 # (gives them a unique prefix). Disable that.
 472 CNOGLOBAL= -W0,-noglobal
 473 
 474 # Direct the Sun Studio compiler to use a static globalization prefix based on the
 475 # name of the module rather than something unique. Otherwise, objects
 476 # will not build deterministically, as subsequent compilations of identical
 477 # source will yeild objects that always look different.
 478 #
 479 # In the same spirit, this will also remove the date from the N_OPT stab.
 480 CGLOBALSTATIC= -W0,-xglobalstatic
 481 
 482 # Sometimes we want all symbols and types in debugging information even
 483 # if they aren't used.
 484 CALLSYMS=       -W0,-xdbggen=no%usedonly
 485 
 486 #
 487 # Default debug format for Sun Studio 11 is dwarf, so force it to
 488 # generate stabs.

 489 #
 490 DEBUGFORMAT=    -_cc=-xdebugformat=stabs -_gcc=-gdwarf-2
 491 
 492 #
 493 # Ask the compiler to include debugging information
 494 #
 495 CCGDEBUG= -g $(DEBUGFORMAT)
 496 
 497 #
 498 # Flags used to build in debug mode for ctf generation.  Bugs in the Devpro
 499 # compilers currently prevent us from building with cc-emitted DWARF.
 500 #
 501 CTF_FLAGS_sparc = $(CCGDEBUG) -Wc,-Qiselect-T1 $(CSTD) $(CNOGLOBAL)
 502 CTF_FLAGS_i386  = $(CCGDEBUG) $(CSTD) $(CNOGLOBAL)
 503 
 504 CTF_FLAGS_sparcv9       = $(CTF_FLAGS_sparc)
 505 CTF_FLAGS_amd64         = $(CTF_FLAGS_i386)
 506 
 507 # Sun Studio produces broken userland code when saving arguments.
 508 $(__GNUC)CTF_FLAGS_amd64 += $(SAVEARGS)
 509 
 510 CTF_FLAGS_32    = $(CTF_FLAGS_$(MACH))
 511 CTF_FLAGS_64    = $(CTF_FLAGS_$(MACH64))
 512 CTF_FLAGS       = $(CTF_FLAGS_32)
 513 
 514 #
 515 # Flags used with genoffsets
 516 #
 517 GENOFFFLAGS = $(CALLSYMS)
 518 
 519 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
 520         $(CW) --noecho $(CW_CC_COMPILERS) -- $(GENOFFFLAGS) $(CFLAGS) $(CPPFLAGS)

 521 
 522 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
 523         $(CW) --noecho $(CW_CC_COMPILERS) -- $(GENOFFFLAGS) $(CFLAGS64) $(CPPFLAGS)

 524 
 525 #
 526 # tradeoff time for space (smaller is better)
 527 #
 528 sparc_SPACEFLAG         = -xspace -W0,-Lt
 529 sparcv9_SPACEFLAG       = -xspace -W0,-Lt
 530 i386_SPACEFLAG          = -xspace
 531 amd64_SPACEFLAG         =
 532 
 533 SPACEFLAG               = $($(MACH)_SPACEFLAG)
 534 SPACEFLAG64             = $($(MACH64)_SPACEFLAG)
 535 
 536 #
 537 # The Sun Studio 11 compiler has changed the behaviour of integer
 538 # wrap arounds and so a flag is needed to use the legacy behaviour
 539 # (without this flag panics/hangs could be exposed within the source).
 540 #
 541 sparc_IROPTFLAG         = -W2,-xwrap_int
 542 sparcv9_IROPTFLAG       = -W2,-xwrap_int
 543 i386_IROPTFLAG          =




 467 COPTFLAG= $($(MACH)_COPTFLAG)
 468 COPTFLAG64= $($(MACH64)_COPTFLAG)
 469 
 470 # When -g is used, the compiler globalizes static objects
 471 # (gives them a unique prefix). Disable that.
 472 CNOGLOBAL= -W0,-noglobal
 473 
 474 # Direct the Sun Studio compiler to use a static globalization prefix based on the
 475 # name of the module rather than something unique. Otherwise, objects
 476 # will not build deterministically, as subsequent compilations of identical
 477 # source will yeild objects that always look different.
 478 #
 479 # In the same spirit, this will also remove the date from the N_OPT stab.
 480 CGLOBALSTATIC= -W0,-xglobalstatic
 481 
 482 # Sometimes we want all symbols and types in debugging information even
 483 # if they aren't used.
 484 CALLSYMS=       -W0,-xdbggen=no%usedonly
 485 
 486 #
 487 # We force the compilers to generate the debugging information best understood
 488 # by the CTF tools.  With Sun Studio this is stabs due to bugs in the Studio
 489 # compilers.  With GCC this is DWARF v2.
 490 #
 491 DEBUGFORMAT=    -_cc=-xdebugformat=stabs -_gcc=-gdwarf-2
 492 
 493 #
 494 # Ask the compiler to include debugging information
 495 #
 496 CCGDEBUG= -g $(DEBUGFORMAT)
 497 
 498 #
 499 # Flags used to build in debug mode for ctf generation.  

 500 #
 501 CTF_FLAGS_sparc = $(CCGDEBUG) -Wc,-Qiselect-T1 $(CSTD) $(CNOGLOBAL)
 502 CTF_FLAGS_i386  = $(CCGDEBUG) $(CSTD) $(CNOGLOBAL)
 503 
 504 CTF_FLAGS_sparcv9       = $(CTF_FLAGS_sparc)
 505 CTF_FLAGS_amd64         = $(CTF_FLAGS_i386)
 506 
 507 # Sun Studio produces broken userland code when saving arguments.
 508 $(__GNUC)CTF_FLAGS_amd64 += $(SAVEARGS)
 509 
 510 CTF_FLAGS_32    = $(CTF_FLAGS_$(MACH))
 511 CTF_FLAGS_64    = $(CTF_FLAGS_$(MACH64))
 512 CTF_FLAGS       = $(CTF_FLAGS_32)
 513 
 514 #
 515 # Flags used with genoffsets
 516 #
 517 GENOFFSETS_FLAGS = $(CALLSYMS)
 518 
 519 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
 520         $(CW) --noecho $(CW_CC_COMPILERS) -- $(GENOFFSETS_FLAGS) \
 521         $(CFLAGS) $(CPPFLAGS)
 522 
 523 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
 524         $(CW) --noecho $(CW_CC_COMPILERS) -- $(GENOFFSETS_FLAGS) \
 525         $(CFLAGS64) $(CPPFLAGS)
 526 
 527 #
 528 # tradeoff time for space (smaller is better)
 529 #
 530 sparc_SPACEFLAG         = -xspace -W0,-Lt
 531 sparcv9_SPACEFLAG       = -xspace -W0,-Lt
 532 i386_SPACEFLAG          = -xspace
 533 amd64_SPACEFLAG         =
 534 
 535 SPACEFLAG               = $($(MACH)_SPACEFLAG)
 536 SPACEFLAG64             = $($(MACH64)_SPACEFLAG)
 537 
 538 #
 539 # The Sun Studio 11 compiler has changed the behaviour of integer
 540 # wrap arounds and so a flag is needed to use the legacy behaviour
 541 # (without this flag panics/hangs could be exposed within the source).
 542 #
 543 sparc_IROPTFLAG         = -W2,-xwrap_int
 544 sparcv9_IROPTFLAG       = -W2,-xwrap_int
 545 i386_IROPTFLAG          =