<?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>2531</bug_id>
          
          <creation_ts>2012-06-01 18:09:45 +0000</creation_ts>
          <short_desc>ADT/Poky apps build fails with -static link option</short_desc>
          <delta_ts>2012-11-15 15:08:40 +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>core</component>
          <version>1.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>1.3 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Mueller">robert.mueller</reporter>
          <assigned_to name="Paul Eggleton">bluelightning</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>poky.adt.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>robert.mueller</cc>
    
    <cc>song.liu</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>21796</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Mueller">robert.mueller</who>
    <bug_when>2012-06-01 18:09:45 +0000</bug_when>
    <thetext>It looks as though the default GCC configuration in ADT 1.2 with Denzil
(Yocto 1.2) does not support static linking out of the box. Is this a known
issue or intended behavior?


# echo $CXX
i586-poky-linux-g++
# echo $CXXFLAGS
-m32 -march=i586 --sysroot=/root/test-yocto/x86
# $CXX $CXXFLAGS -static hello.c
/opt/poky/1.2/sysroots/i686-pokysdk-linux/usr/libexec/i586-poky-linux/gcc/i5
86-poky-linux/4.6.4/ld: cannot find -lstdc++
/opt/poky/1.2/sysroots/i686-pokysdk-linux/usr/libexec/i586-poky-linux/gcc/i5
86-poky-linux/4.6.4/ld: cannot find -lm
/opt/poky/1.2/sysroots/i686-pokysdk-linux/usr/libexec/i586-poky-linux/gcc/i5
86-poky-linux/4.6.4/ld: cannot find -lc
collect2: ld returned 1 exit status</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21797</commentid>
    <comment_count>1</comment_count>
    <who name="Jessica">jessica.zhang</who>
    <bug_when>2012-06-01 18:16:55 +0000</bug_when>
    <thetext>This is due to we are lacking static library files (.a) in the images that used to extracted as sysroot, e.g. sato-sdk</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22234</commentid>
    <comment_count>2</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2012-06-14 23:40:00 +0000</bug_when>
    <thetext>Which sysroot are you using and are you expecting all static libraries includes? Is this needed for 1.2 or can you work with 1.3 master?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22294</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2012-06-18 22:04:47 +0000</bug_when>
    <thetext>Moving to 1.3. Do we need some mechanism to include staticdev packages in sdk  images? I&apos;d imagine this is a consequence of the more granular packaging. This should probably be looked at in the context of the other -dbg, -dev and -doc package bugs currently open...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23000</commentid>
    <comment_count>4</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-07-11 13:07:54 +0000</bug_when>
    <thetext>Patches are now out on the OE-core list for review on this one (for merging into M3 rather than M2). They add a &quot;staticdev-pkgs&quot; IMAGE_FEATURES feature so that these packages can be optionally added.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23604</commentid>
    <comment_count>5</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-07-30 12:50:25 +0000</bug_when>
    <thetext>Implemented in the following revisions:

fa5640d143beea4be101d6622d3fa133d04272f2
98b0f956e7d16c2791cc00dbb75187b886e4cbcd</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25657</commentid>
    <comment_count>6</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2012-09-25 09:38:27 +0000</bug_when>
    <thetext>Reopening since I could reproduce with http://autobuilder.yoctoproject.org/pub/nightly/20120916-2/toolchain/i686/poky-eglibc-i686-i586-toolchain-gmae-1.2+snapshot-20120916.sh

[yocto@vostro2 tmp]$ $CXX $CXXFLAGS -static compile.cpp 
/home/yocto/tmp/x86/sysroots/x86_64-pokysdk-linux/usr/bin/i586-poky-linux/i586-poky-linux-ld: cannot find -lstdc++
/home/yocto/tmp/x86/sysroots/x86_64-pokysdk-linux/usr/bin/i586-poky-linux/i586-poky-linux-ld: cannot find -lm
/home/yocto/tmp/x86/sysroots/x86_64-pokysdk-linux/usr/bin/i586-poky-linux/i586-poky-linux-ld: cannot find -lc
collect2: error: ld returned 1 exit status
[yocto@vostro2 tmp]$</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25658</commentid>
    <comment_count>7</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-09-25 09:43:36 +0000</bug_when>
    <thetext>I was told we would not add these files by default, we would just provide the option to add them, which I have done.

Jessica, what would you like to do here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25859</commentid>
    <comment_count>8</comment_count>
    <who name="Jessica">jessica.zhang</who>
    <bug_when>2012-09-27 14:58:39 +0000</bug_when>
    <thetext>Yes, as long as we provide the mechanism to add them, we don&apos;t want to explode the image by adding them by default</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25864</commentid>
    <comment_count>9</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-09-27 18:25:20 +0000</bug_when>
    <thetext>OK, in that case I&apos;ll mark this as resolved again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27331</commentid>
    <comment_count>10</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2012-11-09 16:42:28 +0000</bug_when>
    <thetext>Hi,
I am reopening this because the static libraries are not installed in the sysroot of the standalone toolchain, built using the staticdev-pkgs option.


My investigation:
1. In order to have an image with static libraries, in local.conf the parameter &quot;staticdev-pkgs&quot; needs to be added as an extra image feature:
EXTRA_IMAGE_FEATURES = &quot;debug-tweaks staticdev-pkgs&quot;

2. Building and extracting the standalone toolchain (bitbake meta-toolchain-sdk) using this option does no add the *.a files under its sysroot libraries.

3. Instead, after building a core-image-sato-sdk qemu tarball image (using the same local.conf file as point 2.) and extracting it using runqemu-extract-sdk I could find the *.a files located in /usr/lib/ directory of that image.

So basically I believe there is a problem when the standalone toolchain is created (bitbake meta-toolchain-sdk).

tested with: &quot;master:78983e939ab17f02f8911c8b0d0e326b419856b9&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27335</commentid>
    <comment_count>11</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-11-10 13:17:47 +0000</bug_when>
    <thetext>It is not mentioned here but you need to set SDKIMAGE_FEATURES not (EXTRA_)IMAGE_FEATURES; meta-toolchain-sdk is not an image and therefore does not use the latter variables.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27365</commentid>
    <comment_count>12</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2012-11-12 16:30:08 +0000</bug_when>
    <thetext>Hi Paul,
I have tried again only with: SDKIMAGE_FEATURES = &quot;staticdev-pkgs &quot;.

Build the toolchain with meta-toolchain-sdk. Again, I have the same errors :(.

Is there something wrong with my configuration?
Also, the static libraries should be available in the toolchain aswell, right?

Regards,
Alex.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27369</commentid>
    <comment_count>13</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-11-12 17:39:59 +0000</bug_when>
    <thetext>So, you&apos;re right, looking again at this more closely it has only been implemented in a form that works for images; i.e. either for the images themselves with (EXTRA_)IMAGE_FEATURES or with SDKIMAGE_FEATURES for creating an SDK for an image (i.e. when you run bitbake -c populate_sdk name-of-image).

I&apos;m not sure whether being able to add the staticdev packages easily to meta-toolchain-sdk was intended to be part of this task. If it is I would suggest creating a new bug rather than reopening this one as it is a non-trivial extension.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27386</commentid>
    <comment_count>14</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2012-11-13 10:43:40 +0000</bug_when>
    <thetext>Ok Paul,
I will open a new bug.

Thank you for your help,
Alex.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27472</commentid>
    <comment_count>15</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2012-11-15 15:08:40 +0000</bug_when>
    <thetext>Hi,
I have opened https://bugzilla.yoctoproject.org/show_bug.cgi?id=3441 for toolchain specific.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>