--- a/make/lib/Lib-jdk.hotspot.agent.gmk Wed Mar 14 12:45:08 2018 +0100
+++ b/make/lib/Lib-jdk.hotspot.agent.gmk Wed Mar 14 12:50:43 2018 +0100
@@ -46,33 +46,26 @@
-I$(TOPDIR)/src/hotspot/os/$(OPENJDK_TARGET_OS) \
#
-ifeq ($(OPENJDK_TARGET_CPU), x86_64)
- SA_MACHINE_FLAG_windows := -machine:AMD64
-else ifeq ($(OPENJDK_TARGET_CPU), x86)
- SA_MACHINE_FLAG_linux := -march=i586
- SA_MACHINE_FLAG_windows := -machine:I386
-endif
+ifeq ($(OPENJDK_TARGET_OS), linux)
+ SA_CFLAGS := $(CFLAGS_JDKLIB) -D_FILE_OFFSET_BITS=64
+ ifeq ($(OPENJDK_TARGET_CPU), x86)
+ SA_LDFLAGS := -march=i586
+ endif
-ifeq ($(OPENJDK_TARGET_OS), linux)
- SA_CFLAGS := $(CFLAGS_JDKLIB) -D_FILE_OFFSET_BITS=64 \
- $(SA_MACHINE_FLAG_linux)
- SA_LDFLAGS := $(LDFLAGS_JDKLIB) $(SA_MACHINE_FLAG_linux)
SA_LIBS := -lthread_db $(LIBDL)
else ifeq ($(OPENJDK_TARGET_OS), solaris)
SA_TOOLCHAIN := TOOLCHAIN_LINK_CXX
SA_CFLAGS := $(CFLAGS_JDKLIB)
SA_CXXFLAGS := $(CXXFLAGS_JDKLIB)
- SA_LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,, $(LDFLAGS_JDKLIB)) \
- -mt $(LDFLAGS_CXX_JDK)
- SA_LIBS := -ldl -ldemangle -lthread -lc
+ SA_LDFLAGS := -mt $(LDFLAGS_CXX_JDK)
+ SA_LIBS := -ldl -ldemangle -lthread -lc -lproc
else ifeq ($(OPENJDK_TARGET_OS), macosx)
SA_EXCLUDE_FILES := BsdDebuggerLocal.c ps_proc.c salibelf.c StubDebuggerLocal.c
SA_CFLAGS := $(CFLAGS_JDKLIB) \
-Damd64 -D_GNU_SOURCE -mno-omit-leaf-frame-pointer \
-mstack-alignment=16 -fPIC
- SA_LDFLAGS := $(LDFLAGS_JDKLIB)
SA_LIBS := -framework Foundation -framework JavaNativeFoundation \
-framework JavaRuntimeSupport -framework Security -framework CoreFoundation
@@ -83,15 +76,12 @@
$(COMMON_CFLAGS)
SA_CXXFLAGS := $(subst -DWIN32_LEAN_AND_MEAN,, $(CXXFLAGS_JDKLIB)) \
$(COMMON_CFLAGS)
- SA_LDFLAGS := $(LDFLAGS_JDKLIB) \
- $(SA_MACHINE_FLAG_windows) -manifest \
- -subsystem:console -map
+ SA_LDFLAGS := -manifest
SA_LIBS := dbgeng.lib
ifeq ($(OPENJDK_TARGET_CPU), x86_64)
SA_CXXFLAGS += -DWIN64
else
SA_CXXFLAGS += -RTC1
- SA_LDFLAGS += -SAFESEH
endif
endif
@@ -108,7 +98,7 @@
EXCLUDE_FILES := test.c saproc_audit.cpp $(SA_EXCLUDE_FILES), \
CFLAGS := $(SA_INCLUDES) $(SA_CFLAGS) $(SA_CUSTOM_CFLAGS), \
CXXFLAGS := $(SA_INCLUDES) $(SA_CXXFLAGS) $(SA_CUSTOM_CXXFLAGS), \
- LDFLAGS := $(SA_LDFLAGS) $(SA_CUSTOM_LDFLAGS), \
+ LDFLAGS := $(LDFLAGS_JDKLIB) $(SA_LDFLAGS), \
LIBS := $(SA_LIBS), \
MAPFILE := $(SA_MAPFILE), \
))