提交 ea870e70 编写于 作者: X xlu

6647068: libjvm.so is not built PIC

Summary: Remove the preferred base address built with libjvm.so and unified the PIC approach on Solaris & Linux.
Reviewed-by: never, kamg
Contributed-by: xiaobin.lu@sun.com
上级 da71dc0c
......@@ -261,3 +261,21 @@ EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmti.h
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jni.h
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h
# A list of object files built without the platform specific PIC flags, e.g.
# -fPIC on linux. Performance measurements show that by compiling GC related
# code, we could significantly reduce the GC pause time on 32 bit Linux/Unix
# platforms. See 6454213 for more details.
include $(GAMMADIR)/make/scm.make
ifneq ($(OSNAME), windows)
ifndef LP64
NONPIC_DIRS = memory oops gc_implementation gc_interface
NONPIC_DIRS := $(foreach dir,$(NONPIC_DIRS), $(GAMMADIR)/src/share/vm/$(dir))
# Look for source files under NONPIC_DIRS
NONPIC_FILES := $(foreach dir,$(NONPIC_DIRS),\
$(shell find $(dir) \( $(SCM_DIRS) \) -prune -o \
-name '*.cpp' -print))
NONPIC_OBJ_FILES := $(notdir $(subst .cpp,.o,$(NONPIC_FILES)))
endif
endif
......@@ -50,14 +50,7 @@ PICFLAG = -fPIC
VM_PICFLAG/LIBJVM = $(PICFLAG)
VM_PICFLAG/AOUT =
ifneq ($(BUILDARCH), i486)
VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
else
# PIC has significant overhead on x86, build nonpic VM for now.
# Link JVM at a "good" base location to avoid unnecessary .text patching.
JVM_BASE_ADDR = 0x06000000
endif
CFLAGS += $(VM_PICFLAG)
CFLAGS += -fno-rtti
......
......@@ -133,10 +133,22 @@ ifeq ($(findstring j,$(MFLAGS)),j)
COMPILE_DONE = && { echo Done with $<; }
endif
include $(GAMMADIR)/make/defs.make
# The non-PIC object files are only generated for 32 bit platforms.
ifdef LP64
%.o: %.cpp
@echo Compiling $<
$(QUIETLY) $(REMOVE_TARGET)
$(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
else
%.o: %.cpp
@echo Compiling $<
$(QUIETLY) $(REMOVE_TARGET)
$(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \
$(subst $(VM_PICFLAG), ,$(COMPILE.CC)) -o $@ $< $(COMPILE_DONE), \
$(COMPILE.CC) -o $@ $< $(COMPILE_DONE))
endif
%.o: %.s
@echo Assembling $<
......
......@@ -133,19 +133,7 @@ ifeq ($(findstring j,$(MFLAGS)),j)
COMPILE_DONE = && { echo Done with $<; }
endif
# A list of directories under which all source code are built without -KPIC/-Kpic
# flag. Performance measurements show that compiling GC related code will
# dramatically reduce the gc pause time. See bug 6454213 for more details.
include $(GAMMADIR)/make/scm.make
NONPIC_DIRS = memory oops gc_implementation gc_interface
NONPIC_DIRS := $(foreach dir,$(NONPIC_DIRS), $(GAMMADIR)/src/share/vm/$(dir))
# Look for source code under NONPIC_DIRS
NONPIC_FILES := $(foreach dir,$(NONPIC_DIRS),\
$(shell find $(dir) \( $(SCM_DIRS) \) -prune -o \
-name '*.cpp' -print))
NONPIC_OBJ_FILES := $(notdir $(subst .cpp,.o,$(NONPIC_FILES)))
include $(GAMMADIR)/make/defs.make
# Sun compiler for 64 bit Solaris does not support building non-PIC object files.
ifdef LP64
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册