sparcWorks.make 16.8 KB
Newer Older
D
duke 已提交
1
#
X
xdono 已提交
2
# Copyright 1998-2009 Sun Microsystems, Inc.  All Rights Reserved.
D
duke 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#  
#

# Compiler-specific flags for sparcworks.

# tell make which C and C++ compilers to use
CC	= cc
CPP	= CC

31 32
# Note that this 'as' is an older version of the Sun Studio 'fbe', and will
#   use the older style options. The 'fbe' options will match 'cc' and 'CC'.
D
duke 已提交
33 34 35 36 37 38 39 40 41 42 43
AS	= /usr/ccs/bin/as

NM	= /usr/ccs/bin/nm
NAWK    = /bin/nawk

REORDER_FLAG = -xF

# Check for the versions of C++ and C compilers ($CPP and $CC) used. 

# Get the last thing on the line that looks like x.x+ (x is a digit).
COMPILER_REV := \
44
$(shell $(CPP) -V 2>&1 | sed -n 's/^.*[ ,\t]C++[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p')
D
duke 已提交
45
C_COMPILER_REV := \
46
$(shell $(CC) -V 2>&1 | sed -n 's/^.*[ ,\t]C[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p')
D
duke 已提交
47

48
# Pick which compiler is validated
49
ifeq ($(JRE_RELEASE_VER),1.6.0)
50 51 52 53 54
  # Validated compiler for JDK6 is SS11 (5.8)
  VALIDATED_COMPILER_REV   := 5.8
  VALIDATED_C_COMPILER_REV := 5.8
else
  # Validated compiler for JDK7 is SS12 (5.9)
55 56
  VALIDATED_COMPILER_REV   := 5.9
  VALIDATED_C_COMPILER_REV := 5.9
57
endif
D
duke 已提交
58

59
# Warning messages about not using the above validated version
D
duke 已提交
60 61
ENFORCE_COMPILER_REV${ENFORCE_COMPILER_REV} := ${VALIDATED_COMPILER_REV}
ifneq (${COMPILER_REV},${ENFORCE_COMPILER_REV})
62
dummy_target_to_enforce_compiler_rev:=\
63 64
$(shell echo >&2 WARNING: You are using CC version ${COMPILER_REV} \
and should be using version ${ENFORCE_COMPILER_REV}. Set ENFORCE_COMPILER_REV=${COMPILER_REV} to avoid this warning.)
D
duke 已提交
65 66 67 68
endif

ENFORCE_C_COMPILER_REV${ENFORCE_C_COMPILER_REV} := ${VALIDATED_C_COMPILER_REV}
ifneq (${C_COMPILER_REV},${ENFORCE_C_COMPILER_REV})
69
dummy_target_to_enforce_c_compiler_rev:=\
70 71
$(shell echo >&2 WARNING: You are using cc version ${C_COMPILER_REV} \
and should be using version ${ENFORCE_C_COMPILER_REV}. Set ENFORCE_C_COMPILER_REV=${C_COMPILER_REV} to avoid this warning.)
D
duke 已提交
72 73
endif

74 75
COMPILER_REV_NUMERIC := $(shell echo $(COMPILER_REV) | awk -F. '{ print $$1 * 100 + $$2 }')

D
duke 已提交
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
# Fail the build if __fabsf is used.  __fabsf exists only in Solaris 8 2/04
# and newer; objects with a dependency on this symbol will not run on older
# Solaris 8.
JVM_FAIL_IF_UNDEFINED = __fabsf

JVM_CHECK_SYMBOLS = $(NM) -u -p $(LIBJVM.o) | \
	$(NAWK) -v f="${JVM_FAIL_IF_UNDEFINED}" \
	     'BEGIN    { c=split(f,s); rc=0; } \
	      /:$$/     { file = $$1; } \
	      /[^:]$$/  { for(n=1;n<=c;++n) { \
			   if($$1==s[n]) { \
			     printf("JVM_CHECK_SYMBOLS: %s contains illegal symbol %s\n", \
				    file,$$1); \
			     rc=1; \
			   } \
		         } \
                       } \
	      END      { exit rc; }'

LINK_LIB.CC/PRE_HOOK += $(JVM_CHECK_SYMBOLS) || exit 1;

# Some interfaces (_lwp_create) changed with LP64 and Solaris 7
SOLARIS_7_OR_LATER := \
$(shell uname -r | awk -F. '{ if ($$2 >= 7) print "-DSOLARIS_7_OR_LATER"; }')
CFLAGS += ${SOLARIS_7_OR_LATER}

102 103
# New architecture options started in SS12 (5.9), we need both styles to build.
#   The older arch options for SS11 (5.8) or older and also for /usr/ccs/bin/as.
104 105 106
#   Note: default for 32bit sparc is now the same as v8plus, so the
#         settings below have changed all 32bit sparc builds to be v8plus.
ARCHFLAG_OLD/sparc   = -xarch=v8plus
107 108 109 110 111 112 113 114 115
ARCHFLAG_NEW/sparc   = -m32 -xarch=sparc
ARCHFLAG_OLD/sparcv9 = -xarch=v9
ARCHFLAG_NEW/sparcv9 = -m64 -xarch=sparc
ARCHFLAG_OLD/i486    =
ARCHFLAG_NEW/i486    = -m32
ARCHFLAG_OLD/amd64   = -xarch=amd64
ARCHFLAG_NEW/amd64   = -m64

# Select the ARCHFLAGs and other SS12 (5.9) options
116
ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
117 118 119 120 121 122 123 124 125
  ARCHFLAG/sparc   = $(ARCHFLAG_NEW/sparc)
  ARCHFLAG/sparcv9 = $(ARCHFLAG_NEW/sparcv9)
  ARCHFLAG/i486    = $(ARCHFLAG_NEW/i486)
  ARCHFLAG/amd64   = $(ARCHFLAG_NEW/amd64)
else
  ARCHFLAG/sparc   = $(ARCHFLAG_OLD/sparc)
  ARCHFLAG/sparcv9 = $(ARCHFLAG_OLD/sparcv9)
  ARCHFLAG/i486    = $(ARCHFLAG_OLD/i486)
  ARCHFLAG/amd64   = $(ARCHFLAG_OLD/amd64)
D
duke 已提交
126
endif
127 128 129 130

# ARCHFLAGS for the current build arch
ARCHFLAG    = $(ARCHFLAG/$(BUILDARCH))
AS_ARCHFLAG = $(ARCHFLAG_OLD/$(BUILDARCH))
D
duke 已提交
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145

# Optional sub-directory in /usr/lib where BUILDARCH libraries are kept.
ISA_DIR=$(ISA_DIR/$(BUILDARCH))
ISA_DIR/sparcv9=/sparcv9
ISA_DIR/amd64=/amd64

# Use these to work around compiler bugs:
OPT_CFLAGS/SLOWER=-xO3
OPT_CFLAGS/O2=-xO2
OPT_CFLAGS/NOOPT=-xO1

#################################################
# Begin current (>=5.6) Forte compiler options #
#################################################

146
ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 506), 1)
D
duke 已提交
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162

ifeq ("${Platform_arch}", "sparc")

# We MUST allow data alignment of 4 for sparc (sparcv9 is ok at 8s)
ifndef LP64
CFLAGS += -xmemalign=4s
endif

endif

endif

#################################################
# Begin current (>=5.5) Forte compiler options #
#################################################

163
ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1)
D
duke 已提交
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192

CFLAGS     += $(ARCHFLAG)
AOUT_FLAGS += $(ARCHFLAG)
LIB_FLAGS  += $(ARCHFLAG)
LFLAGS     += $(ARCHFLAG)

ifeq ("${Platform_arch}", "sparc")

# Flags for Optimization

# [phh] Commented out pending verification that we do indeed want
#       to potentially bias against u1 and u3 targets.
#CFLAGS += -xchip=ultra2

OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS)

endif # sparc

ifeq ("${Platform_arch_model}", "x86_32")

OPT_CFLAGS=-xtarget=pentium $(EXTRA_OPT_CFLAGS)

# UBE (CC 5.5) has bug 4923569 with -xO4
OPT_CFLAGS+=-xO3

endif # 32bit x86

ifeq ("${Platform_arch_model}", "x86_64")

193 194
ASFLAGS += $(AS_ARCHFLAG)
CFLAGS  += $(ARCHFLAG/amd64)
D
duke 已提交
195
# this one seemed useless
196
LFLAGS_VM  += $(ARCHFLAG/amd64)
D
duke 已提交
197
# this one worked
198 199
LFLAGS  += $(ARCHFLAG/amd64)
AOUT_FLAGS += $(ARCHFLAG/amd64)
D
duke 已提交
200 201 202 203 204 205 206 207 208 209 210 211

# -xO3 is faster than -xO4 on specjbb with SS10 compiler
OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS)

endif # 64bit x86

# Inline functions
CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_${Platform_arch}/vm/solaris_${Platform_arch_model}.il

# no more exceptions
CFLAGS/NOEX=-features=no%except

212 213 214 215 216 217

# avoid compilation problems arising from fact that C++ compiler tries 
# to search for external template definition by just compiling additional
# source files in th same context
CFLAGS +=  -template=no%extdef

D
duke 已提交
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
# Reduce code bloat by reverting back to 5.0 behavior for static initializers
CFLAGS += -features=no%split_init

# Use -D_Crun_inline_placement so we don't get references to 
#    __1c2n6FIpv_0_ or   void*operator new(unsigned,void*)
#  This avoids the hard requirement of the newer Solaris C++ runtime patches.
#  NOTE: This is an undocumented feature of the SS10 compiler. See 6306698.
CFLAGS += -D_Crun_inline_placement

# PIC is safer for SPARC, and is considerably slower
# a file foo.o which wants to compile -pic can set "PICFLAG/foo.o = -PIC"
PICFLAG         = -KPIC
PICFLAG/DEFAULT = $(PICFLAG)
# [RGV] Need to figure which files to remove to get link to work
#PICFLAG/BETTER  = -pic
PICFLAG/BETTER  = $(PICFLAG/DEFAULT)
PICFLAG/BYFILE  = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@))

# Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
MAPFLAG = -M FILENAME

# Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
SONAMEFLAG = -h SONAME

# Build shared library
SHARED_FLAG = -G

# We don't need libCstd.so and librwtools7.so, only libCrun.so
CFLAGS += -library=%none
LFLAGS += -library=%none

LFLAGS += -mt

251
endif	# COMPILER_REV_NUMERIC >= 505
D
duke 已提交
252 253 254 255 256 257 258 259 260

######################################
# End 5.5 Forte compiler options     #
######################################

######################################
# Begin 5.2 Forte compiler options   #
######################################

261
ifeq ($(COMPILER_REV_NUMERIC), 502)
D
duke 已提交
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298

CFLAGS     += $(ARCHFLAG)
AOUT_FLAGS += $(ARCHFLAG)
LIB_FLAGS  += $(ARCHFLAG)
LFLAGS     += $(ARCHFLAG)

ifeq ("${Platform_arch}", "sparc")

# Flags for Optimization

# [phh] Commented out pending verification that we do indeed want
#       to potentially bias against u1 and u3 targets.
#CFLAGS += -xchip=ultra2

ifdef LP64
# SC5.0 tools on v9 are flakey at -xO4
# [phh] Is this still true for 6.1?
OPT_CFLAGS=-xO3 $(EXTRA_OPT_CFLAGS)
else
OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS)
endif

endif # sparc

ifeq ("${Platform_arch_model}", "x86_32")

OPT_CFLAGS=-xtarget=pentium $(EXTRA_OPT_CFLAGS)

# SC5.0 tools on x86 are flakey at -xO4
# [phh] Is this still true for 6.1?
OPT_CFLAGS+=-xO3

endif # 32bit x86

# no more exceptions
CFLAGS/NOEX=-noex

299 300 301
# Inline functions
CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_${Platform_arch}/vm/solaris_${Platform_arch_model}.il

D
duke 已提交
302 303 304 305 306 307 308 309 310 311 312 313
# Reduce code bloat by reverting back to 5.0 behavior for static initializers
CFLAGS += -Qoption ccfe -one_static_init

# PIC is safer for SPARC, and is considerably slower
# a file foo.o which wants to compile -pic can set "PICFLAG/foo.o = -PIC"
PICFLAG         = -KPIC
PICFLAG/DEFAULT = $(PICFLAG)
# [RGV] Need to figure which files to remove to get link to work
#PICFLAG/BETTER  = -pic
PICFLAG/BETTER  = $(PICFLAG/DEFAULT)
PICFLAG/BYFILE  = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@))

314 315 316 317 318 319 320 321 322
# Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
MAPFLAG = -M FILENAME

# Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
SONAMEFLAG = -h SONAME

# Build shared library
SHARED_FLAG = -G

D
duke 已提交
323 324 325 326 327
# Would be better if these weren't needed, since we link with CC, but
# at present removing them causes run-time errors
LFLAGS += -library=Crun
LIBS   += -library=Crun -lCrun

328
endif	# COMPILER_REV_NUMERIC == 502
D
duke 已提交
329 330 331 332 333 334 335 336

##################################
# End 5.2 Forte compiler options #
##################################

##################################
# Begin old 5.1 compiler options #
##################################
337
ifeq ($(COMPILER_REV_NUMERIC), 501)
D
duke 已提交
338 339 340 341 342 343 344 345 346 347 348 349 350

_JUNK_ := $(shell echo >&2 \
       "*** ERROR: sparkWorks.make incomplete for 5.1 compiler")
	@exit 1
endif
##################################
# End old 5.1 compiler options   #
##################################

##################################
# Begin old 5.0 compiler options #
##################################

351
ifeq	(${COMPILER_REV_NUMERIC}, 500)
D
duke 已提交
352 353 354

# Had to hoist this higher apparently because of other changes. Must
# come before -xarch specification.
355
#  NOTE: native says optimize for the machine doing the compile, bad news.
D
duke 已提交
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382
CFLAGS += -xtarget=native

CFLAGS     += $(ARCHFLAG)
AOUT_FLAGS += $(ARCHFLAG)
LIB_FLAGS  += $(ARCHFLAG)
LFLAGS     += $(ARCHFLAG)

CFLAGS += -library=iostream
LFLAGS += -library=iostream  -library=Crun
LIBS += -library=iostream -library=Crun -lCrun

# Flags for Optimization
ifdef LP64
# SC5.0 tools on v9 are flakey at -xO4
OPT_CFLAGS=-xO3 $(EXTRA_OPT_CFLAGS)
else
OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS)
endif

ifeq ("${Platform_arch}", "sparc")

CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.il

endif # sparc

ifeq ("${Platform_arch_model}", "x86_32")
OPT_CFLAGS=-xtarget=pentium $(EXTRA_OPT_CFLAGS)
383
ifeq ("${COMPILER_REV_NUMERIC}", "500")
D
duke 已提交
384 385 386 387 388 389 390 391 392 393 394
# SC5.0 tools on x86 are flakey at -xO4
OPT_CFLAGS+=-xO3
else
OPT_CFLAGS+=-xO4
endif

CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_x86/vm/solaris_x86_32.il

endif  # 32bit x86

# The following options run into misaligned ldd problem (raj)
395
#OPT_CFLAGS = -fast -O4 $(ARCHFLAG/sparc) -xchip=ultra
D
duke 已提交
396 397 398 399 400 401 402 403 404 405 406 407 408

# no more exceptions
CFLAGS/NOEX=-noex

# PIC is safer for SPARC, and is considerably slower
# a file foo.o which wants to compile -pic can set "PICFLAG/foo.o = -PIC"
PICFLAG         = -PIC
PICFLAG/DEFAULT = $(PICFLAG)
# [RGV] Need to figure which files to remove to get link to work
#PICFLAG/BETTER  = -pic
PICFLAG/BETTER  = $(PICFLAG/DEFAULT)
PICFLAG/BYFILE  = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@))

409
endif	# COMPILER_REV_NUMERIC = 500
D
duke 已提交
410 411 412 413 414

################################
# End old 5.0 compiler options #
################################

415
ifeq ("${COMPILER_REV_NUMERIC}", "402")
D
duke 已提交
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446
# 4.2 COMPILERS SHOULD NO LONGER BE USED
_JUNK_ := $(shell echo >&2 \
       "*** ERROR: SC4.2 compilers are not supported by this code base!")
	@exit 1
endif

# do not include shared lib path in a.outs
AOUT_FLAGS += -norunpath
LFLAGS_VM = -norunpath -z noversion

# need position-indep-code for shared libraries
# (ild appears to get errors on PIC code, so we'll try non-PIC for debug)
ifeq ($(PICFLAGS),DEFAULT)
VM_PICFLAG/LIBJVM  = $(PICFLAG/DEFAULT)
else
VM_PICFLAG/LIBJVM  = $(PICFLAG/BYFILE)
endif
VM_PICFLAG/AOUT    =

VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
CFLAGS += $(VM_PICFLAG)

# less dynamic linking (no PLTs, please)
#LIB_FLAGS += $(LINK_MODE)
# %%%%% despite -znodefs, -Bsymbolic gets link errors -- Rose

LINK_MODE = $(LINK_MODE/$(VERSION))
LINK_MODE/debug     =
LINK_MODE/optimized = -Bsymbolic -znodefs

# Have thread local errnos
447
ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1)
D
duke 已提交
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462
CFLAGS += -mt
else
CFLAGS += -D_REENTRANT
endif

ifdef CC_INTERP
# C++ Interpreter
CFLAGS += -DCC_INTERP
endif

# Flags for Debugging
DEBUG_CFLAGS = -g
FASTDEBUG_CFLAGS = -g0
# The -g0 setting allows the C++ frontend to inline, which is a big win.

463
# Special global options for SS12
464
ifeq ($(COMPILER_REV_NUMERIC),509)
465 466 467 468 469 470 471
  # There appears to be multiple issues with the new Dwarf2 debug format, so
  #   we tell the compiler to use the older 'stabs' debug format all the time.
  #   Note that this needs to be used in optimized compiles too to be 100%.
  #   This is a workaround for SS12 (5.9) bug 6694600
  CFLAGS += -xdebugformat=stabs
endif

D
duke 已提交
472 473 474 475 476 477 478 479 480 481 482
# Enable the following CFLAGS additions if you need to compare the
# built ELF objects.
#
# The -g option makes static data global and the "-Qoption ccfe
# -xglobalstatic" option tells the compiler to not globalize static
# data using a unique globalization prefix. Instead force the use of
# a static globalization prefix based on the source filepath so the
# objects from two identical compilations are the same.
#DEBUG_CFLAGS += -Qoption ccfe -xglobalstatic
#FASTDEBUG_CFLAGS += -Qoption ccfe -xglobalstatic

483 484
ifeq	(${COMPILER_REV_NUMERIC}, 502)
COMPILER_DATE := $(shell $(CPP) -V 2>&1 | sed -n '/^.*[ ]C++[ ]\([1-9]\.[0-9][0-9]*\)/p' | awk '{ print $$NF; }')
D
duke 已提交
485 486 487 488 489 490 491 492 493 494 495 496
ifeq	(${COMPILER_DATE}, 2001/01/31)
# disable -g0 in fastdebug since SC6.1 dated 2001/01/31 seems to be buggy
# use an innocuous value because it will get -g if it's empty
FASTDEBUG_CFLAGS = -c
endif
endif

# Uncomment or 'gmake CFLAGS_BROWSE=-sbfast' to get source browser information.
# CFLAGS_BROWSE	= -sbfast
CFLAGS		+= $(CFLAGS_BROWSE)

# ILD is gone as of SS11 (5.8), not supportted in SS10 (5.7)
497
ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \< 507), 1)
D
duke 已提交
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543
  # use ild when debugging (but when optimizing we want reproducible results)
  ILDFLAG = $(ILDFLAG/$(VERSION))
  ILDFLAG/debug     = -xildon
  ILDFLAG/optimized =
  AOUT_FLAGS += $(ILDFLAG)
endif

# Where to put the *.o files (a.out, or shared library)?
LINK_INTO = $(LINK_INTO/$(VERSION))
LINK_INTO/debug = LIBJVM
LINK_INTO/optimized = LIBJVM

# We link the debug version into the a.out because:
#  1. ild works on a.out but not shared libraries, and using ild
#     can cut rebuild times by 25% for small changes. (ILD is gone in SS11)
#  2. dbx cannot gracefully set breakpoints in shared libraries
#

# apply this setting to link into the shared library even in the debug version:
ifdef LP64
LINK_INTO = LIBJVM
else
#LINK_INTO = LIBJVM
endif

MCS	= /usr/ccs/bin/mcs
STRIP	= /usr/ccs/bin/strip

# Solaris platforms collect lots of redundant file-ident lines,
# to the point of wasting a significant percentage of file space.
# (The text is stored in ELF .comment sections, contributed by
# all "#pragma ident" directives in header and source files.)
# This command "compresses" the .comment sections simply by
# removing repeated lines.  The data can be extracted from
# binaries in the field by using "mcs -p libjvm.so" or the older
# command "what libjvm.so".
LINK_LIB.CC/POST_HOOK += $(MCS) -c $@ || exit 1;
# (The exit 1 is necessary to cause a build failure if the command fails and
# multiple commands are strung together, and the final semicolon is necessary
# since the hook must terminate itself as a valid command.)

# Also, strip debug and line number information (worth about 1.7Mb).
STRIP_LIB.CC/POST_HOOK = $(STRIP) -x $@ || exit 1;
# STRIP_LIB.CC/POST_HOOK is incorporated into LINK_LIB.CC/POST_HOOK
# in certain configurations, such as product.make.  Other configurations,
# such as debug.make, do not include the strip operation.