srd
srd

Reputation: 1267

Unable to get unstripped runtime libs from buildroot

I am trying to get buildroot 2012.08 to generate unstripped libs and binaries in output/staging. I enabled "Build packages with debugging symbols" under Build options:

BR2_ENABLE_DEBUG=y
# BR2_DEBUG_1 is not set
BR2_DEBUG_2=y
# BR2_DEBUG_3 is not set
# BR2_STRIP_strip is not set
BR2_STRIP_sstrip=y

This is what I get:

$ file output/staging/lib/*
output/staging/lib/ld-uClibc-0.9.33.2.so:    ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, stripped
output/staging/lib/ld-uClibc.so.0:           symbolic link to `ld-uClibc-0.9.33.2.so'
output/staging/lib/libcrypt-0.9.33.2.so:     ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, stripped
output/staging/lib/libcrypt.so.0:            symbolic link to `libcrypt-0.9.33.2.so'
output/staging/lib/libc.so.0:                symbolic link to `libuClibc-0.9.33.2.so'
output/staging/lib/libdl-0.9.33.2.so:        ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, stripped
output/staging/lib/libdl.so.0:               symbolic link to `libdl-0.9.33.2.so'
output/staging/lib/libgcc_s.so:              symbolic link to `libgcc_s.so.1'
output/staging/lib/libgcc_s.so.1:            ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, not stripped
output/staging/lib/libiw.so:                 symbolic link to `libiw.so.29'
output/staging/lib/libiw.so.29:              ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, not stripped
output/staging/lib/libm-0.9.33.2.so:         ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, stripped
output/staging/lib/libm.so.0:                symbolic link to `libm-0.9.33.2.so'
output/staging/lib/libnsl-0.9.33.2.so:       ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, stripped
output/staging/lib/libnsl.so.0:              symbolic link to `libnsl-0.9.33.2.so'
output/staging/lib/libpthread-0.9.33.2.so:   ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, not stripped
output/staging/lib/libpthread.so.0:          symbolic link to `libpthread-0.9.33.2.so'
output/staging/lib/libresolv-0.9.33.2.so:    ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, stripped
output/staging/lib/libresolv.so.0:           symbolic link to `libresolv-0.9.33.2.so'
output/staging/lib/librt-0.9.33.2.so:        ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, stripped
output/staging/lib/librt.so.0:               symbolic link to `librt-0.9.33.2.so'
output/staging/lib/libthread_db-0.9.33.2.so: ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, not stripped
output/staging/lib/libthread_db.so.1:        symbolic link to `libthread_db-0.9.33.2.so'
output/staging/lib/libuClibc-0.9.33.2.so:    ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, stripped
output/staging/lib/libutil-0.9.33.2.so:      ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, stripped
output/staging/lib/libutil.so.0:             symbolic link to `libutil-0.9.33.2.so'

All stripped except libpthread and libthread_db !!

Any ideas ?

Upvotes: 3

Views: 2980

Answers (3)

Alex Potapenko
Alex Potapenko

Reputation: 176

I faced the same problem with 2012.02, and there is a simple cure for this. Just edit your uclibc config file (in my case it was toolchain/uClibc/uClibc-0.9.32.config) and change line

DOSTRIP=y

to

# DOSTRIP is not set

This will disable stripping uclibc libraries during build time:

$ file output/staging/lib/*
output/staging/lib/ld-uClibc-0.9.32.1.so:    ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, not stripped
output/staging/lib/ld-uClibc.so.0:           symbolic link to `ld-uClibc-0.9.32.1.so' 
output/staging/lib/libcrypt-0.9.32.1.so:     ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
output/staging/lib/libcrypt.so.0:            symbolic link to `libcrypt-0.9.32.1.so' 
output/staging/lib/libc.so.0:                symbolic link to `libuClibc-0.9.32.1.so' 
output/staging/lib/libdl-0.9.32.1.so:        ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
output/staging/lib/libdl.so.0:               symbolic link to `libdl-0.9.32.1.so' 
output/staging/lib/libgcc_s.so:              ASCII text
output/staging/lib/libgcc_s.so.1:            ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, not stripped
output/staging/lib/libm-0.9.32.1.so:         ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
output/staging/lib/libm.so.0:                symbolic link to `libm-0.9.32.1.so' 
output/staging/lib/libnsl-0.9.32.1.so:       ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
output/staging/lib/libnsl.so.0:              symbolic link to `libnsl-0.9.32.1.so' 
output/staging/lib/libpthread-0.9.32.1.so:   ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
output/staging/lib/libpthread.so.0:          symbolic link to `libpthread-0.9.32.1.so' 
output/staging/lib/libresolv-0.9.32.1.so:    ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
output/staging/lib/libresolv.so.0:           symbolic link to `libresolv-0.9.32.1.so' 
output/staging/lib/librt-0.9.32.1.so:        ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
output/staging/lib/librt.so.0:               symbolic link to `librt-0.9.32.1.so' 
output/staging/lib/libthread_db-0.9.32.1.so: ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
output/staging/lib/libthread_db.so.1:        symbolic link to `libthread_db-0.9.32.1.so' 
output/staging/lib/libuClibc-0.9.32.1.so:    ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
output/staging/lib/libutil-0.9.32.1.so:      ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
output/staging/lib/libutil.so.0:             symbolic link to `libutil-0.9.32.1.so'

All unstripped.

Upvotes: 0

Arnout
Arnout

Reputation: 3484

Stripping and debug symbols are independent items - though stripping in buildroot does also remove the debug symbols.

To disable stripping, you need to set BR2_STRIP_none: choose none in strip command for binaries on target. Don't forget to make clean after selecting this option. You can also add a list of files or directories that should not be stripped, in the executables that should not be stripped option.

The strip options, however, only affect the binaries and libraries on the target. Buildroot never strips the binaries and libraries in output/staging. However, the individual package build systems may do that. In the question, you refer to the standard C libraries generated by uClibc. uClibc's configuration has a specific option for stripping: DOSTRIP - and this option defaults to true. Buildroot tries to set that option according to the BR2_STRIP choice, but this didn't work correctly before commit e090aeaa from mid-December 2013.

Upvotes: 2

srd
srd

Reputation: 1267

2012.05 has the same problem. 2013.11 fixes it: all libs came unstripped.

Upvotes: 2

Related Questions