Patchwork toolchain/uClibc: properly honor DEBUG and STRIP options

login
register
mail settings
Submitter Gustavo Zacarias
Date June 21, 2013, 2:06 p.m.
Message ID <1371823618-23372-1-git-send-email-gustavo@zacarias.com.ar>
Download mbox | patch
Permalink /patch/253229/
State Accepted
Commit 0056b811f7c94ea8f31e138bf827c5ce90ea5b66
Headers show

Comments

Gustavo Zacarias - June 21, 2013, 2:06 p.m.
The default uClibc configurations strip the resulting binaries/libraries
and don't add debug symbols which is a problem when wanting to debug
issues.
Bind the buildroot BR2_STRIP_* option to uClibc .config DO_STRIP and
BR2_ENABLE_DEBUG to uClibc DO_DEBUG.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 toolchain/uClibc/uclibc.mk | 12 ++++++++++++
 1 file changed, 12 insertions(+)
Peter Korsgaard - June 27, 2013, 7:58 p.m.
>>>>> "Gustavo" == Gustavo Zacarias <gustavo@zacarias.com.ar> writes:

 Gustavo> The default uClibc configurations strip the resulting
 Gustavo> binaries/libraries and don't add debug symbols which is a
 Gustavo> problem when wanting to debug issues.  Bind the buildroot
 Gustavo> BR2_STRIP_* option to uClibc .config DO_STRIP and
 Gustavo> BR2_ENABLE_DEBUG to uClibc DO_DEBUG.

Committed, thanks.

Patch

diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk
index da1830f..2036dab 100644
--- a/toolchain/uClibc/uclibc.mk
+++ b/toolchain/uClibc/uclibc.mk
@@ -287,6 +287,18 @@  endif
 	$(SED) '/LINUXTHREADS_OLD/d' $(UCLIBC_DIR)/.oldconfig
 	$(SED) '/PTHREADS_DEBUG_SUPPORT/d' $(UCLIBC_DIR)/.oldconfig
 	$(SED) '/UCLIBC_HAS_THREADS_NATIVE/d' $(UCLIBC_DIR)/.oldconfig
+	$(SED) '/DODEBUG /d' $(UCLIBC_DIR)/.oldconfig
+	$(SED) '/DOSTRIP/d' $(UCLIBC_DIR)/.oldconfig
+ifeq ($(BR2_STRIP_none),y)
+	echo "# DOSTRIP is not set" >> $(UCLIBC_DIR)/.oldconfig
+else
+	echo "DOSTRIP=y" >> $(UCLIBC_DIR)/.oldconfig
+endif
+ifeq ($(BR2_ENABLE_DEBUG),y)
+	echo "DODEBUG=y" >> $(UCLIBC_DIR)/.oldconfig
+else
+	echo "# DODEBUG is not set" >> $(UCLIBC_DIR)/.oldconfig
+endif
 ifeq ($(BR2_PTHREADS_NONE),y)
 	echo "# UCLIBC_HAS_THREADS is not set" >> $(UCLIBC_DIR)/.oldconfig
 else