8047321: Hotspot debug builds with clang are broken
authoriveresov
Fri, 20 Jun 2014 11:25:08 -0700
changeset 25340 cecf01c76a9e
parent 25339 ca74d9691341
child 25342 dc2561419945
8047321: Hotspot debug builds with clang are broken Summary: Don't use -Og with clang Reviewed-by: twisti
hotspot/make/bsd/makefiles/gcc.make
--- a/hotspot/make/bsd/makefiles/gcc.make	Fri Jun 20 09:25:13 2014 +0200
+++ b/hotspot/make/bsd/makefiles/gcc.make	Fri Jun 20 11:25:08 2014 -0700
@@ -280,7 +280,10 @@
 
 # optimization control flags (Used by fastdebug and release variants)
 OPT_CFLAGS/NOOPT=-O0
-ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
+ifeq ($(USE_CLANG), true)
+  # Clang does not support -Og
+  OPT_CFLAGS/DEBUG=-O0
+else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
   # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
   OPT_CFLAGS/DEBUG=-Og
 else
@@ -443,7 +446,10 @@
   CFLAGS += -flimit-debug-info
 endif
 
-ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
+ifeq ($(USE_CLANG), true)
+  # Clang does not support -Og
+  DEBUG_CFLAGS=-O0
+else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
   # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
   DEBUG_CFLAGS=-Og
 else