<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13576</bug_id>
          
          <creation_ts>2019-10-05 17:37:59 +0000</creation_ts>
          <short_desc>shared libs (.so) vs. static libs (.a)</short_desc>
          <delta_ts>2019-10-29 11:20:18 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>oe-core other</component>
          <version>2.7.2</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Berger">pokylinux</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>85223</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2019-10-05 17:37:59 +0000</bug_when>
    <thetext>Please correct me if I&apos;m wrong here, and/or please tell me what I am missing here

* This is my understanding about .so packaging: *

{PN}: main package, stripped (no symbols, no debug info)

── libhwtest-cmake-so-a
│   └── usr
│       └── lib
│           ├── libhwtestcmake.so.0 -&gt; libhwtestcmake.so.0.0.0
│           └── libhwtestcmake.so.0.0.0

{PN}-dbg: debug info (for debugging)

├── libhwtest-cmake-so-a-dbg
│   └── usr
│       └── lib
│           └── .debug
│               └── libhwtestcmake.so.0.0.0

{PN}-src: sources (for debugging)

── libhwtest-cmake-so-a-src
│   └── usr
│       └── src
│           └── debug
│               └── libhwtest-cmake-so-a
│                   └── 1.0-r0
│                       ├── hwtest-cmake1.c
│                       └── hwtest-cmake2.c

{PN}-src: for SDK

── libhwtest-cmake-so-a-dev
│   └── usr
│       ├── include
│       │   └── hwtest-cmake.h
│       └── lib
│           └── libhwtestcmake.so -&gt; libhwtestcmake.so.0


-----------------

so far so good and I guess I&apos;m happy with this.

* This is my understanding about .a (staticdev) packaging: *

├── libhw-cmake-a
├── libhw-cmake-a-dbg
├── libhw-cmake-a-dev         &lt;-- for the SDK
│   └── usr
│       └── include
│           └── hw-cmake.h
├── libhw-cmake-a-doc
├── libhw-cmake-a-locale
├── libhw-cmake-a-src
└── libhw-cmake-a-staticdev  &lt;-- for the SDK
    └── usr
        └── lib
            └── libhwcmake.a


issue 1)

{PN}-src:
libhw-cmake-a-src seems to be empty by default, I thought it should contain the sources

issue 2)

{PN}-dbg, or {PN}-staticdev-dbg
.debug
     └── libhw-cmake-a-staticdev.a

libhw-cmake-a-dbg seems to be empty by default, I thought it should contain the debug info

issue 3)

{PN}-staticdev: 
libhw-cmake-a-staticdev.a
seems to be with debug info and not stripped, I thought it should be stripped and without debug info

Is it like this by design?

{PN}-dev: 
├── libhw-cmake-a-dev         &lt;-- for the SDK
│   └── usr
│       └── include
│           └── hw-cmake.h

we kind of agree ;)

----
... and what should happen for a recipe which contains both .so and .a libs?

├── libhwtest-cmake-so-a
│   └── usr
│       └── lib
│           ├── libhwtestcmake.so.0 -&gt; libhwtestcmake.so.0.0.0
│           └── libhwtestcmake.so.0.0.0
├── libhwtest-cmake-so-a-dbg
│   └── usr
│       └── lib
│           └── .debug
│               └── libhwtestcmake.so.0.0.0
├── libhwtest-cmake-so-a-dev
│   └── usr
│       ├── include
│       │   └── hwtest-cmake.h
│       └── lib
│           └── libhwtestcmake.so -&gt; libhwtestcmake.so.0
├── libhwtest-cmake-so-a-doc
├── libhwtest-cmake-so-a-locale
├── libhwtest-cmake-so-a.shlibdeps
├── libhwtest-cmake-so-a-src
│   └── usr
│       └── src
│           └── debug
│               └── libhwtest-cmake-so-a
│                   └── 1.0-r0
│                       ├── hwtest-cmake1.c
│                       └── hwtest-cmake2.c
└── libhwtest-cmake-so-a-staticdev
    └── usr
        └── lib
            └── libhwtestcmake.a

I saw: 

No debugsrc is collected for static libraries:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=12558

which might solve one of the problems (didn&apos;t try yet).

Do we need {PN}-staticdev-dbg ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85224</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2019-10-05 17:39:20 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; Please correct me if I&apos;m wrong here, and/or please tell me what I am missing
&gt; here
&gt; 
&gt; * This is my understanding about .so packaging: *
&gt; 
&gt; {PN}: main package, stripped (no symbols, no debug info)
&gt; 
&gt; ── libhwtest-cmake-so-a
&gt; │   └── usr
&gt; │       └── lib
&gt; │           ├── libhwtestcmake.so.0 -&gt; libhwtestcmake.so.0.0.0
&gt; │           └── libhwtestcmake.so.0.0.0
&gt; 
&gt; {PN}-dbg: debug info (for debugging)
&gt; 
&gt; ├── libhwtest-cmake-so-a-dbg
&gt; │   └── usr
&gt; │       └── lib
&gt; │           └── .debug
&gt; │               └── libhwtestcmake.so.0.0.0
&gt; 
&gt; {PN}-src: sources (for debugging)
&gt; 
&gt; ── libhwtest-cmake-so-a-src
&gt; │   └── usr
&gt; │       └── src
&gt; │           └── debug
&gt; │               └── libhwtest-cmake-so-a
&gt; │                   └── 1.0-r0
&gt; │                       ├── hwtest-cmake1.c
&gt; │                       └── hwtest-cmake2.c
&gt; 
&gt; {PN}-src: for SDK

{PN}-dev: for SDK
&gt; 
&gt; ── libhwtest-cmake-so-a-dev
&gt; │   └── usr
&gt; │       ├── include
&gt; │       │   └── hwtest-cmake.h
&gt; │       └── lib
&gt; │           └── libhwtestcmake.so -&gt; libhwtestcmake.so.0
&gt; 
&gt; 
&gt; -----------------
&gt; 
&gt; so far so good and I guess I&apos;m happy with this.
&gt; 
&gt; * This is my understanding about .a (staticdev) packaging: *
&gt; 
&gt; ├── libhw-cmake-a
&gt; ├── libhw-cmake-a-dbg
&gt; ├── libhw-cmake-a-dev         &lt;-- for the SDK
&gt; │   └── usr
&gt; │       └── include
&gt; │           └── hw-cmake.h
&gt; ├── libhw-cmake-a-doc
&gt; ├── libhw-cmake-a-locale
&gt; ├── libhw-cmake-a-src
&gt; └── libhw-cmake-a-staticdev  &lt;-- for the SDK
&gt;     └── usr
&gt;         └── lib
&gt;             └── libhwcmake.a
&gt; 
&gt; 
&gt; issue 1)
&gt; 
&gt; {PN}-src:
&gt; libhw-cmake-a-src seems to be empty by default, I thought it should contain
&gt; the sources
&gt; 
&gt; issue 2)
&gt; 
&gt; {PN}-dbg, or {PN}-staticdev-dbg
&gt; .debug
&gt;      └── libhw-cmake-a-staticdev.a
&gt; 
&gt; libhw-cmake-a-dbg seems to be empty by default, I thought it should contain
&gt; the debug info
&gt; 
&gt; issue 3)
&gt; 
&gt; {PN}-staticdev: 
&gt; libhw-cmake-a-staticdev.a
&gt; seems to be with debug info and not stripped, I thought it should be
&gt; stripped and without debug info
&gt; 
&gt; Is it like this by design?
&gt; 
&gt; {PN}-dev: 
&gt; ├── libhw-cmake-a-dev         &lt;-- for the SDK
&gt; │   └── usr
&gt; │       └── include
&gt; │           └── hw-cmake.h
&gt; 
&gt; we kind of agree ;)
&gt; 
&gt; ----
&gt; ... and what should happen for a recipe which contains both .so and .a libs?
&gt; 
&gt; ├── libhwtest-cmake-so-a
&gt; │   └── usr
&gt; │       └── lib
&gt; │           ├── libhwtestcmake.so.0 -&gt; libhwtestcmake.so.0.0.0
&gt; │           └── libhwtestcmake.so.0.0.0
&gt; ├── libhwtest-cmake-so-a-dbg
&gt; │   └── usr
&gt; │       └── lib
&gt; │           └── .debug
&gt; │               └── libhwtestcmake.so.0.0.0
&gt; ├── libhwtest-cmake-so-a-dev
&gt; │   └── usr
&gt; │       ├── include
&gt; │       │   └── hwtest-cmake.h
&gt; │       └── lib
&gt; │           └── libhwtestcmake.so -&gt; libhwtestcmake.so.0
&gt; ├── libhwtest-cmake-so-a-doc
&gt; ├── libhwtest-cmake-so-a-locale
&gt; ├── libhwtest-cmake-so-a.shlibdeps
&gt; ├── libhwtest-cmake-so-a-src
&gt; │   └── usr
&gt; │       └── src
&gt; │           └── debug
&gt; │               └── libhwtest-cmake-so-a
&gt; │                   └── 1.0-r0
&gt; │                       ├── hwtest-cmake1.c
&gt; │                       └── hwtest-cmake2.c
&gt; └── libhwtest-cmake-so-a-staticdev
&gt;     └── usr
&gt;         └── lib
&gt;             └── libhwtestcmake.a
&gt; 
&gt; I saw: 
&gt; 
&gt; No debugsrc is collected for static libraries:
&gt; 
&gt; https://bugzilla.yoctoproject.org/show_bug.cgi?id=12558
&gt; 
&gt; which might solve one of the problems (didn&apos;t try yet).
&gt; 
&gt; Do we need {PN}-staticdev-dbg ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85294</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-10-10 14:40:18 +0000</bug_when>
    <thetext>I think the key piece of information missing here is that we only have one -src package, one -dev package and one -dbg package for any given recipe.

The same sources are used by several different packages for example.

This means static packages would not have their own dbg/src/dev variants.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85310</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2019-10-10 18:37:28 +0000</bug_when>
    <thetext>Does this imply, that static libs will always include debug info by design?

How can I get rid of it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85466</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2019-10-29 11:20:18 +0000</bug_when>
    <thetext>Looking at package.bbclass, the stripping code has explicit logic to find static libraries.

#12558 indeed fixes the source package problem (2.5 onwards).  The dbg package should always be generated and populated for packages containing static libraries.

If you have further issues please file a new bug but be specific about what you&apos;re expecting with concrete examples.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>