3

我正在尝试让 buildroot 2012.08 在输出/暂存中生成未剥离的库和二进制文件。我在构建选项下启用了“带有调试符号的构建包”:

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

这就是我得到的:

$ 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'

除 libpthread 和 libthread_db 之外的所有内容都已剥离!!

有任何想法吗 ?

4

3 回答 3

2

2012.05 也有同样的问题。2013.11 修复它:所有库都未剥离。

于 2014-01-13T23:41:39.513 回答
2

剥离和调试符号是独立的项目——尽管在 buildroot 中剥离也会删除调试符号。

要禁用剥离,您需要设置 BR2_STRIP_none:在strip 命令中为 target 上的二进制文件选择none。选择此选项后不要忘记进行清洁。您还可以在不应剥离的可执行文件选项中添加不应剥离的文件或目录的列表。

但是,剥离选项仅影响目标上的二进制文件和库。Buildroot 从不剥离输出/暂存中的二进制文件和库。但是,单独的包构建系统可能会这样做。在问题中,您指的是由 uClibc 生成的标准 C 库。uClibc 的配置有一个特定的剥离选项:DOSTRIP - 此选项默认为 true。Buildroot 尝试根据 BR2_STRIP 选项设置该选项,但这在 2013 年 12 月中旬提交 e090aeaa 之前无法正常工作。

于 2014-01-14T08:02:36.337 回答
0

我在 2012.02 中遇到了同样的问题,并且有一个简单的解决方法。只需编辑您的 uclibc 配置文件(在我的情况下是 toolchain/uClibc/uClibc-0.9.32.config)并更改行

DOSTRIP=y

# DOSTRIP is not set

这将在构建期间禁用剥离 uclibc 库:

$ 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'

都脱光了。

于 2015-01-15T11:31:32.910 回答