changeset 51769:a8ee31fb99e1

8207057: No debug info for assembler files Summary: Generate debug info for assembler files as needed. Reviewed-by: erikj
author sgehwolf
date Thu, 12 Jul 2018 16:28:31 +0200
parents a49d106e9b7c
children 695dff91a997
files make/autoconf/flags-cflags.m4 make/autoconf/spec.gmk.in make/common/NativeCompilation.gmk
diffstat 3 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/make/autoconf/flags-cflags.m4	Mon Jul 16 12:35:25 2018 +0200
+++ b/make/autoconf/flags-cflags.m4	Thu Jul 12 16:28:31 2018 +0200
@@ -106,11 +106,17 @@
 
 AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
 [
+  # By default don't set any specific assembler debug
+  # info flags for toolchains unless we know they work.
+  # See JDK-8207057.
+  ASFLAGS_DEBUG_SYMBOLS=""
   # Debug symbols
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
     CFLAGS_DEBUG_SYMBOLS="-g"
+    ASFLAGS_DEBUG_SYMBOLS="-g"
   elif test "x$TOOLCHAIN_TYPE" = xclang; then
     CFLAGS_DEBUG_SYMBOLS="-g"
+    ASFLAGS_DEBUG_SYMBOLS="-g"
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     # -g0 enables debug symbols without disabling inlining.
     CFLAGS_DEBUG_SYMBOLS="-g0 -xs"
@@ -121,6 +127,7 @@
   fi
 
   AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
+  AC_SUBST(ASFLAGS_DEBUG_SYMBOLS)
 ])
 
 AC_DEFUN([FLAGS_SETUP_WARNINGS],
--- a/make/autoconf/spec.gmk.in	Mon Jul 16 12:35:25 2018 +0200
+++ b/make/autoconf/spec.gmk.in	Thu Jul 12 16:28:31 2018 +0200
@@ -532,6 +532,7 @@
 ZIP_EXTERNAL_DEBUG_SYMBOLS := @ZIP_EXTERNAL_DEBUG_SYMBOLS@
 
 CFLAGS_DEBUG_SYMBOLS:=@CFLAGS_DEBUG_SYMBOLS@
+ASFLAGS_DEBUG_SYMBOLS:=@ASFLAGS_DEBUG_SYMBOLS@
 
 #
 # Compress (or not) jars
--- a/make/common/NativeCompilation.gmk	Mon Jul 16 12:35:25 2018 +0200
+++ b/make/common/NativeCompilation.gmk	Thu Jul 12 16:28:31 2018 +0200
@@ -251,6 +251,7 @@
         $$($$($1_BASE)_SYSROOT_CFLAGS)
     $1_BASE_CXXFLAGS := $$($$($1_BASE)_CXXFLAGS) $$($$($1_BASE)_EXTRA_CXXFLAGS) \
         $$($$($1_BASE)_SYSROOT_CFLAGS) $$($1_EXTRA_CXXFLAGS)
+    $1_BASE_ASFLAGS := $$($$($1_BASE)_ASFLAGS) $$($$($1_BASE)_EXTRA_ASFLAGS)
 
     ifneq ($$(filter %.c, $$($1_FILENAME)), )
       # Compile as a C file
@@ -266,7 +267,7 @@
       $1_DEP_FLAG := $(C_FLAG_DEPS)
     else ifneq ($$(filter %.s %.S, $$($1_FILENAME)), )
       # Compile as assembler file
-      $1_FLAGS := $$($$($1_BASE)_ASFLAGS)
+      $1_FLAGS := $$($1_BASE_ASFLAGS)
       $1_COMPILER := $(AS)
       $1_DEP_FLAG :=
     else ifneq ($$(filter %.cpp %.cc %.mm, $$($1_FILENAME)), )
@@ -576,6 +577,7 @@
   ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
     $1_EXTRA_CFLAGS += $$(CFLAGS_DEBUG_SYMBOLS)
     $1_EXTRA_CXXFLAGS += $$(CFLAGS_DEBUG_SYMBOLS)
+    $1_EXTRA_ASFLAGS += $$(ASFLAGS_DEBUG_SYMBOLS)
   endif
 
   ifneq ($$($1_REORDER), )