Skip to contentSkip to conversation

-dbg for static libraries?

RFC Denys Dmytriyenko 5 participants 7 messages Sep 17, 2009 – Sep 20, 2009

lore
Share & tools
lore
#0 lore raw

As target binaries and libraries are now built with extra debugging symbols, some of the -dbg packages are very large. Unfortunately, -dbg packages only contain debug versions of executable binaries and shared libraries, but not static libraries, which go directly into -dev packages. That increases the size of sdk/toolchain tarballs, which include -dev packages, depending on the main packages, and end up with stripped shared libs, but bloated static libs.

I understand, that -dev packages are specifically for development and having full debugging symbols in a library might be helpful for that, but -dev packages don't usually depend on -dbg, and most toolchain-target tasks don't include them either, hence not providing debugging versions of shared libs in the sdk/toolchain.

Would it make sense to package stripped version of a static lib into -dev and the full version into corresponding -dbg?

Signature · 1 line
Denys
#1 lore raw
Quoted 7 lines · Denys Dmytriyenko

As target binaries and libraries are now built with extra debugging symbols, some of the -dbg packages are very large. Unfortunately, -dbg packages only contain debug versions of executable binaries and shared libraries, but not static libraries, which go directly into -dev packages. That increases the size of sdk/toolchain tarballs, which include -dev packages, depending on the main packages, and end up with stripped shared libs, but bloated static libs.

Quoted 8 lines

I understand, that -dev packages are specifically for development and having full debugging symbols in a library might be helpful for that, but -dev packages don't usually depend on -dbg, and most toolchain-target tasks don't include them either, hence not providing debugging versions of shared libs in the sdk/toolchain.

Would it make sense to package stripped version of a static lib into -dev and the full version into corresponding -dbg?

What about the stripped version in -dev and the corresponding symbols in -dbg?

regards,

Koen

#3 lore raw
In reply to Denys Dmytriyenko
Quoted 2 lines · Denys Dmytriyenko

Would it make sense to package stripped version of a static lib into -dev and the full version into corresponding -dbg?

I'm not sure that you'd want the debugging .a file in -dbg itself, since the -dbg packages are for installation on the target device and the .a libraries would be useless there.

Punting the debug versions of the .a libraries into a new package (-static-dbg or some such) wouldn't be a bad idea. Or, for SDK purposes, you could even consider ditching the .a libraries altogether for packages that have a .so since virtually nobody is going to be doing static linking in this day and age.

p.

#2 lore raw
In reply to Koen Kooi
Quoted 5 lines · Koen Kooi
Quoted 2 lines

Would it make sense to package stripped version of a static lib into -dev and the full version into corresponding -dbg?

What about the stripped version in -dev and the corresponding symbols in -dbg?

Or:

1. Disable static by default. Static libraries are rarely needed. Recipes (or distros) that want static libraries must explicitly enable it.

2. What about -dev, -dbg, -static and -static-dbg? I have tens of .a files installed on my microdrive, because .so* are sufficient.

Four sub-packages may sound as a overkill, but I don't think so. Static counterparts of shared libraries are really very rarely needed.

It would need to improve the splitting logic a bit, but it is still possible to automatize it:

- libfoo.so was installed -> libfoo.a should go to -static and dbg to -static-dbg.

- libfoo.a was installed alone -> libfoo.a should go to -static and dbg to -static-dbg.

- very few packages need to be handled individually (e. g. glibc, packages that install libfoo_pic.a etc.)

Signature · 2 lines
Stanislav Brabec
http://www.penguin.cz/~utx/zaurus
#4 lore raw
In reply to Phil Blundell
Quoted 8 lines · Phil Blundell
Quoted 2 lines · Denys Dmytriyenko

Would it make sense to package stripped version of a static lib into -dev and the full version into corresponding -dbg?

I'm not sure that you'd want the debugging .a file in -dbg itself, since the -dbg packages are for installation on the target device and the .a libraries would be useless there.

Quoted 5 lines

Punting the debug versions of the .a libraries into a new package (-static-dbg or some such) wouldn't be a bad idea. Or, for SDK purposes, you could even consider ditching the .a libraries altogether for packages that have a .so since virtually nobody is going to be doing static linking in this day and age.

I often do static linking for different reasons:
*different libc on the target(like with android for instance) *debugging(like in the case where all shared libs segfaulted on mips +uclibc,I needed a static gdb,a static strace etc...) Denis

#5 lore raw
Quoted 9 lines · GNUtoo
Quoted 3 lines · Phil Blundell

Or, for SDK purposes, you could even consider ditching the .a libraries altogether for packages that have a .so since virtually nobody is going to be doing static linking in this day and age.

I often do static linking for different reasons:
*different libc on the target(like with android for instance) *debugging(like in the case where all shared libs segfaulted on mips +uclibc,I needed a static gdb,a static strace etc...)

Neither of those are really the kind of use-cases that the SDK is targeting. If you are doing initial bringup/debug on a particular target system then you would probably want to use an in-tree build just as you do today.

The SDK exists to support casual software development on relatively stable target platforms, by people who don't wish to build the entire system from scratch for themselves, and in almost all cases you don't want to encourage static linking there.

p.

#6 lore raw
Quoted 16 lines · Phil Blundell
Quoted 9 lines · GNUtoo
Quoted 3 lines · Phil Blundell

Or, for SDK purposes, you could even consider ditching the .a libraries altogether for packages that have a .so since virtually nobody is going to be doing static linking in this day and age.

I often do static linking for different reasons:
*different libc on the target(like with android for instance) *debugging(like in the case where all shared libs segfaulted on mips +uclibc,I needed a static gdb,a static strace etc...)

Neither of those are really the kind of use-cases that the SDK is targeting. If you are doing initial bringup/debug on a particular target system then you would probably want to use an in-tree build just as you do today.

Quoted 6 lines

The SDK exists to support casual software development on relatively stable target platforms, by people who don't wish to build the entire system from scratch for themselves, and in almost all cases you don't want to encourage static linking there.

p.

ok thanks for the explanations...I think I have read too fast(lots of mails) (I was thinking that the static libraries were to be removed in the normal in-tree build)
Denis.