Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/make/windows/build_vm_def.sh
32284 views
#1# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#22#2324# This shell script builds a vm.def file for the current VM variant.25# The .def file exports vtbl symbols which allow the Serviceability26# Agent to run on Windows. See make/windows/projectfiles/*/vm.def27# for more information.28#29# The script expects to be executed in the directory containing all of30# the object files.3132# Note that we currently do not have a way to set HotSpotMksHome in33# the batch build, but so far this has not seemed to be a problem. The34# reason this environment variable is necessary is that it seems that35# Windows truncates very long PATHs when executing shells like MKS's36# sh, and it has been found that sometimes `which sh` fails.37if [ "x$HOTSPOTMKSHOME" != "x" ]; then38MKS_HOME="$HOTSPOTMKSHOME"39else40SH=`which sh`41MKS_HOME=`dirname "$SH"`42fi4344AWK="$MKS_HOME/awk.exe"45if [ ! -e $AWK ]; then46AWK="$MKS_HOME/gawk.exe"47fi48GREP="$MKS_HOME/grep.exe"49SORT="$MKS_HOME/sort.exe"50UNIQ="$MKS_HOME/uniq.exe"51CAT="$MKS_HOME/cat.exe"52RM="$MKS_HOME/rm.exe"53DUMPBIN="link.exe /dump"5455if [ "$1" = "-nosa" ]; then56echo EXPORTS > vm.def57echo ""58echo "***"59echo "*** Not building SA: BUILD_WIN_SA != 1"60echo "*** C++ Vtables NOT included in vm.def"61echo "*** This jvm.dll will NOT work properly with SA."62echo "***"63echo "*** When in doubt, set BUILD_WIN_SA=1, clean and rebuild."64echo "***"65echo ""66exit67fi6869echo "EXPORTS" > vm1.def7071# When called from IDE the first param should contain the link version, otherwise may be nill72if [ "x$1" != "x" ]; then73LD_VER="$1"74fi7576if [ "x$LD_VER" != "x800" -a "x$LD_VER" != "x900" -a "x$LD_VER" != "x1000" ]; then77$DUMPBIN /symbols *.obj | "$GREP" "??_7.*@@6B@" | "$GREP" -v "type_info" | "$AWK" '{print $7}' | "$SORT" | "$UNIQ" > vm2.def78else79# Can't use pipes when calling cl.exe or link.exe from IDE. Using transit file vm3.def80$DUMPBIN /OUT:vm3.def /symbols *.obj81"$CAT" vm3.def | "$GREP" "??_7.*@@6B@" | "$GREP" -v "type_info" | "$AWK" '{print $7}' | "$SORT" | "$UNIQ" > vm2.def82"$RM" -f vm3.def83fi8485"$CAT" vm1.def vm2.def > vm.def86"$RM" -f vm1.def vm2.def878889