diff mbox

glibc: add debug symbols when BR2_ENABLE_DEBUG

Message ID 5517167ba77f268eeeaa8c5763078aeeb53741c6.1420107403.git.baruch@tkos.co.il
State Accepted
Headers show

Commit Message

Baruch Siach Jan. 1, 2015, 10:16 a.m. UTC
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 package/glibc/glibc.mk | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Thomas Petazzoni Jan. 1, 2015, 10:29 a.m. UTC | #1
Dear Baruch Siach,

On Thu,  1 Jan 2015 12:16:43 +0200, Baruch Siach wrote:
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  package/glibc/glibc.mk | 4 ++++
>  1 file changed, 4 insertions(+)

Thanks!

Do you know if there's an easy way of checking if ELF binaries have
debugging symbols? If so, we could add a check to verify that all ELF
binaries have debugging symbols when BR2_ENABLE_DEBUG=y, and add this
check in the autobuilders.

Best regards,

Thomas
Baruch Siach Jan. 1, 2015, 10:36 a.m. UTC | #2
Hi Thomas,

On Thu, Jan 01, 2015 at 11:29:40AM +0100, Thomas Petazzoni wrote:
> On Thu,  1 Jan 2015 12:16:43 +0200, Baruch Siach wrote:
> > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> > ---
> >  package/glibc/glibc.mk | 4 ++++
> >  1 file changed, 4 insertions(+)
> 
> Thanks!
> 
> Do you know if there's an easy way of checking if ELF binaries have
> debugging symbols? If so, we could add a check to verify that all ELF
> binaries have debugging symbols when BR2_ENABLE_DEBUG=y, and add this
> check in the autobuilders.

I guess looking for '.debug_info' in the output of 'objdump -h' or 'readelf 
-S' should be enough.

baruch
Thomas Petazzoni Jan. 7, 2015, 10 p.m. UTC | #3
Dear Baruch Siach,

On Thu,  1 Jan 2015 12:16:43 +0200, Baruch Siach wrote:
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  package/glibc/glibc.mk | 4 ++++
>  1 file changed, 4 insertions(+)

Applied, thanks!

Maybe we should also take care of the same thing in uClibc? musl is OK,
we use $(TARGET_CFLAGS).

Thanks,

Thomas
diff mbox

Patch

diff --git a/package/glibc/glibc.mk b/package/glibc/glibc.mk
index 65f4ed3b0d97..0a37bb361a07 100644
--- a/package/glibc/glibc.mk
+++ b/package/glibc/glibc.mk
@@ -47,6 +47,10 @@  else ifeq ($(BR2_MIPS_OABI32),y)
 GLIBC_EXTRA_CFLAGS += -mabi=32
 endif
 
+ifeq ($(BR2_ENABLE_DEBUG),y)
+GLIBC_EXTRA_CFLAGS += -g
+endif
+
 # The stubs.h header is not installed by install-headers, but is
 # needed for the gcc build. An empty stubs.h will work, as explained
 # in http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html. The same trick