summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2015-12-15 07:46:49 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2016-06-22 07:53:35 +0200
commite22dc2f712c95f179f260c183d93b84533e7ba58 (patch)
treedb3b7626c51331b3725e5edb14cc5fb29f5afab4
parentf73e963ec061570d5434878daf23cfdd1ff42725 (diff)
downloadOSELAS.Toolchain-e22dc2f712c95f179f260c183d93b84533e7ba58.tar.gz
improve debugging
* add more debugging symbols with -g3 * rewrite paths in the debugging data Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--rules/cross-gcc.make10
-rw-r--r--rules/glibc-crt.make1
-rw-r--r--rules/glibc-first.make1
-rw-r--r--rules/glibc.make1
-rw-r--r--rules/pre/toolchain.make13
5 files changed, 26 insertions, 0 deletions
diff --git a/rules/cross-gcc.make b/rules/cross-gcc.make
index 9cb6b01..7be17bc 100644
--- a/rules/cross-gcc.make
+++ b/rules/cross-gcc.make
@@ -100,6 +100,16 @@ CROSS_GCC_AUTOCONF_COMMON := \
$(call ptx/ifdef,PTXCONF_HOST_CLOOG,--with-cloog) \
$(call ptx/ifdef,PTXCONF_HOST_ISL,--with-isl)
+ifndef PTXCONF_TOOLCHAIN_DEBUG
+CROSS_GCC_AUTOCONF_COMMON += \
+ --with-debug-prefix-map="$(TOOLCHAIN_CROSS_DEBUG_MAP)" \
+ --enable-libstdcxx-debug-flags="-gdwarf-4 -O0 $(TOOLCHAIN_CROSS_DEBUG_FLAGS)"
+
+CROSS_GCC_CONF_ENV += \
+ CFLAGS_FOR_TARGET="$(TOOLCHAIN_CROSS_DEBUG_FLAGS)" \
+ CXXFLAGS_FOR_TARGET="$(TOOLCHAIN_CROSS_DEBUG_FLAGS)"
+endif
+
# --enable-tls enable or disable generation of tls code
# overriding the assembler check for tls support
# --enable-initfini-array use .init_array/.fini_array sections
diff --git a/rules/glibc-crt.make b/rules/glibc-crt.make
index a283f2c..c7c81cf 100644
--- a/rules/glibc-crt.make
+++ b/rules/glibc-crt.make
@@ -36,6 +36,7 @@ GLIBC_CRT_PATH := PATH=$(CROSS_PATH)
GLIBC_CRT_ENV := \
CC="$(CROSS_CC) -fuse-ld=bfd" \
BUILD_CC=$(HOSTCC) \
+ $(GLIBC_FLAGS_ENV) \
\
ac_cv_path_GREP=grep \
ac_cv_sizeof_long_double=$(PTXCONF_SIZEOF_LONG_DOUBLE) \
diff --git a/rules/glibc-first.make b/rules/glibc-first.make
index 5cf2327..c87ce21 100644
--- a/rules/glibc-first.make
+++ b/rules/glibc-first.make
@@ -38,6 +38,7 @@ GLIBC_FIRST_ENV := \
CC="$(CROSS_CC) -fuse-ld=bfd" \
CXX=false \
BUILD_CC=$(HOSTCC) \
+ $(GLIBC_FLAGS_ENV) \
\
libc_cv_c_cleanup=yes \
libc_cv_forced_unwind=yes \
diff --git a/rules/glibc.make b/rules/glibc.make
index e2a6811..b1cca77 100644
--- a/rules/glibc.make
+++ b/rules/glibc.make
@@ -52,6 +52,7 @@ GLIBC_ENV := \
CC="$(CROSS_CC) -fuse-ld=bfd" \
BUILD_CC=$(HOSTCC) \
MAKEINFO=: \
+ $(GLIBC_FLAGS_ENV) \
\
libc_cv_slibdir='/lib' \
\
diff --git a/rules/pre/toolchain.make b/rules/pre/toolchain.make
index 1b4f3f4..6a4c7ae 100644
--- a/rules/pre/toolchain.make
+++ b/rules/pre/toolchain.make
@@ -46,6 +46,19 @@ PTX_HOST_CROSS_AUTOCONF := \
#
PTXDIST_HOST_LDFLAGS := -L${PTXDIST_PATH_SYSROOT_HOST_PREFIX}/lib
+ifndef PTXCONF_TOOLCHAIN_DEBUG
+TOOLCHAIN_CROSS_DEBUG_FLAGS := \
+ -g3 \
+ -gno-record-gcc-switches
+
+TOOLCHAIN_CROSS_DEBUG_MAP := \
+ $(call remove_quotes,$(PTXCONF_DESTDIR))= \
+ $(PTXDIST_WORKSPACE)/platform-=$(call remove_quotes,$(PTXCONF_PROJECT))/platform-
+
+GLIBC_FLAGS_ENV += \
+ $(addsuffix "-O2 $(TOOLCHAIN_CROSS_DEBUG_FLAGS) $(addprefix -fdebug-prefix-map=,$(TOOLCHAIN_CROSS_DEBUG_MAP))",CFLAGS= CXXFLAGS=)
+endif
+
#
# gcc-first
#