changeset 9031:21884257c797

8210647: libsaproc is being compiled without optimization Reviewed-by: erikj, jcbeyler
author sgehwolf
date Fri, 09 Nov 2018 10:38:30 +0100
parents a253fe293726
children adc49d072b7c
files make/linux/makefiles/saproc.make make/windows/makefiles/sa.make
diffstat 2 files changed, 17 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/make/linux/makefiles/saproc.make	Wed Dec 05 16:59:12 2018 -0500
+++ b/make/linux/makefiles/saproc.make	Fri Nov 09 10:38:30 2018 +0100
@@ -59,6 +59,11 @@
   SA_DEBUG_CFLAGS = -g
 endif
 
+# Optimize saproc lib at level -O3 unless it's a slowdebug build
+ifneq ($(BUILD_FLAVOR), debug)
+  SA_OPT_FLAGS = $(OPT_CFLAGS)
+endif
+
 # if $(AGENT_DIR) does not exist, we don't build SA
 # also, we don't build SA on Itanium or zero.
 
@@ -95,6 +100,7 @@
 	           $(SASRCFILES)                                        \
 	           $(SA_LFLAGS)                                         \
 	           $(SA_DEBUG_CFLAGS)                                   \
+	           $(SA_OPT_FLAGS)                                      \
 	           $(EXTRA_CFLAGS)                                      \
 	           -o $@                                                \
 	           -lthread_db -ldl
--- a/make/windows/makefiles/sa.make	Wed Dec 05 16:59:12 2018 -0500
+++ b/make/windows/makefiles/sa.make	Fri Nov 09 10:38:30 2018 +0100
@@ -99,20 +99,25 @@
 
 checkAndBuildSA:: $(SAWINDBG)
 
-# These do not need to be optimized (don't run a lot of code) and it
-# will be useful to have the assertion checks in place
+!if "$(BUILD_FLAVOR)" == "debug"
+SA_EXTRA_CFLAGS = -Od -D "_DEBUG"
+!elseif "$(BUILD_FLAVOR)" == "fastdebug"
+SA_EXTRA_CFLAGS = -O2 -D "_DEBUG"
+!else
+SA_EXTRA_CFLAGS = -O2
+!endif
 
 !if "$(BUILDARCH)" == "ia64"
-SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -YX -FD -c
+SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -D "WIN32" -D "WIN64" -D "_WINDOWS"  -D "_CONSOLE" -D "_MBCS" -YX -FD -c
 !elseif "$(BUILDARCH)" == "amd64"
-SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -YX -FD -c
+SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_CONSOLE" -D "_MBCS" -YX -FD -c
 !if "$(COMPILER_NAME)" == "VS2005"
 # On amd64, VS2005 compiler requires bufferoverflowU.lib on the link command line, 
 # otherwise we get missing __security_check_cookie externals at link time. 
 SA_LD_FLAGS = bufferoverflowU.lib
 !endif
 !else
-SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 -Gm $(GX_OPTION) -Od -D "WIN32" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -YX -FD -GZ -c
+SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 -Gm $(GX_OPTION) -D "WIN32" -D "_WINDOWS" -D "_CONSOLE" -D "_MBCS" -YX -FD -GZ -c
 !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
 SA_CFLAGS = $(SA_CFLAGS) -ZI
 !endif
@@ -120,6 +125,7 @@
 !if "$(MT)" != ""
 SA_LD_FLAGS = -manifest $(SA_LD_FLAGS)
 !endif
+SA_CFLAGS = $(SA_CFLAGS) $(SA_EXTRA_CFLAGS)
 
 SASRCFILES = $(AGENT_DIR)/src/os/win32/windbg/sawindbg.cpp \
 		$(AGENT_DIR)/src/share/native/sadis.c