make/solaris/makefiles/sparcWorks.make

Print this page




   9 # This code is distributed in the hope that it will be useful, but WITHOUT
  10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 # version 2 for more details (a copy is included in the LICENSE file that
  13 # accompanied this code).
  14 #
  15 # You should have received a copy of the GNU General Public License version
  16 # 2 along with this work; if not, write to the Free Software Foundation,
  17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 #
  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #  
  23 #
  24 
  25 # Compiler-specific flags for sparcworks.
  26 
  27 # tell make which C and C++ compilers to use
  28 CC      = cc
  29 CPP     = CC
  30 
  31 # Note that this 'as' is an older version of the Sun Studio 'fbe', and will
  32 #   use the older style options. The 'fbe' options will match 'cc' and 'CC'.
  33 AS      = /usr/ccs/bin/as
  34 
  35 NM      = /usr/ccs/bin/nm
  36 NAWK    = /bin/nawk
  37 
  38 REORDER_FLAG = -xF
  39 
  40 # Check for the versions of C++ and C compilers ($CPP and $CC) used. 
  41 
  42 # Get the last thing on the line that looks like x.x+ (x is a digit).
  43 COMPILER_REV := \
  44 $(shell $(CPP) -V 2>&1 | sed -n 's/^.*[ ,\t]C++[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p')
  45 C_COMPILER_REV := \
  46 $(shell $(CC) -V 2>&1 | sed -n 's/^.*[ ,\t]C[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p')
  47 
  48 # Pick which compiler is validated
  49 ifeq ($(JRE_RELEASE_VER),1.6.0)
  50   # Validated compiler for JDK6 is SS11 (5.8)
  51   VALIDATED_COMPILER_REVS   := 5.8
  52   VALIDATED_C_COMPILER_REVS := 5.8
  53 else
  54   # Validated compiler for JDK7 is SS12 update 1 + patches (5.10)
  55   VALIDATED_COMPILER_REVS   := 5.10
  56   VALIDATED_C_COMPILER_REVS := 5.10
  57 endif
  58 
  59 # Warning messages about not using the above validated versions
  60 ENFORCE_COMPILER_REV${ENFORCE_COMPILER_REV} := $(strip ${VALIDATED_COMPILER_REVS})
  61 ifeq ($(filter ${ENFORCE_COMPILER_REV},${COMPILER_REV}),)
  62 PRINTABLE_CC_REVS := $(subst $(shell echo ' '), or ,${ENFORCE_COMPILER_REV})
  63 dummy_var_to_enforce_compiler_rev := $(shell \
  64         echo >&2 WARNING: You are using CC version ${COMPILER_REV} and \
  65         should be using version ${PRINTABLE_CC_REVS}.; \
  66         echo >&2 Set ENFORCE_COMPILER_REV=${COMPILER_REV} to avoid this \
  67         warning.)
  68 endif
  69 
  70 ENFORCE_C_COMPILER_REV${ENFORCE_C_COMPILER_REV} := $(strip ${VALIDATED_C_COMPILER_REVS})
  71 ifeq ($(filter ${ENFORCE_C_COMPILER_REV},${C_COMPILER_REV}),)
  72 PRINTABLE_C_REVS := $(subst $(shell echo ' '), or ,${ENFORCE_C_COMPILER_REV})
  73 dummy_var_to_enforce_c_compiler_rev := $(shell \
  74         echo >&2 WARNING: You are using cc version ${C_COMPILER_REV} and \
  75         should be using version ${PRINTABLE_C_REVS}.; \
  76         echo >&2 Set ENFORCE_C_COMPILER_REV=${C_COMPILER_REV} to avoid this \
  77         warning.)
  78 endif
  79 
  80 COMPILER_REV_NUMERIC := $(shell echo $(COMPILER_REV) | awk -F. '{ print $$1 * 100 + $$2 }')
  81 
  82 # Fail the build if __fabsf is used.  __fabsf exists only in Solaris 8 2/04
  83 # and newer; objects with a dependency on this symbol will not run on older
  84 # Solaris 8.
  85 JVM_FAIL_IF_UNDEFINED = __fabsf
  86 
  87 JVM_CHECK_SYMBOLS = $(NM) -u -p $(LIBJVM.o) | \
  88         $(NAWK) -v f="${JVM_FAIL_IF_UNDEFINED}" \
  89              'BEGIN    { c=split(f,s); rc=0; } \
  90               /:$$/     { file = $$1; } \
  91               /[^:]$$/  { for(n=1;n<=c;++n) { \
  92                            if($$1==s[n]) { \
  93                              printf("JVM_CHECK_SYMBOLS: %s contains illegal symbol %s\n", \
  94                                     file,$$1); \
  95                              rc=1; \
  96                            } \
  97                          } \
  98                        } \
  99               END      { exit rc; }'
 100 
 101 LINK_LIB.CC/PRE_HOOK += $(JVM_CHECK_SYMBOLS) || exit 1;
 102 
 103 # New architecture options started in SS12 (5.9), we need both styles to build.
 104 #   The older arch options for SS11 (5.8) or older and also for /usr/ccs/bin/as.
 105 #   Note: default for 32bit sparc is now the same as v8plus, so the
 106 #         settings below have changed all 32bit sparc builds to be v8plus.
 107 ARCHFLAG_OLD/sparc   = -xarch=v8plus
 108 ARCHFLAG_NEW/sparc   = -m32 -xarch=sparc
 109 ARCHFLAG_OLD/sparcv9 = -xarch=v9
 110 ARCHFLAG_NEW/sparcv9 = -m64 -xarch=sparc
 111 ARCHFLAG_OLD/i486    =
 112 ARCHFLAG_NEW/i486    = -m32
 113 ARCHFLAG_OLD/amd64   = -xarch=amd64
 114 ARCHFLAG_NEW/amd64   = -m64
 115 
 116 # Select the ARCHFLAGs and other SS12 (5.9) options
 117 ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
 118   ARCHFLAG/sparc   = $(ARCHFLAG_NEW/sparc)
 119   ARCHFLAG/sparcv9 = $(ARCHFLAG_NEW/sparcv9)
 120   ARCHFLAG/i486    = $(ARCHFLAG_NEW/i486)
 121   ARCHFLAG/amd64   = $(ARCHFLAG_NEW/amd64)


 501   #   Note that this needs to be used in optimized compiles too to be 100%.
 502   #   This is a workaround for SS12 (5.9) bug 6694600
 503   CFLAGS += -xdebugformat=stabs
 504 endif
 505 
 506 # Enable the following CFLAGS additions if you need to compare the
 507 # built ELF objects.
 508 #
 509 # The -g option makes static data global and the "-Qoption ccfe
 510 # -xglobalstatic" option tells the compiler to not globalize static
 511 # data using a unique globalization prefix. Instead force the use of
 512 # a static globalization prefix based on the source filepath so the
 513 # objects from two identical compilations are the same.
 514 # EXTRA_CFLAGS only covers vm_version.cpp for some reason
 515 #EXTRA_CFLAGS += -Qoption ccfe -xglobalstatic
 516 #OPT_CFLAGS += -Qoption ccfe -xglobalstatic
 517 #DEBUG_CFLAGS += -Qoption ccfe -xglobalstatic
 518 #FASTDEBUG_CFLAGS += -Qoption ccfe -xglobalstatic
 519 
 520 ifeq    (${COMPILER_REV_NUMERIC}, 502)
 521 COMPILER_DATE := $(shell $(CPP) -V 2>&1 | sed -n '/^.*[ ]C++[ ]\([1-9]\.[0-9][0-9]*\)/p' | awk '{ print $$NF; }')
 522 ifeq    (${COMPILER_DATE}, 2001/01/31)
 523 # disable -g0 in fastdebug since SC6.1 dated 2001/01/31 seems to be buggy
 524 # use an innocuous value because it will get -g if it's empty
 525 FASTDEBUG_CFLAGS = -c
 526 endif
 527 endif
 528 
 529 # Uncomment or 'gmake CFLAGS_BROWSE=-sbfast' to get source browser information.
 530 # CFLAGS_BROWSE = -sbfast
 531 CFLAGS          += $(CFLAGS_BROWSE)
 532 
 533 # ILD is gone as of SS11 (5.8), not supportted in SS10 (5.7)
 534 ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \< 507), 1)
 535   # use ild when debugging (but when optimizing we want reproducible results)
 536   ILDFLAG = $(ILDFLAG/$(VERSION))
 537   ILDFLAG/debug     = -xildon
 538   ILDFLAG/optimized =
 539   AOUT_FLAGS += $(ILDFLAG)
 540 endif
 541 


 551 #
 552 
 553 # apply this setting to link into the shared library even in the debug version:
 554 ifdef LP64
 555 LINK_INTO = LIBJVM
 556 else
 557 #LINK_INTO = LIBJVM
 558 endif
 559 
 560 MCS     = /usr/ccs/bin/mcs
 561 STRIP   = /usr/ccs/bin/strip
 562 
 563 # Solaris platforms collect lots of redundant file-ident lines,
 564 # to the point of wasting a significant percentage of file space.
 565 # (The text is stored in ELF .comment sections, contributed by
 566 # all "#pragma ident" directives in header and source files.)
 567 # This command "compresses" the .comment sections simply by
 568 # removing repeated lines.  The data can be extracted from
 569 # binaries in the field by using "mcs -p libjvm.so" or the older
 570 # command "what libjvm.so".
 571 LINK_LIB.CC/POST_HOOK += $(MCS) -c $@ || exit 1;
 572 # (The exit 1 is necessary to cause a build failure if the command fails and
 573 # multiple commands are strung together, and the final semicolon is necessary
 574 # since the hook must terminate itself as a valid command.)
 575 
 576 # Also, strip debug and line number information (worth about 1.7Mb).
 577 # If we can create .debuginfo files, then the VM is stripped in vm.make
 578 # and this macro is not used.
 579 STRIP_LIB.CC/POST_HOOK = $(STRIP) -x $@ || exit 1;
 580 # STRIP_LIB.CC/POST_HOOK is incorporated into LINK_LIB.CC/POST_HOOK
 581 # in certain configurations, such as product.make.  Other configurations,
 582 # such as debug.make, do not include the strip operation.


   9 # This code is distributed in the hope that it will be useful, but WITHOUT
  10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 # version 2 for more details (a copy is included in the LICENSE file that
  13 # accompanied this code).
  14 #
  15 # You should have received a copy of the GNU General Public License version
  16 # 2 along with this work; if not, write to the Free Software Foundation,
  17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 #
  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #  
  23 #
  24 
  25 # Compiler-specific flags for sparcworks.
  26 
  27 # tell make which C and C++ compilers to use
  28 CC      = cc
  29 CXX     = CC
  30 
  31 # Note that this 'as' is an older version of the Sun Studio 'fbe', and will
  32 #   use the older style options. The 'fbe' options will match 'cc' and 'CC'.
  33 AS      = /usr/ccs/bin/as
  34 
  35 NM      = /usr/ccs/bin/nm
  36 NAWK    = /bin/nawk
  37 
  38 REORDER_FLAG = -xF
  39 
  40 # Check for the versions of C++ and C compilers ($CXX and $CC) used. 
  41 
  42 # Get the last thing on the line that looks like x.x+ (x is a digit).
  43 COMPILER_REV := \
  44 $(shell $(CXX) -V 2>&1 | sed -n 's/^.*[ ,\t]C++[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p')
  45 CC_COMPILER_REV := \
  46 $(shell $(CC) -V 2>&1 | sed -n 's/^.*[ ,\t]C[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p')
  47 
  48 # Pick which compiler is validated
  49 ifeq ($(JRE_RELEASE_VER),1.6.0)
  50   # Validated compiler for JDK6 is SS11 (5.8)
  51   VALIDATED_COMPILER_REVS   := 5.8
  52   VALIDATED_CC_COMPILER_REVS := 5.8
  53 else
  54   # Validated compiler for JDK7 is SS12 update 1 + patches (5.10)
  55   VALIDATED_COMPILER_REVS   := 5.10
  56   VALIDATED_CC_COMPILER_REVS := 5.10
  57 endif
  58 
  59 # Warning messages about not using the above validated versions
  60 ENFORCE_COMPILER_REV${ENFORCE_COMPILER_REV} := $(strip ${VALIDATED_COMPILER_REVS})
  61 ifeq ($(filter ${ENFORCE_COMPILER_REV},${COMPILER_REV}),)
  62 PRINTABLE_CC_REVS := $(subst $(shell echo ' '), or ,${ENFORCE_COMPILER_REV})
  63 dummy_var_to_enforce_compiler_rev := $(shell \
  64         echo >&2 WARNING: You are using CC version ${COMPILER_REV} and \
  65         should be using version ${PRINTABLE_CC_REVS}.; \
  66         echo >&2 Set ENFORCE_COMPILER_REV=${COMPILER_REV} to avoid this \
  67         warning.)
  68 endif
  69 
  70 ENFORCE_CC_COMPILER_REV${ENFORCE_CC_COMPILER_REV} := $(strip ${VALIDATED_CC_COMPILER_REVS})
  71 ifeq ($(filter ${ENFORCE_CC_COMPILER_REV},${CC_COMPILER_REV}),)
  72 PRINTABLE_C_REVS := $(subst $(shell echo ' '), or ,${ENFORCE_CC_COMPILER_REV})
  73 dummy_var_to_enforce_c_compiler_rev := $(shell \
  74         echo >&2 WARNING: You are using cc version ${CC_COMPILER_REV} and \
  75         should be using version ${PRINTABLE_C_REVS}.; \
  76         echo >&2 Set ENFORCE_CC_COMPILER_REV=${CC_COMPILER_REV} to avoid this \
  77         warning.)
  78 endif
  79 
  80 COMPILER_REV_NUMERIC := $(shell echo $(COMPILER_REV) | awk -F. '{ print $$1 * 100 + $$2 }')
  81 
  82 # Fail the build if __fabsf is used.  __fabsf exists only in Solaris 8 2/04
  83 # and newer; objects with a dependency on this symbol will not run on older
  84 # Solaris 8.
  85 JVM_FAIL_IF_UNDEFINED = __fabsf
  86 
  87 JVM_CHECK_SYMBOLS = $(NM) -u -p $(LIBJVM.o) | \
  88         $(NAWK) -v f="${JVM_FAIL_IF_UNDEFINED}" \
  89              'BEGIN    { c=split(f,s); rc=0; } \
  90               /:$$/     { file = $$1; } \
  91               /[^:]$$/  { for(n=1;n<=c;++n) { \
  92                            if($$1==s[n]) { \
  93                              printf("JVM_CHECK_SYMBOLS: %s contains illegal symbol %s\n", \
  94                                     file,$$1); \
  95                              rc=1; \
  96                            } \
  97                          } \
  98                        } \
  99               END      { exit rc; }'
 100 
 101 LINK_LIB.CXX/PRE_HOOK += $(JVM_CHECK_SYMBOLS) || exit 1;
 102 
 103 # New architecture options started in SS12 (5.9), we need both styles to build.
 104 #   The older arch options for SS11 (5.8) or older and also for /usr/ccs/bin/as.
 105 #   Note: default for 32bit sparc is now the same as v8plus, so the
 106 #         settings below have changed all 32bit sparc builds to be v8plus.
 107 ARCHFLAG_OLD/sparc   = -xarch=v8plus
 108 ARCHFLAG_NEW/sparc   = -m32 -xarch=sparc
 109 ARCHFLAG_OLD/sparcv9 = -xarch=v9
 110 ARCHFLAG_NEW/sparcv9 = -m64 -xarch=sparc
 111 ARCHFLAG_OLD/i486    =
 112 ARCHFLAG_NEW/i486    = -m32
 113 ARCHFLAG_OLD/amd64   = -xarch=amd64
 114 ARCHFLAG_NEW/amd64   = -m64
 115 
 116 # Select the ARCHFLAGs and other SS12 (5.9) options
 117 ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
 118   ARCHFLAG/sparc   = $(ARCHFLAG_NEW/sparc)
 119   ARCHFLAG/sparcv9 = $(ARCHFLAG_NEW/sparcv9)
 120   ARCHFLAG/i486    = $(ARCHFLAG_NEW/i486)
 121   ARCHFLAG/amd64   = $(ARCHFLAG_NEW/amd64)


 501   #   Note that this needs to be used in optimized compiles too to be 100%.
 502   #   This is a workaround for SS12 (5.9) bug 6694600
 503   CFLAGS += -xdebugformat=stabs
 504 endif
 505 
 506 # Enable the following CFLAGS additions if you need to compare the
 507 # built ELF objects.
 508 #
 509 # The -g option makes static data global and the "-Qoption ccfe
 510 # -xglobalstatic" option tells the compiler to not globalize static
 511 # data using a unique globalization prefix. Instead force the use of
 512 # a static globalization prefix based on the source filepath so the
 513 # objects from two identical compilations are the same.
 514 # EXTRA_CFLAGS only covers vm_version.cpp for some reason
 515 #EXTRA_CFLAGS += -Qoption ccfe -xglobalstatic
 516 #OPT_CFLAGS += -Qoption ccfe -xglobalstatic
 517 #DEBUG_CFLAGS += -Qoption ccfe -xglobalstatic
 518 #FASTDEBUG_CFLAGS += -Qoption ccfe -xglobalstatic
 519 
 520 ifeq    (${COMPILER_REV_NUMERIC}, 502)
 521 COMPILER_DATE := $(shell $(CXX) -V 2>&1 | sed -n '/^.*[ ]C++[ ]\([1-9]\.[0-9][0-9]*\)/p' | awk '{ print $$NF; }')
 522 ifeq    (${COMPILER_DATE}, 2001/01/31)
 523 # disable -g0 in fastdebug since SC6.1 dated 2001/01/31 seems to be buggy
 524 # use an innocuous value because it will get -g if it's empty
 525 FASTDEBUG_CFLAGS = -c
 526 endif
 527 endif
 528 
 529 # Uncomment or 'gmake CFLAGS_BROWSE=-sbfast' to get source browser information.
 530 # CFLAGS_BROWSE = -sbfast
 531 CFLAGS          += $(CFLAGS_BROWSE)
 532 
 533 # ILD is gone as of SS11 (5.8), not supportted in SS10 (5.7)
 534 ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \< 507), 1)
 535   # use ild when debugging (but when optimizing we want reproducible results)
 536   ILDFLAG = $(ILDFLAG/$(VERSION))
 537   ILDFLAG/debug     = -xildon
 538   ILDFLAG/optimized =
 539   AOUT_FLAGS += $(ILDFLAG)
 540 endif
 541 


 551 #
 552 
 553 # apply this setting to link into the shared library even in the debug version:
 554 ifdef LP64
 555 LINK_INTO = LIBJVM
 556 else
 557 #LINK_INTO = LIBJVM
 558 endif
 559 
 560 MCS     = /usr/ccs/bin/mcs
 561 STRIP   = /usr/ccs/bin/strip
 562 
 563 # Solaris platforms collect lots of redundant file-ident lines,
 564 # to the point of wasting a significant percentage of file space.
 565 # (The text is stored in ELF .comment sections, contributed by
 566 # all "#pragma ident" directives in header and source files.)
 567 # This command "compresses" the .comment sections simply by
 568 # removing repeated lines.  The data can be extracted from
 569 # binaries in the field by using "mcs -p libjvm.so" or the older
 570 # command "what libjvm.so".
 571 LINK_LIB.CXX/POST_HOOK += $(MCS) -c $@ || exit 1;
 572 # (The exit 1 is necessary to cause a build failure if the command fails and
 573 # multiple commands are strung together, and the final semicolon is necessary
 574 # since the hook must terminate itself as a valid command.)
 575 
 576 # Also, strip debug and line number information (worth about 1.7Mb).
 577 # If we can create .debuginfo files, then the VM is stripped in vm.make
 578 # and this macro is not used.
 579 STRIP_LIB.CXX/POST_HOOK = $(STRIP) -x $@ || exit 1;
 580 # STRIP_LIB.CXX/POST_HOOK is incorporated into LINK_LIB.CXX/POST_HOOK
 581 # in certain configurations, such as product.make.  Other configurations,
 582 # such as debug.make, do not include the strip operation.