<?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>795</bug_id>
          
          <creation_ts>2011-03-03 00:47:19 +0000</creation_ts>
          <short_desc>LSB: Some cases (libstdc++.so.6) failed on library check of LSB test.</short_desc>
          <delta_ts>2011-03-10 22:07: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>devtools / tool chain</component>
          <version>1.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.0 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jingdong Lu">jingdong.lu</reporter>
          <assigned_to name="Nitin Kamble">nitin.a.kamble</assigned_to>
          <cc>jingdong.lu</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>sgw</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>12228</commentid>
    <comment_count>0</comment_count>
    <who name="Jingdong Lu">jingdong.lu</who>
    <bug_when>2011-03-03 00:47:19 +0000</bug_when>
    <thetext>When we run library check of LSB on qemux86 and qemuppc, we got some failures about &apos;libstdc++.so.6&apos;.

Test environment:
Platform: Qemu-x86, Qemu-ppc
lsb image: poky-image-lsb-qemux86-test.ext3(Feb 26th, auto-build server)
Library check of LSB: 4.1.0-1

The error log:
Did not find _ZNKSt5ctypeIcE8do_widenEPKcS2_Pc (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::ctype&lt;char&gt;::do_widen(char const*, char const*, char*) const
Did not find _ZNKSt5ctypeIcE8do_widenEc (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::ctype&lt;char&gt;::do_widen(char) const
Did not find _ZNKSt5ctypeIcE9do_narrowEPKcS2_cPc (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::ctype&lt;char&gt;::do_narrow(char const*, char const*, char, char*) const
Did not find _ZNKSt5ctypeIcE9do_narrowEcc (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::ctype&lt;char&gt;::do_narrow(char, char) const


Did not find _ZNSt11range_errorD0Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::range_error::~range_error()
Did not find _ZNSt11range_errorD1Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::range_error::~range_error()
Did not find _ZNSt12domain_errorD0Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::domain_error::~domain_error()
Did not find _ZNSt12domain_errorD1Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::domain_error::~domain_error()
Did not find _ZNSt12length_errorD0Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::length_error::~length_error()
Did not find _ZNSt12length_errorD1Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::length_error::~length_error()
Did not find _ZNSt12out_of_rangeD0Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::out_of_range::~out_of_range()
Did not find _ZNSt12out_of_rangeD1Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::out_of_range::~out_of_range()
Did not find _ZNSt14overflow_errorD0Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::overflow_error::~overflow_error()
Did not find _ZNSt14overflow_errorD1Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::overflow_error::~overflow_error()
Did not find _ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEED0Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::basic_stringbuf&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::~basic_stringbuf()
Did not find _ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEED1Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::basic_stringbuf&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::~basic_stringbuf()
Did not find _ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEED0Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::basic_stringbuf&lt;wchar_t, std::char_traits&lt;wchar_t&gt;, std::allocator&lt;wchar_t&gt; &gt;::~basic_stringbuf()
Did not find _ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEED1Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::basic_stringbuf&lt;wchar_t, std::char_traits&lt;wchar_t&gt;, std::allocator&lt;wchar_t&gt; &gt;::~basic_stringbuf()
Did not find _ZNSt15underflow_errorD0Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::underflow_error::~underflow_error()
Did not find _ZNSt15underflow_errorD1Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::underflow_error::~underflow_error()
Did not find _ZNSt16invalid_argumentD0Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::invalid_argument::~invalid_argument()
Did not find _ZNSt16invalid_argumentD1Ev (GLIBCXX_3.4) in libstdc++.so.6
Unmangled symbol name: std::invalid_argument::~invalid_argument()

On qemu:
root@qemux86:~# nm -D /usr/lib/libstdc++.so.6 | grep do_widen
4c959480 T _ZNKSt5ctypeIwE8do_widenEPKcS2_Pw
4c959460 T _ZNKSt5ctypeIwE8do_widenEc

root@qemux86:~# nm -D /usr/lib/libstdc++.so.6 | grep range_error
4c90c340 T _ZNSt11range_errorC1ERKSs
4c90c340 T _ZNSt11range_errorC2ERKSs
4c9066c0 T _ZSt19__throw_range_errorPKc
4c99478c V _ZTISt11range_error
4c967487 V _ZTSSt11range_error
4c994798 V _ZTVSt11range_error</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12229</commentid>
    <comment_count>1</comment_count>
    <who name="Jingdong Lu">jingdong.lu</who>
    <bug_when>2011-03-03 01:15:54 +0000</bug_when>
    <thetext>I test the unstripped libstdc++.so.6.0.14 generated by gcc-runtime_4.5.1.bb.

eric@eric-desktop:~/poky/poky-0210/build/tmp/work/i586-poky-linux/gcc-runtime-4.5.1-r2/image/usr/lib$ nm libstdc++.so | grep do_widen
0004d220 t _ZNKSt5ctypeIcE8do_widenEPKcS2_Pc
0004d100 t _ZNKSt5ctypeIcE8do_widenEc
000a2c80 T _ZNKSt5ctypeIwE8do_widenEPKcS2_Pw
000a2c60 T _ZNKSt5ctypeIwE8do_widenEc

_ZNKSt5ctypeIcE8do_widenEPKcS2_Pc, ... should be a weak symbol like this:

root@qemux86:~# nm -D /usr/lib/libstdc\+\+.so.6 | grep do_widen
0004d130 W _ZNKSt5ctypeIcE8do_widenEPKcS2_Pc
0004d010 W _ZNKSt5ctypeIcE8do_widenEc
000a30c0 T _ZNKSt5ctypeIwE8do_widenEPKcS2_Pw
000a30a0 T _ZNKSt5ctypeIwE8do_widenEc

I found that some weak symbols (&apos;W&apos;) change into local (&apos;t&apos;) during link time and be stripped. According to compiling log, the option &quot;-fvisibility-inlines-hidden&quot; is used for gcc. And this option caused some weak symbols change into local.

In .../meta/conf/distro/include/poky-eglibc.inc
CXXFLAGS += &quot;-fvisibility-inlines-hidden&quot;

~/poky/poky-0210/build$ bitbake -e | grep  CXXFLAGS
...
# TARGET_CXXFLAGS=${TARGET_CFLAGS} -fpermissive
export TARGET_CXXFLAGS=&quot;-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -ggdb -feliminate-unused-debug-types -fpermissive&quot;
# CXXFLAGS=${TARGET_CXXFLAGS} -fvisibility-inlines-hidden
export CXXFLAGS=&quot;-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -ggdb -feliminate-unused-debug-types -fpermissive -fvisibility-inlines-hidden&quot;

So I suggest this option &quot;-fvisibility-inlines-hidden&quot; should be removed when compiling libstdc++ and I give a proposed patch for this failure.

gcc-configure-runtime.inc
--- gcc-configure-runtime.inc.orig	2011-03-03 17:09:38.754912745 +0800
+++ gcc-configure-runtime.inc	2011-03-03 17:09:49.374912073 +0800
@@ -14,6 +14,7 @@
 
 do_configure () {
 	export CXX=&quot;${CXX} -nostdinc++ -nostdlib++&quot;
+	export CXXFLAGS=&quot;${TARGET_CXXFLAGS}&quot;
 	for d in ${RUNTIMETARGET}; do
 		echo &quot;Configuring $d&quot;
 		mkdir -p ${B}/$d/

According to the suggestion from LFS, we also can unset CXXFLAGS when compiling libstdc++. I have checked these two modifications and got excepted results.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12457</commentid>
    <comment_count>2</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2011-03-10 15:38:20 +0000</bug_when>
    <thetext>sent a patch to the mailing list for fixing this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12488</commentid>
    <comment_count>3</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2011-03-10 22:07:18 +0000</bug_when>
    <thetext>http://git.pokylinux.org/cgit/cgit.cgi/poky/commit/?id=cbbfbfc54f3661f49a4b314eb187a09d7955226a</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>