make/solaris/makefiles/launcher.make

Tue, 18 Sep 2012 13:15:28 -0700

author
ohair
date
Tue, 18 Sep 2012 13:15:28 -0700
changeset 4087
37518f191ddb
parent 4037
da91efe96a93
permissions
-rw-r--r--

7198329: Add $(sort) to object files used in links makes binarties more consistent
Reviewed-by: dholmes, tbell, erikj, ihse, ohrstrom

duke@435 1 #
coleenp@4037 2 # Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
duke@435 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 #
duke@435 5 # This code is free software; you can redistribute it and/or modify it
duke@435 6 # under the terms of the GNU General Public License version 2 only, as
duke@435 7 # published by the Free Software Foundation.
duke@435 8 #
duke@435 9 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 # version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 # accompanied this code).
duke@435 14 #
duke@435 15 # You should have received a copy of the GNU General Public License version
duke@435 16 # 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 #
trims@1907 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 # or visit www.oracle.com if you need additional information or have any
trims@1907 21 # questions.
duke@435 22 #
duke@435 23 #
duke@435 24
duke@435 25 # Rules to build gamma launcher, used by vm.make
duke@435 26
sla@2327 27 LAUNCHER_SCRIPT = hotspot
phh@1558 28 LAUNCHER = gamma
duke@435 29
sla@2327 30 LAUNCHERDIR = $(GAMMADIR)/src/os/posix/launcher
sla@2327 31 LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher
duke@435 32 LAUNCHERFLAGS = $(ARCHFLAG) \
duke@435 33 -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \
sla@2327 34 -I$(LAUNCHERDIR_SHARE) \
duke@435 35 -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
sla@2327 36 -DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
sla@2327 37 -DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
duke@435 38 -DARCH=\"$(LIBARCH)\" \
duke@435 39 -DGAMMA \
duke@435 40 -DLAUNCHER_TYPE=\"gamma\" \
sla@2327 41 -DLINK_INTO_$(LINK_INTO) \
sla@2327 42 $(TARGET_DEFINES)
duke@435 43
duke@435 44 ifeq ($(LINK_INTO),AOUT)
duke@435 45 LAUNCHER.o = launcher.o $(JVM_OBJ_FILES)
coleenp@4037 46 LAUNCHER_MAPFILE = mapfile_extended
duke@435 47 LFLAGS_LAUNCHER$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LAUNCHER_MAPFILE))
duke@435 48 LIBS_LAUNCHER += $(LIBS)
duke@435 49 else
duke@435 50 LAUNCHER.o = launcher.o
duke@435 51 LFLAGS_LAUNCHER += -L `pwd`
duke@435 52 LIBS_LAUNCHER += -l$(JVM) $(LIBS)
duke@435 53 endif
duke@435 54
erikj@3518 55 LINK_LAUNCHER = $(LINK.CXX)
duke@435 56
erikj@3518 57 LINK_LAUNCHER/PRE_HOOK = $(LINK_LIB.CXX/PRE_HOOK)
erikj@3518 58 LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CXX/POST_HOOK)
duke@435 59
duke@435 60 ifeq ("${Platform_compiler}", "sparcWorks")
duke@435 61 # Enable the following LAUNCHERFLAGS addition if you need to compare the
duke@435 62 # built ELF objects.
duke@435 63 #
duke@435 64 # The -g option makes static data global and the "-W0,-noglobal"
duke@435 65 # option tells the compiler to not globalize static data using a unique
duke@435 66 # globalization prefix. Instead force the use of a static globalization
duke@435 67 # prefix based on the source filepath so the objects from two identical
duke@435 68 # compilations are the same.
duke@435 69 #
duke@435 70 # Note: The blog says to use "-W0,-xglobalstatic", but that doesn't
duke@435 71 # seem to work. I got "-W0,-noglobal" from Kelly and that works.
duke@435 72 #LAUNCHERFLAGS += -W0,-noglobal
duke@435 73 endif # Platform_compiler == sparcWorks
duke@435 74
sla@2327 75 LAUNCHER_OUT = launcher
duke@435 76
sla@2327 77 SUFFIXES += .d
duke@435 78
sla@2327 79 SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c")
sla@2327 80 SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c")
sla@2327 81
sla@2327 82 OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE))
sla@2327 83
sla@2327 84 DEPFILES := $(patsubst %.o,%.d,$(OBJS))
sla@2327 85 -include $(DEPFILES)
sla@2327 86
sla@2327 87 $(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c
sla@2327 88 $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
erikj@3518 89 $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS)
sla@2327 90
sla@2327 91 $(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c
sla@2327 92 $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); }
erikj@3518 93 $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS)
sla@2327 94
sla@2327 95 $(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE)
jcoomes@1902 96 ifeq ($(filter -sbfast -xsbfast, $(CFLAGS_BROWSE)),)
sla@2327 97 $(QUIETLY) echo Linking launcher...
jcoomes@1902 98 $(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK)
ohair@4087 99 $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(sort $(OBJS)) $(LIBS_LAUNCHER)
jcoomes@1902 100 $(QUIETLY) $(LINK_LAUNCHER/POST_HOOK)
jcoomes@1902 101 endif # filter -sbfast -xsbfast
jcoomes@1902 102
sla@2327 103 $(LAUNCHER): $(LAUNCHER_SCRIPT)
sla@2327 104
sla@2327 105 $(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script
sla@2327 106 $(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@
sla@2327 107 $(QUIETLY) chmod +x $@
sla@2327 108

mercurial