8199483: Clean up some non-standard LDFLAGS usage
authorihse
Wed, 14 Mar 2018 11:23:16 +0100
changeset 49239 c35ec365e329
parent 49238 63eceefeb347
child 49240 5290e816c64c
child 56302 1c7ec9412f91
8199483: Clean up some non-standard LDFLAGS usage Reviewed-by: erikj
make/lib/Awt2dLibraries.gmk
make/lib/Lib-jdk.accessibility.gmk
make/lib/Lib-jdk.hotspot.agent.gmk
make/lib/LibCommon.gmk
src/jdk.accessibility/windows/native/libwindowsaccessbridge/WinAccessBridge.DEF
--- a/make/lib/Awt2dLibraries.gmk	Tue Mar 13 12:24:39 2018 -0700
+++ b/make/lib/Awt2dLibraries.gmk	Wed Mar 14 11:23:16 2018 +0100
@@ -950,7 +950,6 @@
   endif
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
-    LIBSPLASHSCREEN_LDFLAGS := -L$(INSTALL_LIBRARIES_HERE)
     LIBSPLASHSCREEN_LIBS += \
         $(LIBM) -lpthread -liconv -losxapp \
         -framework ApplicationServices \
@@ -958,7 +957,6 @@
         -framework Cocoa \
         -framework JavaNativeFoundation
   else ifeq ($(OPENJDK_TARGET_OS), windows)
-    LIBSPLASHSCREEN_LDFLAGS := -delayload:user32.dll
     LIBSPLASHSCREEN_LIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib $(WIN_JAVA_LIB) jvm.lib
   else
     LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread -ldl
@@ -980,8 +978,10 @@
           E_STATEMENT_NOT_REACHED, \
       DISABLED_WARNINGS_microsoft := 4018 4244 4267, \
       MAPFILE := $(TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
-      LDFLAGS := $(LIBSPLASHSCREEN_LDFLAGS) $(LDFLAGS_JDKLIB) \
+      LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
+      LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
+      LDFLAGS_windows := -delayload:user32.dll, \
       LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ_LIBS) \
           $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \
       LIBS_aix := -liconv, \
--- a/make/lib/Lib-jdk.accessibility.gmk	Tue Mar 13 12:24:39 2018 -0700
+++ b/make/lib/Lib-jdk.accessibility.gmk	Wed Mar 14 11:23:16 2018 +0100
@@ -50,7 +50,7 @@
             $(addprefix -I,$(JAVA_AB_SRCDIR)) \
             -I$(ROOT_SRCDIR)/include/bridge \
             -DACCESSBRIDGE_ARCH_$2, \
-        LDFLAGS := $(LDFLAGS_JDKLIB) -subsystem:windows, \
+        LDFLAGS := $(LDFLAGS_JDKLIB), \
         LIBS := kernel32.lib user32.lib gdi32.lib \
             winspool.lib comdlg32.lib advapi32.lib shell32.lib \
             $(SUPPORT_OUTPUTDIR)/native/java.desktop/libjawt/jawt.lib \
@@ -80,7 +80,7 @@
             $(addprefix -I,$(WIN_AB_SRCDIR)) \
             -I$(ROOT_SRCDIR)/include/bridge \
             -DACCESSBRIDGE_ARCH_$2, \
-        LDFLAGS := $(LDFLAGS_JDKLIB) -subsystem:windows \
+        LDFLAGS := $(LDFLAGS_JDKLIB) \
             -def:$(ROOT_SRCDIR)/libwindowsaccessbridge/WinAccessBridge.DEF, \
         LIBS := kernel32.lib user32.lib gdi32.lib \
             winspool.lib comdlg32.lib advapi32.lib shell32.lib \
@@ -105,8 +105,7 @@
         SRC := $(SYSINFO_SRCDIR), \
         OPTIMIZATION := LOW, \
         CFLAGS := $(CFLAGS_JDKLIB) $(ACCESSBRIDGE_CFLAGS), \
-        LDFLAGS := $(LDFLAGS_JDKLIB) \
-            -subsystem:windows -machine:I386, \
+        LDFLAGS := $(LDFLAGS_JDKLIB), \
         VERSIONINFO_RESOURCE := $(ROOT_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
         RC_FLAGS := $(RC_FLAGS) \
             -D "JDK_FNAME=jabsysinfo.dll" \
--- a/make/lib/Lib-jdk.hotspot.agent.gmk	Tue Mar 13 12:24:39 2018 -0700
+++ b/make/lib/Lib-jdk.hotspot.agent.gmk	Wed Mar 14 11:23:16 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
 
@@ -109,7 +99,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), \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsa, \
--- a/make/lib/LibCommon.gmk	Tue Mar 13 12:24:39 2018 -0700
+++ b/make/lib/LibCommon.gmk	Wed Mar 14 11:23:16 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
 
 GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc
 
-# Absolute paths to lib files on windows for use in LDFLAGS. Should figure out a more
+# Absolute paths to lib files on windows for use in LIBS. Should figure out a more
 # elegant solution to this.
 WIN_JAVA_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib
 
--- a/src/jdk.accessibility/windows/native/libwindowsaccessbridge/WinAccessBridge.DEF	Tue Mar 13 12:24:39 2018 -0700
+++ b/src/jdk.accessibility/windows/native/libwindowsaccessbridge/WinAccessBridge.DEF	Wed Mar 14 11:23:16 2018 +0100
@@ -1,5 +1,5 @@
 ;
-; Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+; Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
 ; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 ;
 ; This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
 ;LIBRARY	WINDOWSACCESSBRIDGE
 
 ;DESCRIPTION 'WINDOWSACCESSBRIDGE.DLL'
-HEAPSIZE	4096
 EXPORTS
 
     addJavaEventNotification