Skip to content

Commit

Permalink
Compile twice for DDR on z/OS so optimization is not hindered
Browse files Browse the repository at this point in the history
Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
  • Loading branch information
keithc-ca committed Oct 22, 2020
1 parent 34e6c71 commit 35961cb
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions omrmakefiles/rules.zos.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,22 @@ endif
ifeq ($(OMR_ENHANCED_WARNINGS),1)
endif

# Enable Debugging Symbols
# Enable debugging symbols?
ifeq ($(ENABLE_DDR),yes)
GLOBAL_CFLAGS += -Wc,debug
GLOBAL_CXXFLAGS += -Wc,debug
else ifeq ($(OMR_DEBUG),1)
endif
# Optimization is limited when using '-Wc,debug', but *.dbg files are required for DDR.
# Override compile commands to compile twice: once with '-Wc,debug', and a second time
# without that option.

define COMPILE_C_COMMAND
$(CC) $(CPPFLAGS) $(MODULE_CPPFLAGS) $(GLOBAL_CPPFLAGS) -c $(GLOBAL_CFLAGS) $(MODULE_CFLAGS) $(CFLAGS) -Wc,debug -o $@ $<
$(CC) $(CPPFLAGS) $(MODULE_CPPFLAGS) $(GLOBAL_CPPFLAGS) -c $(GLOBAL_CFLAGS) $(MODULE_CFLAGS) $(CFLAGS) -o $@ $<
endef

define COMPILE_CXX_COMMAND
$(CXX) $(CPPFLAGS) $(MODULE_CPPFLAGS) $(GLOBAL_CPPFLAGS) -c $(GLOBAL_CXXFLAGS) $(MODULE_CXXFLAGS) $(CXXFLAGS) -Wc,debug -o $@ $<
$(CXX) $(CPPFLAGS) $(MODULE_CPPFLAGS) $(GLOBAL_CPPFLAGS) -c $(GLOBAL_CXXFLAGS) $(MODULE_CXXFLAGS) $(CXXFLAGS) -o $@ $<
endef
endif # ENABLE_DDR

# Enable Optimizations
ifeq ($(OMR_OPTIMIZE),1)
Expand Down

0 comments on commit 35961cb

Please sign in to comment.