3392N/A#
3392N/A# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
3392N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3392N/A#
3392N/A# This code is free software; you can redistribute it and/or modify it
3392N/A# under the terms of the GNU General Public License version 2 only, as
3392N/A# published by the Free Software Foundation.
3392N/A#
3392N/A# This code is distributed in the hope that it will be useful, but WITHOUT
3392N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3392N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3392N/A# version 2 for more details (a copy is included in the LICENSE file that
3392N/A# accompanied this code).
3392N/A#
3392N/A# You should have received a copy of the GNU General Public License version
3392N/A# 2 along with this work; if not, write to the Free Software Foundation,
3392N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3392N/A#
3392N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3392N/A# or visit www.oracle.com if you need additional information or have any
3392N/A# questions.
3392N/A#
3392N/A#
3392N/A
3392N/A# Rules to build add_gnu_debuglink, used by vm.make on Solaris
3392N/A
3450N/A# Allow $(ADD_GNU_DEBUGLINK) to be called from any directory.
3450N/A# We don't set or use the GENERATED macro to avoid affecting
3450N/A# other HotSpot Makefiles.
3450N/ATOPDIR = $(shell echo `pwd`)
3450N/AADD_GNU_DEBUGLINK = $(TOPDIR)/../generated/add_gnu_debuglink
3392N/A
3392N/AADD_GNU_DEBUGLINK_DIR = $(GAMMADIR)/src/os/solaris/add_gnu_debuglink
3392N/AADD_GNU_DEBUGLINK_SRC = $(ADD_GNU_DEBUGLINK_DIR)/add_gnu_debuglink.c
3392N/AADD_GNU_DEBUGLINK_FLAGS =
3392N/ALIBS_ADD_GNU_DEBUGLINK += -lelf
3392N/A
3392N/Aifeq ("${Platform_compiler}", "sparcWorks")
3392N/A# Enable the following ADD_GNU_DEBUGLINK_FLAGS addition if you need to
3392N/A# compare the built ELF objects.
3392N/A#
3392N/A# The -g option makes static data global and the "-W0,-noglobal"
3392N/A# option tells the compiler to not globalize static data using a unique
3392N/A# globalization prefix. Instead force the use of a static globalization
3392N/A# prefix based on the source filepath so the objects from two identical
3392N/A# compilations are the same.
3392N/A#
3392N/A# Note: The blog says to use "-W0,-xglobalstatic", but that doesn't
3392N/A# seem to work. I got "-W0,-noglobal" from Kelly and that works.
3392N/A#ADD_GNU_DEBUGLINK_FLAGS += -W0,-noglobal
3392N/Aendif # Platform_compiler == sparcWorks
3392N/A
3392N/A$(ADD_GNU_DEBUGLINK): $(ADD_GNU_DEBUGLINK_SRC)
3392N/A $(CC) -g -o $@ $< $(ADD_GNU_DEBUGLINK_FLAGS) $(LIBS_ADD_GNU_DEBUGLINK)