hotspot/make/linux/makefiles/vm.make
author twisti
Wed, 11 Aug 2010 05:51:21 -0700
changeset 6187 4fa7845f7c14
parent 6176 4d9030fe341f
child 7397 5b173b4ca846
permissions -rw-r--r--
6976186: integrate Shark HotSpot changes Summary: Shark is a JIT compiler for Zero that uses the LLVM compiler infrastructure. Reviewed-by: kvn, twisti Contributed-by: Gary Benson <gbenson@redhat.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
#
6187
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
     2
# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
# accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
#
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5045
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5045
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5045
diff changeset
    21
# questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
#  
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
# Rules to build JVM and related libraries, included from vm.make in the build
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
# directory.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
# Common build rules.
338
5cf9f61d76f4 6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents: 1
diff changeset
    29
MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
include $(MAKEFILES_DIR)/rules.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
default: build
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
# Defs
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
GENERATED     = ../generated
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
# read a generated file defining the set of .o's and the .o .h dependencies
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
include $(GENERATED)/Dependencies
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
# read machine-specific adjustments (%%% should do this via buildtree.make?)
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
    43
ifeq ($(ZERO_BUILD), true)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
    44
  include $(MAKEFILES_DIR)/zeroshark.make
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
    45
else
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
    46
  include $(MAKEFILES_DIR)/$(BUILDARCH).make
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
    47
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
# set VPATH so make knows where to look for source files
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
# Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
# The incls directory contains generated header file lists for inclusion.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
# The adfiles directory contains ad_<arch>.[ch]pp.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
# The jvmtifiles directory contains jvmti*.[ch]pp
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
Src_Dirs_V = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)/incls
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
VPATH    += $(Src_Dirs_V:%=%:)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
# set INCLUDES for C preprocessor
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
Src_Dirs_I = $(PRECOMPILED_HEADER_DIR) $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
INCLUDES += $(Src_Dirs_I:%=-I%)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
ifeq (${VERSION}, debug)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  SYMFLAG = -g
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  SYMFLAG =
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
# HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined 
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
# in $(GAMMADIR)/make/defs.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
ifeq ($(HOTSPOT_BUILD_VERSION),)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
# The following variables are defined in the generated flags.make file.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
JRE_VERSION   = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents: 1
diff changeset
    78
HS_LIB_ARCH   = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
BUILD_TARGET  = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
BUILD_USER    = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
VM_DISTRO     = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
CPPFLAGS =           \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  ${SYSDEFS}         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  ${INCLUDES}        \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  ${BUILD_VERSION}   \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  ${BUILD_TARGET}    \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  ${BUILD_USER}      \
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents: 1
diff changeset
    89
  ${HS_LIB_ARCH}     \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  ${JRE_VERSION}     \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  ${VM_DISTRO}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
CFLAGS += $(CFLAGS_WARN/BYFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
# Do not use C++ exception handling
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
CFLAGS += $(CFLAGS/NOEX)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
# Extra flags from gnumake's invocation or environment
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
CFLAGS += $(EXTRA_CFLAGS)
6176
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   101
LFLAGS += $(EXTRA_CFLAGS)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
LIBS += -lm -ldl -lpthread
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
# By default, link the *.o into the library, not the executable.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
LINK_INTO$(LINK_INTO) = LIBJVM
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
# jvm_db & dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
include $(MAKEFILES_DIR)/dtrace.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
# JVM
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 4013
diff changeset
   117
JVM      = jvm
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 4013
diff changeset
   118
LIBJVM   = lib$(JVM).so
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 4013
diff changeset
   119
LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
JVM_OBJ_FILES = $(Obj_Files)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
5045
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   125
mapfile : $(MAPFILE) vm.def
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
	rm -f $@
5045
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   127
	awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE")	\
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   128
                 { system ("cat vm.def"); }		\
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   129
               else					\
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   130
                 { print $$0 }				\
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   131
             }' > $@ < $(MAPFILE)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
mapfile_reorder : mapfile $(REORDERFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
	rm -f $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
	cat $^ > $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
5045
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   137
vm.def: $(Res_Files) $(Obj_Files)
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   138
	sh $(GAMMADIR)/make/linux/makefiles/build_vm_def.sh *.o > $@
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   139
6187
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   140
ifeq ($(SHARK_BUILD), true)
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
   141
  STATIC_CXX = false
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
   142
else
6187
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   143
  ifeq ($(ZERO_LIBARCH), ppc64)
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   144
    STATIC_CXX = false
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   145
  else
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   146
    STATIC_CXX = true
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   147
  endif
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
   148
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
ifeq ($(LINK_INTO),AOUT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  LIBJVM.o                 =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  LIBJVM_MAPFILE           =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
  LIBS_VM                  = $(LIBS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  LIBJVM.o                 = $(JVM_OBJ_FILES)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
  LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  LFLAGS_VM$(LDNOMAP)      += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  LFLAGS_VM                += $(SONAMEFLAG:SONAME=$(LIBJVM))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  # JVM is statically linked with libgcc[_s] and libstdc++; this is needed to
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  # get around library dependency and compatibility issues. Must use gcc not
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  # g++ to link.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  ifeq ($(STATIC_CXX), true)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
    LFLAGS_VM              += $(STATIC_LIBGCC)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
    LIBS_VM                += $(STATIC_STDCXX)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
    LIBS_VM                += -lstdc++
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
  LIBS_VM                  += $(LIBS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
endif
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
   172
ifeq ($(ZERO_BUILD), true)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
   173
  LIBS_VM += $(LIBFFI_LIBS)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
   174
endif
6187
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   175
ifeq ($(SHARK_BUILD), true)
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   176
  LFLAGS_VM += $(LLVM_LDFLAGS)
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   177
  LIBS_VM   += $(LLVM_LIBS)
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   178
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
LINK_VM = $(LINK_LIB.c)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
# rule for building precompiled header
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
$(PRECOMPILED_HEADER): $(Precompiled_Files)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
	$(QUIETLY) echo Generating precompiled header $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
	$(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)/incls
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
	$(QUIETLY) $(COMPILE.CC) -x c++-header -c $(GENERATED)/incls/_precompiled.incl -o $@ $(COMPILE_DONE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
# making the library:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
ifneq ($(JVM_BASE_ADDR),)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
# By default shared library is linked at base address == 0. Modify the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
# linker script if JVM prefers a different base location. It can also be
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
# implemented with 'prelink -r'. But 'prelink' is not (yet) available on
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
# our build platform (AS-2.1).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
LD_SCRIPT = libjvm.so.lds
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
$(LD_SCRIPT): $(LIBJVM_MAPFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
	$(QUIETLY) {                                                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
	  rm -rf $@;                                                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
	  $(LINK_VM) -Wl,--verbose $(LFLAGS_VM) 2>&1             |  \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
	    sed -e '/^======/,/^======/!d'                          \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
		-e '/^======/d'                                     \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
		-e 's/0\( + SIZEOF_HEADERS\)/$(JVM_BASE_ADDR)\1/'   \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
		> $@;                                               \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
	}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
LD_SCRIPT_FLAG = -Wl,-T,$(LD_SCRIPT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
# With more recent Redhat releases (or the cutting edge version Fedora), if
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
# SELinux is configured to be enabled, the runtime linker will fail to apply
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
# the text relocation to libjvm.so considering that it is built as a non-PIC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
# DSO. To workaround that, we run chcon to libjvm.so after it is built. See 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
# details in bug 6538311.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
$(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
	$(QUIETLY) {                                                    \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
	    echo Linking vm...;                                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
	    $(LINK_LIB.CC/PRE_HOOK)                                     \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
	    $(LINK_VM) $(LD_SCRIPT_FLAG)                                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
		       $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM);       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
	    $(LINK_LIB.CC/POST_HOOK)                                    \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
	    rm -f $@.1; ln -s $@ $@.1;                                  \
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 4013
diff changeset
   221
	    [ -f $(LIBJVM_G) ] || { ln -s $@ $(LIBJVM_G); ln -s $@.1 $(LIBJVM_G).1; }; \
6176
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   222
            if [ \"$(CROSS_COMPILE_ARCH)\" = \"\" ] ; then                    \
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   223
	      if [ -x /usr/sbin/selinuxenabled ] ; then                 \
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   224
	        /usr/sbin/selinuxenabled;                               \
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   225
                if [ $$? = 0 ] ; then					\
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   226
		  /usr/bin/chcon -t textrel_shlib_t $@;                 \
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   227
		  if [ $$? != 0 ]; then                                 \
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   228
		    echo "ERROR: Cannot chcon $@";			\
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   229
		  fi							\
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   230
	        fi							\
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   231
	      fi                                                        \
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   232
            fi 								\
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
	}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
install_jvm: $(LIBJVM)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
	@echo "Copying $(LIBJVM) to $(DEST_JVM)"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
	$(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
# Other files
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
# Gamma launcher
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
include $(MAKEFILES_DIR)/launcher.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
# Signal interposition library
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
include $(MAKEFILES_DIR)/jsig.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
# Serviceability agent
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
include $(MAKEFILES_DIR)/saproc.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) checkAndBuildSA
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
install: install_jvm install_jsig install_saproc
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
.PHONY: default build install install_jvm